Skip to content
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

ERROR: mutual_information is not a valid blockmetric type. Exiting! #4

Closed
nwschurink opened this issue Mar 28, 2018 · 8 comments
Closed

Comments

@nwschurink
Copy link

nwschurink commented Mar 28, 2018

Hi,

I am interested in trying out your registration algorithm as an initialization for rectal registration. (I would like to transfer rectal tumor segmentations to PET/CT)

Compiling the algorithm on Linux goes smoothly if I leave the cmake parameters to default.

Then, running mirorr with

time /opt/Mirorr-master/build/bin/mirorr -m CT_image.nii.gz -f T2_TRA_image.nii.gz -a 1 -c -2 -d 5 -t affine -l output/CT_to_MR-affine.tfm --save-resampled-moving output/CT_in_MR-affine.nii.gz --fresh --blockmetric mi
I get the error message as displayed in the title.

ERROR: mutual_information is not a valid blockmetric type. Exiting!

Looking into mirror.cxx I also found out that a different mutual_information metric has been implemented, in which I can define the number of histogram bin.
However, running ccmake and configuring with USE_NPW=ON, it requests a path to a milx-view library which I cannot find in the repository.

Is there any way you can help me to get this work?

Kindly thank you in advance

@ashgillman
Copy link
Member

Hi, sorry for the late reply.

Any reason you are trying to build with NPW? I have tried chasing up with some of the original authors as to what it was originally for, as far as I can see it doesn't do much. I might look at removing the option.

I have also sent an email off to Nick, who implemented the MI stuff as this shouldn't happen. I find that Mirorr tends to work well with the default without specifying a blockmetric. I believe this is how it was used with results reported in the paper.

@drhenault
Copy link
Contributor

drhenault commented Apr 4, 2018 via email

@nwschurink
Copy link
Author

Hi Ash, thank you for your response.

The reason I tried to change the blockmetric is that for my test images (pelvic T2 MRI and CT) the results are not what I was hoping for (using either a rigid or affine transform). Mirror works excelent for the test images provided, however I suspect that perhaps the different field-of-fiew of my MRI and CT image (see attached image) makes the registration harder. (I will attach an image of the result later today when I have access to my linux pc). I noticed that in the paper describing the Mirorr algorithm it was noted that a different field of view might potentially result in parameters collapsing into singularities when using the affine transform, however also the rigid transform seems to be far off in my case. Is it truly neccesary for the FOV to be the same? As this would greatly hamper the applicability of Mirorr for my purpose (i.e. registering a few hundred pelvic scans), if I would need to alter the FOV for each of these scans.

The reason why I selected MI as blockmetric is that I was hoping that this would improve the registration result. Which is also the why I tried to build it with the NPW option after running Mirorr with the mutual information metric failed. I saw something about a different mutual information metric option in mirorr.cxx if it was built with the NPW option. Unfortunately selecting this option resulted in a failed build because it depends on a private library.

If you have any thoughts about how to improve the registration results without using MI, I'm all ears :)

t2_ct_images

@drhenault
Copy link
Contributor

drhenault commented Apr 4, 2018 via email

@ashgillman
Copy link
Member

Some additional info Niels @nwschurink:

An email came back from Nick also which was not included in this public forum.

Mutual information will not work well as the blocks are too small.
NPW stands for non-parametric windows which addresses this issue.

Block matching works just fine without MI even for multimodal registration, so default should be fine.

At this point, the NPW code is unreleased. But as highlighted by David, within local patches, NCC is much more an appropriate metric - there are often only two contrasts within a patch.

@ashgillman
Copy link
Member

Thanks for highlighting this, for now I will look at removing the NPW references within the code here since they aren't helpful.

@NicholasDowson, does this mean it also won't make sense to have an mi blockmetric option, or is this issue in Niels' original message distinct?

@nwschurink
Copy link
Author

Hi David,
Thank you for your reply, and congratulations on becoming a father!

I have checked the initialization of Mirorr, which looks fine (see attached image). Then I ran the first 3/5 levels of registration by using the code in the first post. This resulted in a registration that was more off than the initialization.

However, your tip on cropping the CT image really worked out (see 2nd image). I noticed that this option is included in the Mirorr algorithm it self (using --crop).

Also regarding your note on the NCC, I am really amazed that this metric works so well. As typically correlation based metrics assume a linear intensity mapping between the volumes. Nonetheless, as was also mentioned in the Mirorr paper, apparently the NCC² behaves similar to MI. Which probably has to do with the comment of @ashgillman that a single patch often contains only two contrasts? Do I understand it correctly then and is the NCC² only evaluated on a patch by patch basis, and not on the set of patched around a voxel?

As the NCC metric is working fine, I don't believe I need the MI metric, which means that the current implementation is fine. Thank you guys for your time.

Cheers,

Niels

mirorr_initialization

mirorr_registration_affine

@drhenault
Copy link
Contributor

drhenault commented Apr 5, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants