[Insight-users] Problem with MultiResImageRegistration2.cxx: Doesn't work with rotation : Surrogate 3D images are too flat

Luis Ibanez luis.ibanez at kitware.com
Mon Mar 23 08:47:27 EDT 2009


Hi Albert,

Yes, the problem is that your (surrogate) 3D images are not big enough
to guarantee an overlap, once the transform start moving the images
around.

If you want to test the system in 3D, you should feed it with 3D images
that have sufficient coverage in space to have a common overlap that
captures enough points.

Also, your subsampling schedule, is very unrealistic on Z:

You are feeding an image of 4 slices in Z, and then requesting to
subsample it by a factor of 2X in the second level, and 4X in the
third level.

A more realistic schedule could be:


     [4, 4, 1]
     [2, 2, 1]
     [2, 2, 1]


That is:  Do not subsample along Z.

If you have just 4 slices, there is no reason for subsampling
further.

Note that, even if you stop subsampling in Z, what you are attempting
in 3D is still a very unstable operation. The overlap between these
two slabs can easily become very small as soon as a Z translation is
applied, or as soon as a rotation around X or Y is applied.

Here is a good exercise for you to visualize what is going on:

Download ParaView (www.paraview.org) and load in ParaView your
two 3D surrogate images.

Paraview will show you the geometrical outline of this images.
Then go to the "Display" tab on the bottom part of the left
panel, go to the bottom of that tab and look for the "Transformation"
frame.  Then change the values in the "Orientation" fields.

For example, set 10 degrees in the X rotation (the first field)
This will show you how small of an overlap you are having between
these two extremely-flat images.



    Regards,


        Luis



-------------------
Albert Gubern wrote:
> Hi Luis,
> 
> I was only trying to test the application. I already thought that it 
> wouldn't work, but I thought and I don't understand yet why if I create 
> my own 3d images the registration doesn't work with 4 levels of 
> multiresultion. Is the error "Joint PDF summed to zero" caused because 
> in the 4th level the registration doesn't have enough pixels?
> 
> My 3d images are composed by the slices used in 2D test copied 4 times. 
> In that way I have a 3d brain image in the center as a fixed (the same 
> slice repeated 4times), and all the slices of the moving are the same 
> brain with the same rotation and translation. So, each slice overlaps 
> each other in both volumes, and because of this I think it should work.
> 
> Is it only caused because the size of the images is not big enough to 
> work with 4 multiresolution levels or is another problem? 
> 
> My goal is the registration of two prostates MRI of differents patients 
> in order to build an atlas.
> 
> 
> Thanks!
> 
> Albert
> 
> 
> 2009/3/21 Luis Ibanez <luis.ibanez at kitware.com 
> <mailto:luis.ibanez at kitware.com>>
> 
> 
>     Hi Albert,
> 
> 
>     Nope,
> 
>     There is *no way* that a 3D Affine registration will
>     work correctly if you feed it with 2D images.
> 
>     I'm guessing that you are feeding 2D input images to
>     a 3D image reader, and therefore you end up with 3D
>     images that have a single slice.
> 
> 
>     They are therefore very thin in 3D space, and at the
>     first perturbation of the 3D terms (e.g a translation
>     in Z, or a rotation around X, or Y) then then overalp
>     of the images will be reduced to empty space of to
>     simply a line in 3D space.
> 
> 
>     You are trying to overlap two pieces of 2D paper in
>     a 3D space,... most of the time, they won't even
>     intersect at all.
> 
> 
>     So the big question is:
> 
> 
>        Why would you want to register
>        two 2D images in 3D space ??!!
> 
> 
>     Maybe you should give us more background on what your
>     real image processing application is intended to do...  :-)
> 
> 
> 
>        Thanks
> 
> 
>           Luis
> 
> 
> 
>     ---------------------
> 
>     Albert Gubern wrote:
> 
>         Hi again,
> 
>         Thanks Luis your answer, it is working correctly in 2D.
> 
>         Now I'm extending the code to 3D images. I modified the
>         Dimension to 3 and the optimizer scales (9 for rotation and 3
>         for translation).
> 
>         I test the code using the same images with the same command
>         arguments that you told me before and a new error appears before
>         doing the registration:
> 
>         ##############################
>         ####################
> 
>         FixedImage schedule: [4, 4, 4]
>         [2, 2, 2]
>         [1, 1, 1]
> 
>         MovingImage schedule: [4, 4, 4]
>         [2, 2, 2]
>         [1, 1, 1]
> 
>         -------------------------------------
>         MultiResolution Level : 0
> 
>         ExceptionObject caught !
> 
>         itk::ExceptionObject (0100FDF4)
>         Location: "void __thiscall
>         itk::MattesMutualInformationImageToImageMetric<class
>         itk::Image<float,3>,class itk::Image<floa
>         t,3> >::GetValueAndDerivative(const class itk::Array<double>
>         &,double &,class itk::Array<double> &) const"
>         File:
>         c:\bert\itk_vtk\src\itk\insighttoolkit-3.12.0\code\algorithms\itkMattesMutualInformationImageToImageMetric.txx
>         Line: 1138
>         Description: itk::ERROR:
>         MattesMutualInformationImageToImageMetric(014A27B8): Joint PDF
>         summed to zero
> 
>         #######################################
> 
>         I thought that the error is produced because I'm working with 2d
>         images, but the registration works if the number of levels of
>         the multiresolution registration is 1. Can the 3d registration
>         work with 2d images? I know that with Mean Squares metric it
>         isn't possible but this problem shouldn't appear with Mattes
>         Mutual information metric because it works with histograms...
> 
>         However, I test it with 3d images (the same 2d images of the
>         brain repeated 4 times) and the error appear when the number of
>         levels are 4 (works correctly with 1,2 and 3 levels). Also I've
>         worked with different percentage of samples (from 20% to 100%)
>         and number of bins (32 and 128) and the error continues appearing.
> 
>         I read in
>         http://www.itk.org/pipermail/insight-users/2009-February/028917.html
>         that it could be caused by something missed, but I think I do
>         all the necessary changes to do the 3D registration.
> 
>         What could the mistake be? Working with 2d images? Something missed?
> 
>         Thanks in advance,
> 
>         Albert
> 
>         PD: I can't attach the code without exceeding the size limit.
> 
> 
> 
> 
> 
> -- 
> Albert


More information about the Insight-users mailing list