Ok, so not a slice, but definitely still a “slab”. The same “issue” applies though: the default erosion of 3 voxels that is applied to the mask will obliterate your mask (since it’s only 5 voxels wide, and 3 voxels get eroded at both sides). Not eroding, well, doesn’t erode of course; and you see indeed what that step is there for: to avoid those few voxels at the edge! In principle, you would probably only want to erode in 2 dimensions (and not along the 3D dimension, i.e. along the thickness of your slab). But indeed, the easy solution here is to just replicate the slab a few times, and allow erosion as normal (i.e. don’t specify
-erode explicitly, so the default of 3 voxels applies). It’s not “perfect” etc…, but you’ll get the good quality response functions you’ll need anyway (and that is the goal, after all).
No worries for the sake of response function selection: the algorithm never interpolates, only selects existing voxels. You can still up-sample afterwards, just before performing the CSD step.
This does bring up another possibility for your initial problem: up-sampling the data will also create extra “slices”. However, you’d then still end up only selecting voxels from the more middle slice of your slab, if erosion does what it does by default. Plus, the algorithm would run much slower on the up-sampled data. That’s why, typically, I don’t advise to up-sample the data (be)for(e) response function selection; it works perfectly fine on non-upsampled original resolution data.
Probably the reason it didn’t work on non-isotropic data is one of the above; so unrelated to the actual voxels being non-isotropic. I’ve actually run the
dhollander algorithm with success here on data of a ridiculous low quality: adult human in-vivo brain, but highly anisotropic voxels, and low spatial resolution, and a b-value of less than 1000, and only 12 gradient directions (all of this in one dataset)… still selects perfectly fine response functions for all 3 tissue types; and the voxels it selects for it, also still make full sense.