-
-
Notifications
You must be signed in to change notification settings - Fork 381
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
Feature Idea/Request: HistogramMatch in antsRegistration using mask if provided #368
Comments
Hi guys. Has this feature already been implemented at any point since its inception? |
Nope |
I believe the masks are only used to restrict metric computation. Preprocessing, including smoothing, winsorization, histogram matching, happen over the entire image domain. If we were to change this, I would vote that we only do so if a mask is defined for both the fixed and the moving image. |
Perhaps it's a momentary brain lag but why can't something like this preprocessing step be done prior to the antsRegistration call? |
Note the registration uses NumberPoints=12. I've only used this once or twice and the results didn't look great, however that doesn't necessarily imply it doesn't enable better registration. |
@ntustison If so, shoudn't the
flag be removed? At least in all the applications I have encountered there is no use of this flag unless it supports masks. Even 'minor' changes in the size of the background between two images can distort the quantiles matching approach. Also, from https://itk.org/Doxygen/html/classitk_1_1HistogramMatchingImageFilter.html:
|
It's there for legacy reasons. But, yes, if I were to start development from scratch, I would not include it. |
In the meantime I have been indeed doing this step on my own, using minc_nuyl, because ImageMath also doesn't support masks. |
I can fix that |
Also, ThresholdAtMeanIntensityOn() is a crude form of masking, which |
just for historical context, these parameter choices were based on empirical data generated by Lydia Ng and Luis Ibanez.
so has little to do with ants approaches. was intended for use with demons metric. |
OK, so I looked into this a bit more. I don't think the ITK filter can be easily modified in a backwards compatible way to support masks. It could possibly be a subclass, where the histograms would be populated with all voxels inside the masks. The registration uses the threshold at mean intensity, which should exclude background but might still result in different tissue types contributing to the histograms. Both the antsMultivariateTemplateConstruction2.sh and antsCorticalThickness.sh use histogram matching, definitely something to reconsider as we update those pipelines. |
So I implemented the inverse operation for data augmentation here. Using the internals of that program, I'm pretty sure I could implement Nyul's version with arbitrary masking. Let me look a bit more and I'll try putting something together. |
For the histogram matching code, done for each stage of registration, it may be beneficial to histogram match images using masks (if provided)
See https://github.com/stnava/ANTs/blob/master/Examples/itkantsRegistrationHelper.hxx#L113-L128
It looks like the mask isn't currently passed into the preprocessing call, so that would need to be modified.
I'm looking into this but if someone is inspired (and more skilled at C++) you're also welcome to try to implement.
The text was updated successfully, but these errors were encountered: