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

imaffine mask support #1969

Open
d-v-b opened this issue Sep 13, 2019 · 4 comments
Open

imaffine mask support #1969

d-v-b opened this issue Sep 13, 2019 · 4 comments

Comments

@d-v-b
Copy link

@d-v-b d-v-b commented Sep 13, 2019

Description

Affine registration doesn't support masked regions. The mutual information metric does appear to have some mask support, but it's not exposed by AffineRegistration. Is this on the roadmap?

@skoudoro

This comment has been minimized.

Copy link
Member

@skoudoro skoudoro commented Sep 13, 2019

Hi @d-v-b,

Thank you for pointing that, we will try to look into it. Indeed, I saw some mask support and test for the ParzenJointHistogram but we need to go deeper and play a bit with it. But feel free to create a PR if you see exactly what needs to be done!

@d-v-b

This comment has been minimized.

Copy link
Author

@d-v-b d-v-b commented Sep 13, 2019

Hi @skoudoro
I'm playing around with the code at the moment to try and understand things properly... If I feel like I can get the mask stuff working I will absolutely submit a PR.

@d-v-b

This comment has been minimized.

Copy link
Author

@d-v-b d-v-b commented Sep 15, 2019

@skoudoro I got the masking working in the mask branch of my fork of dipy, e.g.: https://github.com/d-v-b/dipy/blob/mask/dipy/align/imaffine.py

Here are the results: the middle blob is moved while the outer 8 blobs remain in place. Aligning without a mask doesn't find the translation of the middle blob, but using a mask to focus the optimization on the central region (colored square) does find that translation.
image

I next need to put together a proper test for it (maybe the example above can be the test case).

I was pretty aggressive about moving code around in AffineRegistration, I'm not sure you will like all my changes. But hopefully we can separate that from the changes related to getting the masking working right.

I'm also interested in benchmarking the timings -- i'm not sure how much (if any) speed benefit will come from masking.

@skoudoro

This comment has been minimized.

Copy link
Member

@skoudoro skoudoro commented Sep 15, 2019

Good job @d-v-b ! The result look nice! Will look into your code tonight or tomorrow.

Concerning the test, I agree that your example above is a nice test case. Look forward to see your benchmarking results!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.