Registration of binary images- zero gradient

187 views
Skip to first unread message

hans.d...@gmail.com

unread,
Nov 19, 2020, 11:47:08 AM11/19/20
to elastix-imageregistration
Hi all,

Thanks in advance for any responses!

I would like to register two binary images and the use the outcome as a pre-rotation of the actual images. I have this working for the larger structures in the image, however it does not for a smaller structure. This returns zeros for every iteration...

I've tried adding a fixed and moving mask (a dilated version of itself), as I presumed that the sampler was just not finding any of the 1's in the binary images. Unfortunately that was not succesful.

Attached you'll find my parameterfile. Does anyone know how to fix this?

Kind regards,

Hans Dunning



binarymaskreg.txt

hans.d...@gmail.com

unread,
Nov 20, 2020, 6:46:26 AM11/20/20
to elastix-imageregistration
Hi all,

I can across the following info: https://github.com/SuperElastix/SimpleElastix/issues/83. Which could be the reason why my registration is not working. 

However, before I implement a pre-registration in the form of a pointcloud, I was wondering if there is a method of initialization that could help. For example by looking at the centroid of the 1's in the binary images? 

From what I can find these are the initialization options: "Three methods to do so are supported: the default method which aligns the centres of the fixed and moving image, a method that aligns the centres of gravity, and a method that simply aligns the image origins" 
Fixing the centres or origins will not work in my case, as this probably does not generate any overlap. What is meant by centres of gravity in this case? Of all HU's in the images or of the masks?

Regards,

Hans

hans.d...@gmail.com

unread,
Nov 20, 2020, 7:10:11 AM11/20/20
to elastix-imageregistration
Sometimes you have to used think before you ask questions...;) Sorry for the monologue.

I've got it working. In case anyone else is interested in registration of two binary masks, here is my parameter file. This works without the use of masks on relatively small structures in the binary image without any prior overlap. 

Regards,

Hans

binarymaskregpatella.txt

M.St...@lumc.nl

unread,
Nov 25, 2020, 4:27:52 AM11/25/20
to elastix-imag...@googlegroups.com

Dear Hans,


That could indeed be an explanation.

You could use
(ImageSampler "RandomSparseMask")
to make sure the right samples are taken.

You could also consider performing a distance transform on the structures and registering those. That has the added advantage of a smooth optimization space.

Best regards,
Marius Staring




From: elastix-imag...@googlegroups.com <elastix-imag...@googlegroups.com> on behalf of hans.d...@gmail.com <hans.d...@gmail.com>
Sent: 19 November 2020 5:47 PM
To: elastix-imageregistration
Subject: [elastix-imageregistration] Registration of binary images- zero gradient
 
--
You received this message because you are subscribed to the Google Groups "elastix-imageregistration" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elastix-imageregis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elastix-imageregistration/5c3d5ae9-5a78-4f3c-8999-e34921777babn%40googlegroups.com.

M.St...@lumc.nl

unread,
Nov 25, 2020, 4:35:54 AM11/25/20
to elastix-imag...@googlegroups.com
Thank you for sharing Hans,
Marius




Sent: 20 November 2020 1:10 PM
To: elastix-imageregistration
Subject: [elastix-imageregistration] Re: Registration of binary images- zero gradient
 
Sometimes you have to used think before you ask questions...;) Sorry for the monologue.

I've got it working. In case anyone else is interested in registration of two binary masks, here is my parameter file. This works without the use of masks on relatively small structures in the binary image without any prior overlap. 

Regards,

Hans

On Friday, November 20, 2020 at 12:46:26 PM UTC+1 hans.d...@gmail.com wrote:
Hi all,

I can across the following info: https://github.com/SuperElastix/SimpleElastix/issues/83. Which could be the reason why my registration is not working. 
I have a registration problem in which I need to do a simple rigid transform of images primarily composed of thousands of small particles. Where there is some underlying low-frequency structure, simpleElastix works well, however fail wit...

However, before I implement a pre-registration in the form of a pointcloud, I was wondering if there is a method of initialization that could help. For example by looking at the centroid of the 1's in the binary images? 

From what I can find these are the initialization options: "Three methods to do so are supported: the default method which aligns the centres of the fixed and moving image, a method that aligns the centres of gravity, and a method that simply aligns the image origins" 
Fixing the centres or origins will not work in my case, as this probably does not generate any overlap. What is meant by centres of gravity in this case? Of all HU's in the images or of the masks?

Regards,

Hans

On Thursday, November 19, 2020 at 5:47:08 PM UTC+1 hans.d...@gmail.com wrote:
Hi all,

Thanks in advance for any responses!

I would like to register two binary images and the use the outcome as a pre-rotation of the actual images. I have this working for the larger structures in the image, however it does not for a smaller structure. This returns zeros for every iteration...

I've tried adding a fixed and moving mask (a dilated version of itself), as I presumed that the sampler was just not finding any of the 1's in the binary images. Unfortunately that was not succesful.

Attached you'll find my parameterfile. Does anyone know how to fix this?

Kind regards,

Hans Dunning



--
You received this message because you are subscribed to the Google Groups "elastix-imageregistration" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elastix-imageregis...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages