ANTsX / ANTs

Advanced Normalization Tools (ANTs)
Apache License 2.0
1.21k stars 381 forks source link

Feature Idea: kmeans clustered histograms for Mattes and MI #295

Open gdevenyi opened 8 years ago

gdevenyi commented 8 years ago

Was looking into the impacts of histogram bin sizes for Mattes/MI and I came across this interesting paper:

Normalized mutual information based registration using k-means clustering and shading correction. http://europepmc.org/abstract/MED/16111913

The reasoning for unequal histogram bins seems reasonable to not subdivide anatomically similar regions.

I took a look at the Mattes and MI implementations in ITK and it looks like the histogram construction is part of the function itself.

My C++ isn't strong enough to modify the code directly so I tried the following hack, kmeans threshold both images, set the number of bins in the Mattes metric thresholds + 1:

> ThresholdImage 3 $movingfile $tmpdir/$(basename $movingfile) Kmeans $thresholds
> ThresholdImage 3 $fixedfile $tmpdir/$(basename $fixedfile) Kmeans $thresholds
> antsRegistration ....
  --transform Affine[0.1] --metric Mattes[$tmpdir/$(basename $fixedfile),$tmpdir/$(basename $movingfile),1,$(expr $thresholds + 1)] ....

Simple eyeballing of the registrations seems to show similar registration quality with a nice speed increase.

I'd like to examine this a bit more systematically, but I'm not sure how to go about computing some comparisons.

Can anyone suggest a systematic way to compare registration methods? Does this method seem reasonable enough to investigate further?

gdevenyi commented 8 years ago

Any thoughts on this?

ntustison commented 8 years ago

Sure. If you think it's worthwhile, why don't you write a similarity metric class and submit an Insight Journal article? That would help determine whether or not it's worth incorporating into ANTs.

gdevenyi commented 8 years ago

Any pointers on where to start? My C++ skills are not at a "writing from scratch" stage right now...

ntustison commented 8 years ago

https://github.com/InsightSoftwareConsortium/ITK/tree/master/Modules/Registration/Metricsv4

specifically, you might want to look at Mattes .hxx and .h files.

as well as the parent .h and .hxx files.