[Insight-users] Exception in LandmarkInitializedMutualInformationRegistration application

George Iordanescu giordanescu at cmr.nunet.net
Fri, 16 Apr 2004 16:34:47 -0500


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
>