[Insight-users] Exception in LandmarkInitializedMutualInformationRegistration application

Luis Ibanez luis.ibanez at kitware.com
Mon, 19 Apr 2004 11:19:08 -0400


Hi George,

The version of this application in CVS is working fine both for
Rigid and Affine Transforms.

You are probably mixing versions of InsightApplications and
Insight.  The LandmarkInitializedMutualInformationRegistration
application uses the ScaleSkewVersor3DTransform. This transform
derives from the itkVersorRigid3DTransform.

At some point the VersorRigid3D transform was including the center
of rotation coordinates as part of its list of parameters. The
center was then removed from the list of parameters making the
parameter array to pass from 9 to only 6 elements.
http://www.itk.org/cgi-bin/cvsweb.cgi/Insight/Code/Common/itkVersorRigid3DTransform.h?cvsroot=Insight

On February 3rd, the LandmarkInitializedMutualInformationRegistration
was updated accordingly:
http://www.itk.org/cgi-bin/cvsweb.cgi/InsightApplications/LandmarkInitializedMutualInformationRegistration/AffineRegistrator.txx.diff?r1=1.6&r2=1.7&cvsroot=Insight

I wondering if you are mixing ITK 1.6 with a posterior version
of InsightApplications,... or if this is actually a bug on 1.6.

Either way... the solution at this point seems to be for you
to update both Insight and InsightApplications to the CVS
version.


   Please let us know if you have any further questions,


     Thanks


       Luis



--------------------------
George Iordanescu wrote:

> Hi Luis,
> 
> I am reposting this message since I still have problems running the
> LandmarkInitializedMutualInformationRegistration application. The rigid
> registration works ok, but when running the affine I get the following
> exception:
> 
> 
>>>>>>>>>>>>>>>>>>>>Begin program output<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> 
> 
> Dbg: 1998 = -0.388172 : [-0.0579949, -0.0183968, -0.0486348, -5.43014,
> -6.08203, 7.15309]
> Dbg: 1999 = -0.388172 : [-0.0579949, -0.0183968, -0.0486348, -5.43014,
> -6.08203, 7.15309]
> Dbg: 2000 = -0.388172 : [-0.0579949, -0.0183968, -0.0486348, -5.43014,
> -6.08203, 7.15309]
> Dbg: Rigid registration FINAL centered versor transform:
> [-0.0579949, -0.0183968, -0.0486348, -5.43014, -6.08203, 7.15309]
> 
> Dbg: Rigid registration FINAL affine transform:
> [0.994592, 0.0991078, -0.0310406, -0.0948402, 0.988543, 0.117427,
> 0.0423229, -0.113848, 0.992596, -8.21126, -3.50249, 9.49371]
> 
> Registering using the affine method...
> 
> Dbg: Affine registration INITIAL centered versor transform:
> [-0.0579949, -0.0183968, -0.0486348, -5.43014, -6.08203, 7.15309, 0, 0,
> 0, 1, 1, 1, 0, 0, 0, 0, 0, 0]
> 
> -------------------------------------------------
> Exception caught in AffineRegistrator:
> 
> itk::ExceptionObject (0x847b7d0)
> Location: "Unknown"
> File:
> /home/giordanescu/itk/InsightToolkit-1.6.0/Code/Numerics/itkOnePlusOneEvolutionaryOptimizer.cxx
> Line: 117
> Description: itk::ERROR: OnePlusOneEvolutionaryOptimizer(0x84a9878): The
> size of Scales is 15, but the NumberOfParameters for the CostFunction is
> 18.
> 
> 
> -------------------------------------------------
> Dbg: Affine registration FINAL centered affine transform:
> [-0.0579949, -0.0183968, -0.0486348, -5.43014, -6.08203, 7.15309, 0, 0,
> 0, 1, 1, 1, 0, 0, 0, 0, 0, 0]
> 
> Dbg: Affine registration FINAL affine transform:
> [0.994592, 0.0991078, -0.0310406, -0.0948402, 0.988543, 0.117427,
> 0.0423229, -0.113848, 0.992596, 0.795449, -1.42464, -0.409647]
> 
> 
>>>>>>>>>>>>>>>>>>>>End program output<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> 
> 
> I modified the ImageRegistrationApp.txx file, adding 3 new parameters:
> m_AffineScales[15] = 400;m_AffineScales[16] = 400;m_AffineScales[17] =
> 400;
> and now the program seems to work ok. I would like though to know if
> these are correct scales.
> 
> Thank you in advance.
> 
> George
> 
> 
> 
> On Fri, 2004-04-09 at 17:22, George Iordanescu wrote:
> 
>>Hi Luis,
>>
>>Thank you for your replies. I downloaded the latest ITK applications and
>>now the rigid registration seems to work OK. I still have an error when
>>using the affine method:
>>
>>Dbg: Affine registration INITIAL centered versor transform:
>>[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0]
>>
>>-------------------------------------------------
>>Exception caught in AffineRegistrator:
>>
>>itk::ExceptionObject (0x8532668)
>>Location: "Unknown"
>>File:
>>/home/giordanescu/itk/InsightToolkit-1.6.0/Code/Numerics/itkOnePlusOneEvolutionaryOptimizer.cxx
>>Line: 117
>>Description: itk::ERROR: OnePlusOneEvolutionaryOptimizer(0x852e820): The
>>size of Scales is 15, but the NumberOfParameters for the CostFunction is
>>18.
>>
>>
>>-------------------------------------------------
>>Dbg: Affine registration FINAL centered affine transform:
>>[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0]
>>
>>Dbg: Affine registration FINAL affine transform:
>>[1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0]
>>
>>
>>Also, I do not know if my results obtained with the rigid method are
>>correct:
>>
>>I am registering a set of 3D MR images to a 3D MR image. I am using a
>>modified version of the LandmarkInitializedMutualInformationRegistration
>>application (loading the whole dataset and then extracting only one 3D
>>image, without any Landmarks or ROIs) and so far I was able to generate
>>one set of 3D images, registered using the rigid method. But when
>>viewing the central slice of the registered 3D images, changing the time
>>coordinate, the image seems to "move" or "jump" from one time to another
>>even more than in the original set (the movement seems to be more than 2
>>pixels). Typical transformations obtained look like this:
>>Dbg: Rigid registration INITIAL centered versor transform:
>>[0, 0, 0, 0, 0, 0]
>>
>>Dbg: Rigid registration FINAL centered versor transform:
>>[-0.000750103, -0.0027196, 0.00567498, -0.0986529, -0.0771453, -0.1035
>>74]
>>
>>Dbg: Rigid registration FINAL affine transform:
>>[0.999921, -0.0113457, -0.00544761, 0.0113538, 0.999934, 0.00146931, 0
>>.00543058, -0.00153104, 0.999984, 0.25181, -0.368634, -0.19694]
>>
>>As you can see, the transformations are not very big which is OK since I
>>am trying to correct some weak motion artifacts. The registered images
>>seem though less aligned than the original. I was thinking of using a
>>more precise interpolator (BSpline) but it would not help for
>>displacements over one pixel. Any ideas why this is happening?
>>
>>Thank you.
>>
>>George
>>
>>
>>
>>On Tue, 2004-04-06 at 15:52, Luis Ibanez wrote:
>>
>>>Hi George,
>>>
>>>You seem to be using two incompatible
>>>versions of Insight and InsightApplications.
>>>
>>>The Centered Versor transform API changed
>>>recently in order to remove the center coordinates
>>>from the set of parameters passed to the optimizer.
>>>
>>>Please use Insight and InsightApplications from the
>>>same release or CVS updated the same day.
>>>
>>>
>>>   Regards,
>>>
>>>
>>>
>>>      Luis
>>>
>>>
>>>-------------------------
>>>George Iordanescu wrote:
>>>
>>>
>>>>Hello,
>>>>
>>>>I want to register two volumes (two 3D images) and I get the next
>>>>messages when running the
>>>>LandmarkInitializedMutualInformationRegistration application:
>>>>
>>>> >>>>>>>>>>>>>>>>>>>>>>>>AppMessages>>>>>>>>>>>>>>>>>>>>
>>>> Registration begins.
>>>> Registering using the rigid method...
>>>> DEBUG: rigid registration INITIAL centered versor transform:
>>>> [0, 0, 0, 24, 24, 14, 0, 0, 0]
>>>> ------------------------------------------------- 
>>>>
>>>> Exception caught in RigidRegistrator:
>>>>
>>>> itk::ExceptionObject (0x842e598)
>>>> Location: "Unknown"
>>>> File:
>>>>/home/giordanescu/itk/InsightToolkit-1.6.0/Code/Algorithms/itkImageRegistrationMethod.txx
>>>> Line: 142
>>>> Description: itk::ERROR: RigidRegistrator(0x84005b8): Size mismatch
>>>>between initial parameter and transform
>>>>
>>>>
>>>> -------------------------------------------------
>>>> DEBUG: Rigid registration FINAL centered versor transform:
>>>> [0, 0, 0, 0, 0, 0]
>>>> DEBUG: Rigid registration FINAL affine transform:
>>>> [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0]
>>>> <<<<<<<<<<<<<<<<<<<<<<<<<EndOfAppMessage<<<<<<<<<<<<<<<<<<<<<<<<
>>>>
>>>>The fixed image is 128*128*14, the moving image is 64*64*14. Apparently
>>>>the application tries to pass an array of 9 values as an initial
>>>>transformation, but the registrator wants only 6 (line 195 in
>>>>ImageRegistrationApp.txx):
>>>>    registrator->SetInitialTransformParameters ( params );
>>>>
>>>>
>>>>If I pass only the first 6 parameters, I get the next exception:
>>>>
>>>>
>>>> >>>>>>>>>>>>>>>>>>>>>>>>AppMessages>>>>>>>>>>>>>>>>>>>>
>>>> Registration begins.
>>>> Registering using the rigid method...
>>>> DEBUG: rigid registration INITIAL centered versor transform:
>>>> [0, 0, 0, 24, 24, 14]
>>>> -------------------------------------------------
>>>> Exception caught in RigidRegistrator:
>>>>
>>>> itk::ExceptionObject (0x8420908)
>>>> Location: "Unknown"
>>>> File:
>>>>/home/giordanescu/itk/InsightToolkit-1.6.0/Code/Algorithms/itkMattesMutualInformationImageToImageMetric.txx
>>>> Line: 546LandmarkInitializedMutualInformationRegistration
>>>> Description: itk::ERROR: 
>>>>MattesMutualInformationImageToImageMetric(0x8420320): Too many samples
>>>>map outside moving image buffer: 2529 / 20000
>>>>
>>>>
>>>>
>>>> -------------------------------------------------
>>>> DEBUG: Rigid registration FINAL centered versor transform:
>>>> [0, 0, 0, 24, 24, 14]
>>>> DEBUG: Rigid registration FINAL affine transform:
>>>> [1, 0, 0, 0, 1, 0, 0, 0, 1, 24, 24, 14]
>>>> <<<<<<<<<<<<<<<<<<<<<<<<<EndOfAppMessage<<<<<<<<<<<<
>>>>
>>>>Does anybody know how to fix this?
>>>>
>>>>Thank you,
>>>>
>>>>George
>>>>
>>>>_______________________________________________
>>>>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
>