[Insight-users] register two volumes of different types
Luis Ibanez
luis.ibanez at kitware.com
Mon Dec 5 16:08:11 EST 2005
Hi Grace,
Please read the chapter on Image Registration from
the ITK Software Guide.
You are right, a rigid transform has rotation and
translation; but given that you are in a clinical
environment where rotations are usually small, you
can safely initialize the rotational part of your
transform ot a Null rotation. This is simply done
when you call SetIdentity() on the transfrom.
After you call SetIdentity() you invoke SetTranslation()
in the transform, and then you get the current parameters
of the transform and pass them as the Initial parameters
to the Registration Method.
If you print out the values of the array returned by
transform->GetParameters() you will understand better
how you are initializing the transform.
You are right that the job of the registration program
is to find the best Transform.
but
an Optimizer cannot always find a peak in a cost function
in a six dimensional space without falling in local optima.
So, it is your job to initialize the Optimizer (e.g. the
Transform) close enough to a good registration, so that
the Optimizer can do its job of fine tunning the values
of the Transform.
If you look at the plots of ImageMetric values in any
of the examples of the ITK Software Guide, you will
better understand by it is unrealistic, or even naive
to expect that the optimizer can find the best value
without proper initialization.
Please note that you *ARE NOT* computing the Transformation.
You are computing an *INITIAL VALUE* for that Transformation,
so that the Optimizer can start from there and find the optimal
transformation for you.
When you are dealing with brain images, you can imagine that due
to the size of typical human head, a misalignment of more that
50 millimeters can not easily be corrected by exploring with
an optimizer the parametric space of the Transform. Therefore
you should initialize the Transform, so that the initial
misalignment between the two images is below 20 millimeters.
Please read the Section 6.9 of the ITK Software Guide too.
Regards,
Luis
-------------------
Grace Chen wrote:
> Hi Luis,
>
> About setting the initial translation, I really don't get this...a rigid
> movement include both rotation as well as the translation. Isn't it the
> registration program's job to find out the translation needed to align the
> center of both images? If so, why do we need to compute that information
> for it?
>
> Grace
>
>
> ----- Original Message -----
> From: "Luis Ibanez" <luis.ibanez at kitware.com>
> To: "Grace Chen" <Grace.Chen at swri.ca>
> Cc: <insight-users at itk.org>
> Sent: Friday, December 02, 2005 5:19 PM
> Subject: Re: [Insight-users] register two volumes of different types
>
>
>
>>Hi Grace,
>>
>>You will find tutorial material in the Image
>>Registration Chapter of the ITK Software Guide
>>
>> http://www.itk.org/ItkSoftwareGuide.pdf
>>
>>in particular you will find explanations on the use
>>of the optimizer parameters, the scaling factors,
>>the transform parameters and the use of Observers.
>>
>>
>>
>>BTW it is very disturbing that your algorithm exits
>>without even making one iteration of the optimizer.
>>Something is certainly wrong at a higher level. A
>>typical registration should use 50 to 500 iterations
>>of the optimizer.
>>
>>
>>Please read the Image Registration chapter and let us
>>know if you have further questions.
>>
>>
>> Thanks
>>
>>
>> Luis
>>
>>
>>
>>------------------
>>Grace Chen wrote:
>>
>>>Hi Luis,
>>>
>>>Thanx for your wonderful suggestion! I haven't done file IO for a long
>
> time
>
>>>so it didn't immediately appear to me as a debugging technique.
>>>
>>>So, I did my homework! : ) I added an Observer, and inserted code to
>
> write
>
>>>metric information to a file. However, when the fix image is the
>
> diffusion
>
>>>weighted image and the moving image is the T1 weighted image, the
>
> program
>
>>>didn't even write one line to the file before it exit.
>>>
>>>I have to admit that I don't understand those registration parameters
>
> (the
>
>>>rotation for the VersorRigid3DTransform and the optimizer scale) well.
>
> Is
>
>>>there some tutorial material that help explain how to set those
>
> parameters?
>
>>>Thanx a lot for your help!!
>>>
>>>Grace
>>>
>>>----- Original Message -----
>>>From: "Luis Ibanez" <luis.ibanez at kitware.com>
>>>To: "Grace Chen" <Grace.Chen at swri.ca>
>>>Cc: <insight-users at itk.org>
>>>Sent: Thursday, December 01, 2005 5:41 PM
>>>Subject: Re: [Insight-users] register two volumes of different types
>>>
>>>
>>>
>>>
>>>>Hi Grace,
>>>>
>>>>
>>>> You can have the Observer write the results to a file.
>>>>
>>>> There is no reason why you couldn't run it this way
>>>> when you invoke the registration from IDL.
>>>>
>>>>
>>>>
>>>> The fact that reversing the image gets your registration
>>>> to work is quite *suspicious*. That shouldn't be the case.
>>>> Registration is supposed to be roughly symmetrical. Meaning
>>>> that although the path of the optimizer doesn't have to be
>>>> the same, it is to be expected that the registration should
>>>> work in both ways.
>>>>
>>>>
>>>> > Does anyone knows what this means?
>>>>
>>>>
>>>> Well, it means that the configuration of parameters
>>>> for your registration is still quite fragile and
>>>> probably that the ImageMetric is very very noisy.
>>>>
>>>>
>>>>
>>>> Now that, from the practical point of view...
>>>> it means that you still have to do your Homework:
>>>>
>>>>
>>>> Connect an Observer to the Optimizer
>>>> and send the Metric and Transform
>>>> parameters per iteration to a file.
>>>>
>>>>
>>>>
>>>>
>>>> In the time that we have been exchanging emails, you could
>>>> have done that homework, and by now you would have a real
>>>> answer to your registration problem.
>>>>
>>>>
>>>>
>>>> Regards,
>>>>
>>>>
>>>> Luis
>>>>
>>>>
>>>>
>>>>------------------
>>>>Grace Chen wrote:
>>>>
>>>>
>>>>>Hi Luis,
>>>>>
>>>>>Thanx so much for your help!
>>>>>
>>>>>Because the structure of my program is set up in a way that the ITK
>>>>>registration bit is at the lowest level (my program is an IDL program
>>>>>calling C++ programs that uses ITK registration code). So, to see
>
> those
>
>>>>>registration parameters, I will have to set up another platform to see
>>>
>>>the
>>>
>>>
>>>>>testing output. It might takes quite some time, so I will try some
>>>
>>>other
>>>
>>>
>>>>>possibilities first.
>>>>>
>>>>>I just reversed the order of the image so that the moving image is the
>>>>>diffusion weighted data and the fixed image is T1 image data (the
>>>
>>>moviing
>>>
>>>
>>>>>image was the T1 data and the fixed image was the diffusion weighted
>>>
>>>image
>>>
>>>
>>>>>when the program gave me segmentation fault!!), and it works now! Does
>>>>>anyone knows what this means?
>>>>>
>>>>>Grace
>>>>>
>>>>>----- Original Message -----
>>>>>From: "Luis Ibanez" <luis.ibanez at kitware.com>
>>>>>To: "Grace Chen" <Grace.Chen at swri.ca>
>>>>>Cc: <insight-users at itk.org>
>>>>>Sent: Thursday, December 01, 2005 11:26 AM
>>>>>Subject: Re: [Insight-users] register two volumes of different types
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Hi Grace,
>>>>>>
>>>>>>
>>>>>>Thanks a lot for sharing the screenshots of your images.
>>>>>>
>>>>>>
>>>>>> They don't look too bad.
>>>>>>
>>>>>>
>>>>>>The registration shouldn't have major problems with these
>>>>>>two images.
>>>>>>
>>>>>>
>>>>>>
>>>>>>Could you please do the following:
>>>>>>
>>>>>>
>>>>>> 1) Add an observer to your optimizer,
>>>>>>
>>>>>> 2) Make it print the values of the Metric
>>>>>> and Transform paramters at every iteration.
>>>>>>
>>>>>> 3) Take the output of the observer and post it
>>>>>> to this list.
>>>>>>
>>>>>> 4) Add also statements such as
>>>>>>
>>>>>> fixedImage->Print( std::cout )
>>>>>> movingImage->Print( std::cout )
>>>>>>
>>>>>> just before triggering the registration process,
>>>>>> and post the output to the list too.
>>>>>>
>>>>>>
>>>>>>
>>>>>>By looking at the values of the Metric, the Transform
>>>>>>parameters, and the metadata of your images we should
>>>>>>be able to identify the reason why your registration
>>>>>>process is not working.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>>
>>>>>>
>>>>>> Luis
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>-----------------------
>>>>>>Grace Chen wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Hi Luis,
>>>>>>>
>>>>>>>Thanx so much for detailed reply. With this mail, I've attached a
>>>
>>>slice
>>>
>>>
>>>>>>>from each of the volumes.
>>>>>>
>>>>>>
>>>>>>>Thanx.
>>>>>>>
>>>>>>>Grace
>>>>>>>
>>>>>>>----- Original Message -----
>>>>>>>From: "Luis Ibanez" <luis.ibanez at kitware.com>
>>>>>>>To: "Grace Chen" <Grace.Chen at swri.ca>
>>>>>>>Cc: <insight-users at itk.org>
>>>>>>>Sent: Thursday, December 01, 2005 10:45 AM
>>>>>>>Subject: Re: [Insight-users] register two volumes of different types
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>Hi Grace,
>>>>>>>>
>>>>>>>>
>>>>>>>> Yes,
>>>>>>>>
>>>>>>>>
>>>>>>>> ITK can register pairs of images
>>>>>>>> that have different number of slices.
>>>>>>>>
>>>>>>>>
>>>>>>>> or for that matter,
>>>>>>>> different number of pixels
>>>>>>>> along any dimension.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>If your registration program is not working
>>>>>>>>as you expected, here are the first things
>>>>>>>>that you should try:
>>>>>>>>
>>>>>>>>
>>>>>>>>1) Verify the values of Origin and Pixel
>>>>>>>> Spacing for both images. Make sure that
>>>>>>>> they are realistic values.
>>>>>>>>
>>>>>>>>2) Use a CenteredTransform Initializer.
>>>>>>>>
>>>>>>>>3) Connect an Observer to the Optimizer
>>>>>>>>
>>>>>>>>4) Plot the values of the Metric, at every
>>>>>>>> iteration of the optimizer.
>>>>>>>>
>>>>>>>>5) Plot the list of Transform parameters
>>>>>>>> at every iteration of the optimizer
>>>>>>>>
>>>>>>>>
>>>>>>>>Details on how to do each one of those steps
>>>>>>>>are presented in the ITK Software Guide
>>>>>>>>
>>>>>>>>http://www.itk.org/ItkSoftwareGuide.pdf
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>If you still have difficulties with your
>>>>>>>>registration process, please post your problem
>>>>>>>>as an article to the Insight Journal, and make
>>>>>>>>sure that you upload your two images, the source
>>>>>>>>code that you are using, and the parameters that
>>>>>>>>you are passing to all the components of the
>>>>>>>>registration framework.
>>>>>>>>
>>>>>>>>
>>>>>>>>Please let us know if you have any question on
>>>>>>>>how to submit a report of negative results.
>>>>>>>>This is a forgotten art in the practice of scientific
>>>>>>>>research, mostly due to the detrimental influence of
>>>>>>>>the decadent publishing system that have provided
>>>>>>>>Pavlovian training to our community in order to only
>>>>>>>>report successful experiencies.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>Regards,
>>>>>>>>
>>>>>>>>
>>>>>>>> Luis
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>------------------
>>>>>>>>Grace Chen wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>Hi there, Good day!
>>>>>>>>>
>>>>>>>>>I have two 3D image data I want to register. The movement in the
>>>
>>>data
>>>
>>>
>>>>>>>>>is 3D rigid. So, I use VersorRigid3DTransform. The two volumes
>
> are
>
>>>>>>>>>different types of image data (one is T1 image, and the other
>>>>>>>>>is diffusion weighted image), so I use
>>>>>>>>>MattesMutualInformationImageToImageMetric. I know ITK can register
>>>
>>>two
>>>
>>>
>>>>>>>>>volumes of different physical dimension. But doesn't it also
>>>
>>>register
>>>
>>>
>>>>>>>>>two volumes that have different number of slices? My program
>
> doesn't
>
>>>>>>>>>work for two volumes of different types, am I missing something?
>>>>>>>>>
>>>>>>>>>Grace
>>>>>>>>>
>>>>>>>>>
>>>>>>
>>>>>>-----------------------------------------------------------------------
>
> -
>
>>>>>>>>>_______________________________________________
>>>>>>>>>Insight-users mailing list
>>>>>>>>>Insight-users at itk.org
>>>>>>>>>http://www.itk.org/mailman/listinfo/insight-users
>>>>>>>>
>>>>>>>>_______________________________________________
>>>>>>>>Insight-users mailing list
>>>>>>>>Insight-users at itk.org
>>>>>>>>http://www.itk.org/mailman/listinfo/insight-users
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>------------------------------------------------------------------------
>>>>>
>>>>>------------------------------------------------------------------------
>>>>>
>>>>>>_______________________________________________
>>>>>>Insight-users mailing list
>>>>>>Insight-users at itk.org
>>>>>>http://www.itk.org/mailman/listinfo/insight-users
>>>>>>
>>>>>
>>>>>
>>>>>_______________________________________________
>>>>>Insight-users mailing list
>>>>>Insight-users at itk.org
>>>>>http://www.itk.org/mailman/listinfo/insight-users
>>>>>
>>>>>
>>>>
>>>>_______________________________________________
>>>>Insight-users mailing list
>>>>Insight-users at itk.org
>>>>http://www.itk.org/mailman/listinfo/insight-users
>>>>
>>>
>>>
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-users
>>>
>>>
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
>>
>
>
>
>
More information about the Insight-users
mailing list