[Insight-users] Problems with 3D DeformableRegistrationFilter

Luis Ibanez luis.ibanez at kitware.com
Sat, 10 Apr 2004 12:25:56 -0400


Hi Jayme,

Thanks for sending your code.

It is not clear why the pixel type should make
any difference, specially given the fact that
after the readers there is a RescaleImageFilter.

 From your message it is not yet clear to me if
you got the registration working or not.
If you did, it will be nice to add your file
as an example into

    Insight/Examples/Registration

along with the configuration input file.


Please let us know about the status of your
registration process.



   Thanks,


     Luis


-------------------
Jayme Kosior wrote:

> Hi Luis,
> 
> I believe I figured out what was causing the registration to fail.  The 
> data that I was using was in 8-bit format.  I converted it into 32-bit 
> format and I changed the line:
> 
> //typedef itk::Image<unsigned char, 3>                    fileImage3DType;
> 
> to:
> 
> typedef itk::Image<float, 3>                    fileImage3DType;
> 
> since the image pixel type was defined as:
> 
> typedef itk::Image<float, 3>                            Image3DType;
> 
> The RatLungSlice1.mha and RatLungSlice2.mha provided with the ITK 
> examples were both 8-bits, and so I had assumed that there was a type 
> cast/conversion after the RescaleIntensityImageFilter ran, since it was 
> setup as:
> 
>  typedef itk::RescaleIntensityImageFilter<fileImage3DType,Image3DType> 
> FilterType;
> 
> 
> One thing that is strange is that 2D deformable registration worked 
> (i.e. produced a noticeable deformation) using 8-bit images as input, 
> but the same is not true for 3D images.  As I said before, all that 
> happened is that the moving images would be transformed into the fixed 
> image space, but no deformation would occur.
> 
> In order to test to see if the registration is working, I have been 
> registering 3D MR FLAIR to 3D Perfusion data sets.  They are both at 
> slightly different angles (~8 degress x-y plane, ~20 degrees z-plane, 
> plus EPI distortion), but I did not register them using a rigid body 
> method (i.e. VersorRigid3DTransform --> in fact, that's what I'm working 
> on right now).  I realize that rigid registration should be performed 
> first, but I just wanted to see a  noticeable deformation in the images 
> before I started to pursue the FEMRegistration method any further (just 
> to be sure I could get it working).
> 
> 
> Anyways, here is the code that I was using.  All that has really changed 
> is that I am using 3D elements.  I left the original comments.
> 
> 
> Thank you.
> 
> Jayme
> 
> 
> 
> 
> On Mar 22, 2004, at 16:36, Luis Ibanez wrote:
> 
>>
>> Hi Jayme,
>>
>> At first sight this looks like you forgot to switch
>> some of the FEM components from 2D to 3D.
>>
>> Could you please post your modified version of the
>> DeformableRegistration1.cxx example.
>>
>> Once we debug it, we will actually like to add it
>> as an extra example in the same directory.
>>
>>
>>   Thanks
>>
>>
>>     Luis
>>
>>
>> --------------------------
>> Jayme Kosior wrote:
>>
>>> Hello.
>>> I can successfully run DeformableRegistration1 to register 2D images. 
>>>  I have modified DeformableRegistration1 and the parameter file 
>>> accordingly to perform 3D deformable registration.  After performing 
>>> the registration, only the first image in the 3D dataset is deformed. 
>>>  The rest of the images are not modified.  The only change in the 
>>> rest of the registered data set is that it is now in the fixed image 
>>> coordinate space.
>>> I'm not sure if the registration is not warping the images properly, 
>>> or if maybe it is not writing them correctly.  Of course, maybe I'm 
>>> not doing something correctly. :)
>>> Here is the parameter file that I am using.
>>> Thank you in advance for your help.
>>> Jayme
>>> Setup Info: 700 Mhz Athlon, Red Hat Linux 9.0, ITK version 1.6 
>>> release, 2 8-bit 3D data sets in Analyze format at input.
>>> % Configuration file #1 for DeformableRegistration1.cxx
>>> %
>>> % This example demonstrates the setup of a basic registration
>>> % problem that does NOT use multi-resolution strategies.  As a
>>> % result, only one value for the parameters between
>>> % (# of pixels per element) and (maximum iterations) is necessary.
>>> % If you were using multi-resolution, you would have to specify
>>> % values for those parameters at each level of the pyramid.
>>> %
>>> % Note: the paths in the parameters assume you have the traditional
>>> % ITK file hierarchy as shown below:
>>> %
>>> % ITK/Insight/Examples/Registration/DeformableRegistration1.cxx
>>> % ITK/Insight/Examples/Data/RatLungSlice*
>>> % ITK/Insight-Bin/bin/DeformableRegistration1
>>> %
>>> % ---------------------------------------------------------
>>> % Parameters for the single- or multi-resolution techniques
>>> % ---------------------------------------------------------
>>> 1    % Number of levels in the multi-res pyramid (1 = single-res)
>>> 1    % Highest level to use in the pyramid
>>>  1 1 1       % Scaling at lowest level of pyramid
>>>  8        % Number of pixels per element
>>>  1.e4             % Elasticity (E)
>>>  1.e3             % Density x capacity (RhoC)
>>>  1        % Image energy scaling (gamma) - sets gradient step size
>>>  6        % NumberOfIntegrationPoints
>>>  4          % WidthOfMetricRegion
>>>  50        % MaximumIterations
>>> % -------------------------------
>>> % Parameters for the registration
>>> % -------------------------------
>>> 4 1.0  % Similarity metric (0=mean sq, 1 = ncc, 2=pattern int, 3=MI, 
>>> 5=demons) 2nd num changes NormalizeGradient
>>> 0.5    % Alpha
>>> 0    % DescentDirection (1 = max, 0 = min)
>>> 2    % DoLineSearch (0=never, 1=always, 2=if needed)
>>> 1.e1    % TimeStep
>>> 0.5     % Landmark variance
>>> 0       % Employ regridding / enforce diffeomorphism ( >= 1 -> true)
>>> % ----------------------------------
>>> % Information about the image inputs
>>> % ----------------------------------
>>> 256    % Nx (image x dimension)
>>> 256    % Ny (image y dimension)
>>> 12      % Nz (image z dimension - not used if 2D)
>>> ./images-8bit/CFLAIR30m.hdr        % moving image
>>> ./images-8bit/CPWI0d_brain3.hdr    % fixed image
>>> % -------------------------------------------------------------------
>>> % The actions below depend on the values of the flags preceding them.
>>> % For example, to write out the displacement fields, you have to set
>>> % the value of WriteDisplacementField to 1.
>>> % -------------------------------------------------------------------
>>> 0    % UseLandmarks? - read the file name below if this is true
>>> -    % LandmarkFileName
>>> ./results/PatientC-FtoP-8bit                       % ResultsFileName 
>>> (prefix only)
>>> 1       % WriteDisplacementField?
>>> ./results/OtherPatientC-FtoP_disp                         % 
>>> DisplacementsFileName (prefix only)
>>> 0       % ReadMeshFile?
>>> -                                      % MeshFileName
>>> END
>>>                _______________________________________________
>>> 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
>>