embl-cba / elastixWrapper

13 stars 2 forks source link

Metric's in Fiji #1

Open Maik-Lu opened 5 years ago

Maik-Lu commented 5 years ago

I'm using Elastix for 2D/3D registrations. Since I'm using Fiji for most of my image processing steps I was quite happy to find this plugin - thank you @tischi. I have a short question: Since I'm normaly using "MultiMetricMultiResolutionRegistration" with Mattes Mutal and Euclidean Distance Metric, I was wondering if it's possible to change the metric within the Fiji plugin. Normally I search for Landmarks in Fiji and than do the registration in Elastix and it would be really straight forward to do everything in Fiji.

tischi commented 5 years ago

Thank you very much for your interest @Maik-Lu!

For multi-channel images, I am already using MultiMetricMultiResolutionRegistration.

And in general, I am using AdvancedMattesMutualInformation for the metric.

I also had a look at the CorrespondingPointsEuclideanDistanceMetric and it seems that one needs to provide additional landmark information in the form of two text files. Do you have experience with this? I never used this... But it could be very interesting, because I typically have the problem that images need to be quite well pre-aligned for elastix not to get stuck in local minima. Is that where the landmarks help?

If you you are interested in more manual landmark based registration this might be also interesting for you: https://imagej.net/BigWarp

Maik-Lu commented 5 years ago

Thank's for the answer @tischi . Yes, I alway use two text files for the Landmarks for CPEuclideanDistancesMetric in addition to AdvancedMattesMutualInformation. Without the Points in 3D/2D registration it always stucks somewhere/doesn't work at all. I think it'll help you because it works for me without any pre-alignment.

tischi commented 5 years ago

@Maik-Lu, That sounds super interesting! And how do you generate the matching landmark points in Fiji? Did you write a macro or plugin for that?

Maik-Lu commented 5 years ago

@tischi, yes this is where the problem starts. I open the images in Fiji and look for at least three points which I find in both images and write them down manualy in a txt file. Then I use the points for Elastixs in ITK.

tischi commented 5 years ago

@Maik-Lu Sounds like the workflow could be improved :-) Did you ever try https://imagej.net/BigWarp?

Maik-Lu commented 5 years ago

@tischi No, I I didn't, the nice thing about Elastix is that I can use both metrics at the same time and define different weights for the two. The points help that the 3D image remains around the position of the 2D section / local minima are avoided, but the actual fine-tuning is done by AdvancedMattesMutualInformation.

tischi commented 5 years ago

@Maik-Lu OK! I think adding a user interface for convenient selection of pairs of points would be super nice, and I will definitely do it at some point, but I am a bit overloaded with other work at the minute... Could you maybe be me a favor and try out whether the way this is done in BigWarp feels good to you? Because, in fact, my idea would be to steal their code....

Maik-Lu commented 5 years ago

@tischi nice - looking forward to it. Next week I will have some new VisNIR images, than I will definitely play around with BigWarp.

Maik-Lu commented 5 years ago

@tischi It's a really nice plugin and easy to use - I will now also use it to safe the landmarks for Elastix. A combination of your plugin with AdvancedMattesMutualInformation and the addition of the point selection like in BigWarp for EuclideanDistanceMetric would be a super plugin for 2D/3D or 3D/3D registration.

tischi commented 5 years ago

Very good to hear! Maybe a first step could be that I read within my plugin directly the landmark files from BigWarp? Could you provide me with such a file as written by BigWarp? Ideally together with some actual image data, such that I can test it.

Maik-Lu commented 5 years ago

@tischi Cool - I sent you small images as examples. I often use Pyramideshedule to enhance the performance, Elastix is much faster with it. Do you plan to implement this in the plugin too?