[Insight-users] Re: MultiResMIRegistration again!

Luis Ibanez luis.ibanez at kitware.com
Thu, 19 Feb 2004 03:28:02 -0500


Hi Christos,


1) Yes, yes, yes, ITK is N-Dimensional !

    The MutualInformation metric will be
    computed using all the pixels in the
    volume.  I agree with you... it is
    so cool that it is hard to believe.



2) You select the dimension of the image
    when you instantiate the template:

      itk::Image< PixelType, Dimension >

    You may benefit from a peaceful time
    reading the SoftwareGuide:

    http://www.itk.org/ItkSoftwareGuide.pdf
    (in particular Chapter 8, pdf-page 241).



    and following the tutorials

    http://www.itk.org/HTML/Tutorials.htm

    in particular
      http://www.itk.org/CourseWare/Training/RegistrationMethodsOverview.pdf

    (Hint: slide 28 is your lucky number)



3) BSpline registration has already been
    implemented by Dr. Lydia Ng.

    You define a 3D grid on top of your image,
    for representing the BSpline control points
    and provide the initial deformations.

    This is not in the SoftwareGuide because
    it was implemented after the publication
    of the Guide. This is brand new code,
    nicely implemented, that currently is being
    used for registering images from small
    rodents.



4)  The only special thing you need is the
     BSpline deformable transform

http://www.itk.org/Insight/Doxygen/html/classitk_1_1BSplineDeformableTransform.html

     and an optimizer adapted for large numbers
     of parameters.


     and...
     Yes, this transform is N-Dimensional too   :-)


     Just connect the Image RegistrationMethod with
     the MutualInformation metric, the LinearInterpolator,
     and the BSplineDeformableTransform.




   Life is short,

   Don't waste it writing code that is
   already well implemented in ITK.


   The dark ages are over !



Regards,



     Luis



-------------------------
Christos Panagiotou wrote:

> Dear Luis
> 
> First of all thanks for all your support, it means so much to me as I ll 
> do save loads of days
> trying to work things by myself (what i currently do is i read the 
> source of the modules involved
> to understand the algorithms)
> 
> About MI alignment:
> 
> you said that all metrics are n-dimensional:
> for example the itkMutualInformationImageToImageMetric is then 
> n-dimensional
> so when i apply it to a 3D volume it apply all the calculations directly 
> in the 3D matrix
> and not in the slices, am i correct? (how do i select the number of 
> dimensions i want it to work on?)
> 
> About non-rigid registration
> I saw that you propose a FEM approach for the non rigid registration.
> I intend to implement (because i am asked to do this :) )
> a BSpline approach based on Free Form Deformation fields (FFDs) (just a 
> 3D mesh of control points that their
> distance is equal among them and the act as the control points of the 
> BSpline)
> 
> I ve read in your email that in the section of deformable registration 
> you mention BSplines -however in the itkguide
> in the deformable registration section i did not see something like that 
> (just FEM).
> 
> About deformable registration using BSplines you probably mean the 
> itkBSplineInterpolateImageFunction (i assume that this is n-dimensional 
> too, correct?)
> and its use in a deformable registration algorithm... Is something like 
> what i ask already implemented?
> 
> luis, thank you very much for your help in advance
> 
> p.s. just in case, i have attached a paper of D. Rueckert about 
> non-rigid registration with MI. If I have not explained
> well what I want to do with the BSplines, he summarizes it in paragraph 
> 2.2. I am not asking for an explanation of what he does :)
> i just try to understand what some of the itk functions do exactly.
> 
> thank you very much once again
> any help will be deeply appreciated
> 
> christos
> 
> Luis Ibanez wrote:
> 
>>
>> Hi Christos,
>>
>> ITK is N-Dimensional.
>>
>> The registration metrics can manage 2D, 3D, 4D,...
>>
>> The limit is only the memory of your computer
>> and the amount of time that you want to let it
>> running.
>>
>> For 3D registration you can use as Transform:
>>
>>  -Rigid 3D,
>>  -Affine 3D
>>  -Deformable registrations.
>>       - BSplines
>>       - Demons
>>       - FEM
>>
>> You could try directly the FEM based registration
>> since you can setup MutualInformation as the metric.
>>
>> Please look at the registration chapter in the
>> SoftwareGuide
>>
>>
>>     http://www.itk.org/ItkSoftwareGuide.pdf
>>
>> Both to the basic registration framework and to the
>> deformable registration section.
>>
>>
>> Regards,
>>
>>
>>
>>    Luis
>>
>>
>> ---------------------------
>> Christos Panagiotou wrote:
>>
>>> dear luis
>>>
>>> sorry for the direct contact but i saw in the itk mailing list 
>>> archive that you were involved in a thread about
>>> MultiResMIRegistration and i thought you might be able to help me 
>>> with the following problem
>>>
>>> hopefuly it will be something very simple and will not take much of 
>>> your time
>>> thank you very much in advance
>>>
>>> christos
>>>
>>> p.s. i have one additional question to ask you if it is possible
>>> is the implemented algorithm applied directly to the 3D matrices of 
>>> the volumes or does it implement the alignment
>>> slice by slice? i am asking you this because ultimately i want to 
>>> implement a _non-rigid _registration of 3D volumes where the 
>>> alignment is made by direct 3D transformations. The non-rigid 
>>> transformation will be implemented by a technique suggested
>>> by DR. D. Rueckert and uses Free Form Deformations implemented with 
>>> B-Splines. To do this i need first to align the images using the 
>>> Viola MI technique which ITK has already implemented. The only thing 
>>> i need to know if it makes direct 3D transformations or if it is 
>>> reslicing the volumes and apply the MI alignment slice by slice...
>>>
>>> thank you very much for your time
>>>
>>> -------- Original Message --------
>>> Subject:     MultiResMIRegistration
>>> Date:     Mon, 16 Feb 2004 02:41:05 +0000
>>> From:     Christos Panagiotou <cpanagio at cs.ucl.ac.uk>
>>> To:     1__ITK POST <insight-users at itk.org>
>>>
>>>
>>>
>>> guys
>>>
>>> i have a problem testing the MultiResMIRegistration
>>>
>>> I have some raw volumes stored in single files ( i downloaded also a 
>>> sample from 
>>> http://www.bic.mni.mcgill.ca/brainweb/selection_normal.html as 
>>> suggested)
>>>
>>> I run the application and i get the following error messages:
>>>
>>> -------------------------------ERROR----------------------------------
>>>
>>> ./MultiResMIRegistration ~/PhD/Data/raw/test.txt
>>> Parsing input ...
>>> Fixed image filename: 
>>> /home/christos/PhD/Data/raw/pd_icbm_normal_1mm_pn0_rf0.raws
>>> Big Endian: 0
>>> Image Size: [181, 217, 181]
>>> Image Spacing: [1, 1, 1]Moving image filename: 
>>> /home/christos/PhD/Data/raw/pd_icbm_normal_1mm_pn0_rf0.raws
>>> Big Endian: 0
>>> Image Size: [181, 217, 181]
>>> Image Spacing: [1, 1, 1]Permute order: [0, 1, 2]Flip axes: [0, 0, 
>>> 0]Number of levels: 5
>>> Fixed image shrink factors: [4, 4, 1]Moving image shrink factors: [8, 
>>> 8, 1]Number of iterations: [2500, 2500, 2500, 2500, 2500]Learning 
>>> rates: [1e-04, 1e-05, 5e-06, 1e-06, 5e-07]Translation scale: 320
>>> PGM directory: /home/christos/PhD/Data/raw/pgm
>>>
>>> Error while reading in fixed image.
>>> Error occured during registration
>>> itk::ExceptionObject caught
>>>
>>> itk::ImageFileReaderException (0x9470288)
>>> Location: "Unknown"
>>> File: /home/christos/Applications/ITK/Code/IO/itkImageFileReader.txx
>>> Line: 101
>>> Description:  Could not create IO object for file 
>>> /home/christos/PhD/Data/raw/pd_icbm_normal_1mm_pn0_rf0.raws
>>>
>>>
>>> Caught an ITK exception:
>>>
>>> itk::ImageFileReaderException (0x9470288)
>>> Location: "Unknown"
>>> File: /home/christos/Applications/ITK/Code/IO/itkImageFileReader.txx
>>> Line: 101
>>> Description:  Could not create IO object for file 
>>> /home/christos/PhD/Data/raw/pd_icbm_normal_1mm_pn0_rf0.raws
>>>
>>> -------------------------------ERROR----------------------------------
>>>
>>> the input file is just an alteration of the sample inputs where i 
>>> altered the paths and some other info s.a. volume xyz sizes, the pgm 
>>> output dir etc.
>>>
>>> i also paste the input file incase i did something wrong there and i 
>>> cant see it...
>>>
>>> --------------------------------input-------------------------------------- 
>>>
>>>
>>> /home/christos/PhD/Data/raw/pd_icbm_normal_1mm_pn0_rf0.raws
>>> 0
>>> 181 217 181
>>> 1.0 1.0 1.0
>>> /home/christos/PhD/Data/raw/pd_icbm_normal_1mm_pn0_rf0.raws
>>> 0
>>> 181 217 181
>>> 1.0 1.0 1.0
>>> 0 1 2
>>> 0 0 0
>>> 5
>>> 4 4 1
>>> 8 8 1
>>> 2500 2500 2500 2500 2500
>>> 1e-4 1e-5 5e-6 1e-6 5e-7
>>> 320
>>> /home/christos/PhD/Data/raw/pgm
>>>
>>> --------------------------------input-------------------------------------- 
>>>
>>>
>>> as you see i am using the same volume however i tried also with 
>>> different volumes from the brainweb and alternate sources...
>>>
>>> any suggestions would be appreciated
>>>
>>> thanks
>>> christos
>>>
>>>
>