-
Notifications
You must be signed in to change notification settings - Fork 70
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
aggregate-images: Unexpected results #691
Comments
Thanks for reporting this. Because MIRTK/Applications/src/aggregate-images.cc Line 664 in 777c5be
I would assume for your particular input data, the variable values should be:
Image values are internally cast to Another possibility, though less likely here I hope, would be errors introduced by the conversion to
Now, looking at |
I guess the correct parameters for
where Which basically means
Positive side effect, when |
Also please feel free to review the changes and comment if anything seems odd. Given the lack of testing, this would be very good to have a second pair of eyes check the validity of the change. |
Thank you for the PR. Here are the updated test results:
It is still strange that the output from aggregating three identical input images is not identical to these inputs. So I break out seg_stats from NiftySeg to get a count of each label (does MIRTK have a tool for this?):
Pardon the long lines, but the essence is that every third label is as expected (those divisible by 3), and the other two are 0 or otherwise non-matching. |
Hm, one step closer. Thanks for checking and sharing your input file. I will have to add proper tests for these applications, starting with this one... |
PS: I thought there was a command similar to IRTK's labelStats, but apparently I didn't migrate it. |
There is |
Sorry about that, blame it on my PhD! :-) |
When processing images with only natural numbers in
mode
/majority
mode,aggregate-images
generates images containing non-natural numbers. Expected result is for all voxel values in the output to be members of the set of voxel values in the input images. Sample session (where the resultagg.nii.gz
is expected to be identical to the inputseg95.nii.gz
):The text was updated successfully, but these errors were encountered: