[ITK] update dynamically images in the registration pipeline

Francois.GIRINON at ensam.eu Francois.GIRINON at ensam.eu
Fri Jun 24 09:22:01 EDT 2016


Sure, I've already had a look to this but it would be wrong to compute the derivative that way because it involves x' = T(p,x) [the x pixel location transformed by T with parameters p] has the same intensity than x. It would be right if the transformed pixel kept the same intensity value. In my case, the image is generated each time. 
________________________________________
De : Timothee Evain [tevain at telecom-paristech.fr]
Envoyé : vendredi 24 juin 2016 14:11
À : GIRINON François
Cc : community at itk.org
Objet : Re: [ITK] update dynamically images in the registration pipeline

Please remind to keep the discussion posted to the mail list for record.

There are plenty of ways to numerically estimate the gradient magnitude, you could use :
-itkGradientMagnitudeImageFilter
-itkGradientMagnitudeRecursiveGaussianImageFilter
-itkDerivativeImageFilter
-with your own Sobel operator
...
Then use this image gradient in your cost function regarding the image contribution to partial derivatives. That's how ITK does it (e.g. https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Registration/Common/include/itkMeanSquaresImageToImageMetric.hxx , lines 150-200).

Tim


----- Mail original -----
De: "Francois GIRINON" <Francois.GIRINON at ensam.eu>
À: tevain at telecom-paristech.fr
Envoyé: Vendredi 24 Juin 2016 11:45:27
Objet: RE:[ITK] update dynamically images in the registration pipeline

Xrays are generated from the meshes and compared to the original ones using a metric. The thing is, it must be really hard and maybe impossible to compute explicitely the derivative of the cost function.
That's why I'd like to know if there is any way in ITK to estimate the gradient like dlib does : http://dlib.net/optimization.html#find_min_using_approximate_derivatives

Thanks again.
François.
________________________________________
De : Timothee Evain [tevain at telecom-paristech.fr]
Envoyé : vendredi 24 juin 2016 10:08
À : GIRINON François
Cc : community at itk.org
Objet : Re: [ITK] update dynamically images in the registration pipeline

Since I do not know what is your cost function, I can't really help you.
>From a generic point of view, you should compute the partial derivative of the cost function for each parameter.

Tim


----- Mail original -----
De: "Francois GIRINON" <Francois.GIRINON at ensam.eu>
À: tevain at telecom-paristech.fr
Envoyé: Jeudi 23 Juin 2016 18:52:29
Objet: RE:[ITK] update dynamically images in the registration pipeline

Hello Tim,

I'm finally following your advice. I'm writing a specific costFunction class with a new registration pipeline : itkPointSetToMultiImagesRegistrationMethod.
I thought the derivative in the metric classes was approximated which is not. Do you know any way to approximate it by the way ?

Thanks for your help.
________________________________________
De : Timothee Evain [tevain at telecom-paristech.fr]
Envoyé : jeudi 23 juin 2016 13:37
À : GIRINON François
Cc : community at itk.org
Objet : Re: [ITK] update dynamically images in the registration pipeline

Hello François,

One solution for you could be to create your own cost function to optimize through an itk optimizer.
In your case, the comparison between the two mesh-based images and fixed images seems quite easy so you should be able to have a single-valued cost function.
You can find examples of custom CFs in the optimizers tests, like here : https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Numerics/Optimizers/test/itkRegularStepGradientDescentOptimizerTest.cxx
It basically consist in redefining the GetValue and GetDerivative methods, the later being used in some optimizers which need access to derivatives (like the gradient descent).
Then, you just have to plug this custom function to an ordinary itk optimization pipeline to get your best transformation.

HTH,

Tim

----- Mail original -----
De: "Francois GIRINON" <Francois.GIRINON at ensam.eu>
À: community at itk.org
Envoyé: Jeudi 23 Juin 2016 11:55:36
Objet: [ITK] update dynamically images in the registration pipeline

Hello everyone,

I'd like to suit the registration pipeline to a particular use:
1) I have two fixed target images
2) I have an itk transform which generates an itk mesh, and from this mesh two images are dynamically generated
3) Using the metric methods of ITK I want to optimize the above transform parameters to minimize the metric

As a matter of fact, I don't really need any interpolation method since the generated images already have the same resolution and size. However I can still use a nearest-neighbor interpolation if required.

The real question is where and how to update the dynamically generated images ?

One of my ideas was to create a kind of wrapper like https://itk.org/Doxygen/html/classitk_1_1ObjectToObjectMultiMetricv4.html and starting the GetValue method with an update of my images. The problem is more about the GetValueAndDerivative which I guess tries to evaluate the metric for closest parameters values. I don't know here where should I put my update method.


Thanks!
François.
_______________________________________________
Community mailing list
Community at itk.org
http://public.kitware.com/mailman/listinfo/community


More information about the Community mailing list