-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixel2voxel: Fix dimensionality of output image #1352
Conversation
When the operator chosen to map fixel data to a voxel grid results in a single scalar value per voxel, the output image should logically be a 3D image. However, due to use of the fixel format index image as the template, many such images come out as 4D. This change explicitly sets the output image dimensionality for each choice of operator.
I'm not sure I fully appreciate all the subtleties and side-effects of these changes, but it reminds of similar discussions we had on stripping out singleton dimensions in commands that generally produce 4D output, but can sometimes produce 3D output in the form of a 4D image with a singleton trailing dimension - issues #55, #343, #344 & #552 in particular. Do the concerns I'd raised about these kinds of changes also apply in this context? Things like this specific example spring to mind... |
I get the concern, but I don't think they're relevant here. In the |
OK, that's good to hear. 👍 |
Ok, (have to admit) I haven't had the time to look into the details, but I've seen problems in scripts (both my own as well as other peoples') being introduced due to this dimensionality aspect. One important script that at least uses |
Anyone wrapping this functionality within a script would need to explicitly rely on the fact that the output of the command is currently inappropriate (i.e. try to access the second zero-filled volume for an operator that one would expect to produce a single volume) in order for the change proposed here to trigger an issue in their script. But it's behaviour modification nevertheless; so let's go to |
When the operator chosen to map fixel data to a voxel grid results in a single scalar value per voxel, the output image should logically be a 3D image. However, due to use of the fixel format index image as the template, many such images come out as 4D. This change explicitly sets the output image dimensionality for each choice of operator.
The test data need to be updated also; but I'm posting here first to see people's opinions on base branch for the merge before I do so. I personally consider this a "bug", since when writing a script wrapping this functionality I had to explicitly pipe the result to
mrconvert -coord 3 - -axes 0,1,2
in order to get what would intuitively seem the "correct" result. But conversely, the command is not fundamentally "broken" in terms of crashing or producing outright erroneous results, and this change does "alter behaviour", which would justify instead going todev
... Thoughts?