Elastix 101

132 views
Skip to first unread message

Ivana Mihalek

unread,
Sep 26, 2022, 5:11:01 AM9/26/22
to elastix-imageregistration
Dear Elastix community,

After a day of fumbling around, I am ready to throw in the towel.
How exactly do you use Elastix?

My question boils down to this. I have a fixed image

circleF.png

And a moving image:
circleM.png
The parameters file, basically a copy from the Zoo collection (affine transformation) is attached.

I use the command line that reads:
elastix -f circleF.png  -m circleM.png  -p Parameters_Affine.txt  -out elastix_output

and I get this as a result
result.0.png

What am I missing?

Thanks

Ivana

Parameters_Affine.txt

Chitresh Bhushan

unread,
Sep 28, 2022, 5:22:30 PM9/28/22
to elastix-imageregistration
Result looks okay to me in terms of spatial alignment. 

If your question is about interpolation/typecasting/ringing issues in results (bright pixels around the circle), then that can perhaps be addressed by changing FinalBSplineInterpolationOrder to 1 or 0 as following:

(FinalBSplineInterpolationOrder 1)
OR 
(FinalBSplineInterpolationOrder 0)

Ivana Mihalek

unread,
Oct 1, 2022, 5:09:05 AM10/1/22
to elastix-imageregistration
Thank you, this might help, but my question is  dumber - why isn't the moving image moved?
Is the image file called "result" not supposed to be showing the resulting image moved to the fixed image?
(I tried using transformix, but got the same output.)

Soren Christensen

unread,
Oct 1, 2022, 5:18:47 AM10/1/22
to elastix-imag...@googlegroups.com
Hi Ivana,
 I am guessing it's moved just slightly and you see the interpolated result of a near identity transform.
Your shapes have no overlap. If an initial guess fails to provide some overlap then the similarity metrics may not be helpful.
Try positioning them with overlap.
Soren


--
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/c992f969-d47b-4d86-822d-f5e998d4743en%40googlegroups.com.

Ivana Mihalek

unread,
Oct 1, 2022, 5:37:56 AM10/1/22
to elastix-imageregistration
Hi Soren,

in that case, the suggestion sounds  very reasonable, what is this option in the parameters  doing:
opts.png

Soren Christensen

unread,
Oct 1, 2022, 5:55:49 AM10/1/22
to elastix-imag...@googlegroups.com
I believe there's a sub option to thatbfæag. Geometric or center of mass. If you use center of mass they should align I guess - depending on how center of mass is calculated they may align perfectly just with that initialization, i am not sure.
I guess if you do a 1 iteration run you can see what the initialization did for you.
Soren

Ivana Mihalek

unread,
Oct 1, 2022, 6:02:35 AM10/1/22
to elastix-imageregistration
ok, thank you!
Reply all
Reply to author
Forward
0 new messages