[Insight-users] Monomodality Registration with IsoC3D and CT Images

Luis Ibanez luis . ibanez at kitware . com
Fri, 29 Aug 2003 19:21:45 -0400


Hi Anonymous User,

We are very close to the release 1.4.
Many things have changes related to the
registration framework since ITK 1.2.

I'll strongly suggest you to try the
CVS version (which is almost identical
to what you will see in ITK 1.4).


Please let us know if you still find
difficutlties when using the CVS version.


Thanks


    Luis


-----------------------------
Anonymous User wrote:
> Hello,
> 
> Last week, I had problems with a registration application I was trying to
> create based on the help of the ITK Software Guide, the registration
> examples as well as the online doc.
> 
> I am trying to create a registration app using a Euler3DTransform with a
> Regular Step Gradient Optimizer and Mutual Information Metric.  I have
> since simplified my program as not to use the Multi Resolution
> Registration process.
> 
> The images I use are IsoC3D Images or CT Images of 156x156x156 pixels with
> a pixel spacing of 0.474mm.  Three basic test cases are
> done: a registration of the base image to itself, a registration of the based
> image to a modified self ( -3mm in x, 3 degrees in z) as
> well as registration of the based image to a modified self ( -5 mm in
> x, 2 mm in y, -11 degrees in x, -11 degrees in z ).  For each of these
> test cases, the optimizer scales have been modified in order to find an
> optimal solution which is yet to be found.
> 
> Some people have suggested to use the latest CVS check out, which I will
> do as soon as next week.  I have also tried a variety of combinations of
> other transforms (Affine), optmizers (One Plus One) and metric (Mattes
> Mutual Information) to evaluate what component might be deficient.
> 
> I have attached a file containing my test results.
> 
> Here are some code snippets in order to better understand my problem:
> 
> /*--------------------------------------------------------------------*/
> 
>   //Mutual Information Type
>   MetricType::Pointer         metric        = MetricType::New();
>   //Euler 3D Transform Type
>   TransformType::Pointer      transform     = TransformType::New();
>   //Regular Step Gradient Descent
>   OptimizerType::Pointer      optimizer     = OptimizerType::New();
>   InterpolatorType::Pointer   interpolator  = InterpolatorType::New();
>   //Image Registration Method
>   RegistrationType::Pointer   registration  = RegistrationType::New();
> 
>   (...)
> 
>   optimizer->SetScales(optimizerScales);
>   metric->SetNumberOfSpatialSamples(atol(TestParameters[8]);
> 
>   //MutualInformation needs to be maximised
>   optimizer->MaximizeOn();
> 
>   registration->SetMetric( metric );
>   registration->SetOptimizer( optimizer );
>   registration->SetTransform( transform );
>   registration->SetInterpolator( interpolator );
> 
>   //I set the Nb of Iteration, the Max nb of Step and Min nb of Steps
>   //in the Registration Interface as done in the ITK Software Guide p. 260
> 
>   (...)
> 
>   //Image File Reader
>   fixedImageReader->SetFileName(  TestParameters[0] );
>   movingImageReader->SetFileName( TestParameters[1] );
> 
>   fixedImageReader->Update();
>   movingImageReader->Update();
> 
>   (...)
> 
>   //Cast Image Filter
>   fixedCaster->SetInput(fixedImageReader->GetOutput());
>   movingCaster->SetInput(movingImageReader->GetOutput());
> 
>   fixedCaster->Update();
>   movingCaster->Update();
> 
>   (...)
> 
>   //Change Information Image Filter
>   fixedcenterer->SetInput(fixedCaster->GetOutput());
>   movingcenterer->SetInput(movingCaster->GetOutput());
> 
>   fixedcenterer->CenterImageOn();
>   movingcenterer->CenterImageOn();
> 
>   fixedcenterer->Update();
>   movingcenterer->Update();
> 
>   (...)
> 
>   //Calculated with a MinMaxImageCalculator as fixedSd=0.4*(max-min)+min
>   metric->SetFixedImageStandardDeviation(fixedSd);
>   metric->SetMovingImageStandardDeviation(fixedMd);
> 
>   (...)
> 
>   registration->SetFixedImage( fixedcenterer->GetOutput() );
>   registration->SetMovingImage( movingcenterer->GetOutput() );
>   registration->SetFixedImageRegion(
>   fixedcenterer->GetOutput()->GetBufferedRegion() );
> 
>   (...)
> 
>   //No Initial Rotation or Translation
>   registration->SetInitialTransformParameters( initialParameters );
> 
>   (...)
> 
>   //Set a Command Iteration Update as well as a Registration Interface
> 
>   try
>     {
>       registration->StartRegistration();
>     }
>   catch( itk::ExceptionObject & err )
>     {
>     //Error handling
>     (...)
>     }
> 
>   //Print Final Parameters
>   (...)
> 
>   //Resample
>   resample->SetTransform( finalTransform );
>   resample->SetInput( movingImage );
>   resample->SetSize( fixedImage->GetLargestPossibleRegion().GetSize() );
>   resample->SetOutputOrigin(  fixedImage->GetOrigin() );
>   resample->SetOutputSpacing( fixedImage->GetSpacing() );
>   resample->SetDefaultPixelValue( 0 );
>   resample->Update();
> 
>   //Write Output
>   (...)
> 
> /*--------------------------------------------------------------*/
> 
> Thanks in advance for your help,
> 
> Anonymous User
> 
> 
> ------------------------------------------------------------------------
> 
> Test Summary for ITK 1.2 implementations Registration with
> 
> 1) Multi Resolution Euler3D Transform, Regular Step Gradient Optimizer, Mutual Information
> 2) Multi Resolution Euler3D Transform, Regular Step Gradient Optimizer, Mattes Mutual Information
> 3) Multi Resolution Euler3D Transform, One Plus One Optimizer, Mutual Information
> 4) Multi Resolution Euler3D Transform, One Plus One Optimizer, Mattes Mutual Information
> 
> Test Summary for ITK implementations of Registration with
> 
> 5) Non Multi Resolution Euler3D Transform, One Plus One Optimizer, Mattes Mutual Information
> 6) Non Multi Resolution Euler3D Transform, One Plus One Optimizer, Mutual Information
> 
> NOTE: the name of the first file is the base image, the name of the second is constructed
> as to tell what the final result should be Ex: tx=-3 ty=0 tz=0 rx=0 ry=+3 rz=+11 -> Iso_m3p0p0p0p3p11.img
> 
> The images that were used are ISOC3D Images of the vertebra.
> 
> ***** 1) Multi Res Euler3D Transform, Regular Step Gradient Optimizer, Mutual Information *****
> 
>  -- TEST #1 --
> Image 1: Iso.img
> Image 2: Iso.img
> Image Standard Deviation: 0.4
> Step Lenght: 4
> Nb of Steps: 5
> Number of Iterations: 100
> Spatial Samples Number: 100
> Resolution Levels: 3
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 1000
> Optimizer Translation Scale: 0.05
> 
> Results =
>   tx = -0.92721
>   ty = 0.764176
>   tz = -0.0205616
>   rx = 0.140252
>   ry = 0.291177
>   rz = -0.130069
> 
>   Metric value  = 4.93305e-05
> 
>  -- TEST #2 --
> Image 1: Iso.img
> Image 2: Iso_m3p0p0p0p0m3.img
> Image Standard Deviation: 0.4
> Step Lenght: 4
> Nb of Steps: 5
> Number of Iterations: 100
> Spatial Samples Number: 100
> Resolution Levels: 3
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 1000
> Optimizer Translation Scale: 0.05
> 
> Results =
>   tx = -2.66499
>   ty = -1.50444
>   tz = 0.743862
>   rx = -0.069884
>   ry = -0.642622
>   rz = 0.154815
> 
>   Metric value  = 0.00127827
> 
>  -- TEST #3 --
> Image 1: Iso.img
> Image 2: Iso_m5p2p0p11p0m11.img
> Image Standard Deviation: 0.4
> Step Lenght: 4
> Nb of Steps: 5
> Number of Iterations: 100
> Spatial Samples Number: 100
> Resolution Levels: 3
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 1000
> Optimizer Translation Scale: 0.05
> 
> Results =
>   tx = 0.954514
>   ty = 0.575046
>   tz = -0.372257
>   rx = -0.00259566
>   ry = 0.0505662
>   rz = 0.0683114
> 
>   Metric value  = -6.41162e-05
> 
> Conclusion: Images did not seem to registrer.  Did also others tests by varying
> the optimization scales which did not generate better results and had to be adapted
> diffrently for each image in order to get somewhat of a better result.
> 
> ***** 2) Multi Res Euler3D Transform, Regular Step Gradient Optimizer, Mattes Mutual Information *****
> 
>  -- TEST #1 --
> Image 1: Iso.img
> Image 2: Iso.img
> Number of Histogram bins: 50
> Step Lenght: 4
> Nb of Steps: 5
> Number of Iterations: 35
> Spatial Samples Number: 36000
> Resolution Levels: 3
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 1000
> Optimizer Translation Scale: 0.05
> 
> Results =
>   tx = 0.0738725
>   ty = -0.0667766
>   tz = -0.200895
>   rx = -1.02795
>   ry = -2.56003
>   rz = 0.98061
> 
>   Metric value  = -0.515803
> 
>  -- TEST #2 --
> Image 1: Iso.img
> Image 2: Iso_m3p0p0p0p0m3.img
> Number of Histogram bins: 50
> Step Lenght: 4
> Nb of Steps: 5
> Number of Iterations: 35
> Spatial Samples Number: 36000
> Resolution Levels: 3
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 1000
> Optimizer Translation Scale: 0.05
> 
> Results =
>   tx = -3.2133
>   ty = -0.919964
>   tz = 0.0295872
>   rx = 0.336638
>   ry = -0.550383
>   rz = 3.89219
> 
>   Metric value  = -0.35339
> 
>  -- TEST #3 --
> Image 1: Iso.img
> Image 2: Iso_m5p2p0p11p0m11.img
> Number of Histogram bins: 50
> Step Lenght: 4
> Nb of Steps: 5
> Number of Iterations: 35
> Spatial Samples Number: 36000
> Resolution Levels: 3
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 1000
> Optimizer Translation Scale: 0.05
> 
> Results =
>   tx = -5.75859
>   ty = -1.91325
>   tz = -0.916092
>   rx = -3.2962
>   ry = -0.661841
>   rz = 1.53511
> 
>   Metric value  = -0.116939
> 
> Conclusions: same as above
> 
> ***** 3) Multi Res Euler3D Transform, One Plus One Optimizer, Mutual Information *****
> 
>  -- TEST #1 --
> Image 1: Iso.img
> Image 2: Iso.img
> Image Standard Deviation: 0.4
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 100
> Spatial Samples Number: 100
> Resolution Levels: 3
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 1
> Optimizer Translation Scale: 1
> 
> Results = GOOD RESULTS!!
>   rx = 0
>   ry = 0
>   rz = 0
>   tx = 0
>   ty = 0
>   tz = 0
> 
>   Metric value  = 0.00230699
> 
>  -- TEST #2 --
> Image 1: Iso.img
> Image 2: Iso_m3p0p0p0p0m3.img
> Image Standard Deviation: 0.4
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 100
> Spatial Samples Number: 100
> Resolution Levels: 3
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 750
> Optimizer Translation Scale: 0.6
> 
> Results =
>   tx = 5.02889
>   ty = -5.80844
>   tz = -34.3068
>   rx = 0.573604
>   ry = 0.699505
>   rz = -0.823505
> 
>   Metric value  = 0.00278987
> 
> Number of Iterations: 1000
> Results =
>   tx = -10.431
>   ty = 3.49903
>   tz = 29.3691
>   rx = 1.06653
>   ry = -1.41819
>   rz = 0.819767
> 
>   Metric value  = 0.00270463
> 
>  -- TEST #3 --
> Image 1: Iso.img
> Image 2: Iso_m3p0p0p0p0m3.img
> Image Standard Deviation: 0.4
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 500
> Spatial Samples Number: 100
> Resolution Levels: 3
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 600
> Optimizer Translation Scale: 0.6
> 
> Results =
>   tx = -4.59873
>   ty = -11.2617
>   tz = 8.72564
>   rx = 3.72497
>   ry = 0.465692
>   rz = -2.36583
> 
>   Metric value  = 0.00217766
> 
>  -- TEST #4 --
> Image 1: Iso.img
> Image 2: Iso_m3p0p0p0p0m3.img
> Image Standard Deviation: 0.4
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 100
> Spatial Samples Number: 100
> Resolution Levels: 3
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 500
> Optimizer Translation Scale: 0.6
> 
> Results =
>   tx = -1.08694
>   ty = 0.580683
>   tz = -13.9181
>   rx = -3.59456
>   ry = -1.91152
>   rz = 1.96193
> 
>   Metric value  = 0.00382793
> 
>  -- TEST #5 --
> Image 1: Iso.img
> Image 2: Iso_m5p2p0p11p0m11.img
> Image Standard Deviation: 0.4
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 100
> Spatial Samples Number: 100
> Resolution Levels: 3
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 450
> Optimizer Translation Scale: 0.55
> 
> Results =
>   tx = 2.78524
>   ty = 1.65746
>   tz = -11.7182
>   rx = -0.695561
>   ry = 0.0109081
>   rz = -2.71159
> 
>   Metric value  = 0.000719646
> 
> Conclusions: same as above
> 
> ***** 4) Multi Res Euler3D Transform, One Plus One Optimizer, Mattes Mutual Information *****
> 
>  -- TEST #1 --
> Image 1: Iso.img
> Image 2: Iso.img
> Number of Histogram Bins: 50
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 35
> Spatial Samples Number: 36000
> Resolution Levels: 3
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 1
> Optimizer Translation Scale: 1
> 
> Results =
>   tx = 0
>   ty = 0
>   tz = 0
>   rx = 0
>   ry = 0
>   rz = 0
> 
>   Metric value  = -0.952767
> 
>  -- TEST #2 --
> Image 1: Iso.img
> Image 2: Iso_m3p0p0p0p0m3.img
> Number of Histogram Bins: 50
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 35
> Spatial Samples Number: 36000
> Resolution Levels: 3
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 500
> Optimizer Translation Scale: 0.6
> 
> Results =
>   tx = -3.19864
>   ty = 2.1028
>   tz = 1.08752
>   rx = 0.390562
>   ry = 0.0126369
>   rz = -0.943651
> 
>   Metric value  = -0.309585
> 
> Results =
>   tx = -2.86628
>   ty = -1.19766
>   tz = 0.198151
>   rx = -0.115274
>   ry = -0.971074
>   rz = 0.202631
> 
>   Metric value  = -0.45431
> 
>  -- TEST #3 --
> Image 1: Iso.img
> Image 2: Iso_m3p0p0p0p0m3.img
> Number of Histogram Bins: 50
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 35
> Spatial Samples Number: 36000
> Resolution Levels: 3
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 600
> Optimizer Translation Scale: 0.6
> 
> Results =
>   tx = -2.69419
>   ty = 0.558417
>   tz = -4.53924
>   rx = -0.0504976
>   ry = 0.501516
>   rz = 0.0737474
> 
>   Metric value  = -0.254434
> 
>  -- TEST #4 --
> Image 1: Iso.img
> Image 2: Iso_m5p2p0p11p0m11.img
> Number of Histogram Bins: 50
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 35
> Spatial Samples Number: 36000
> Resolution Levels: 3
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 465
> Optimizer Translation Scale: 0.63
> 
> Results =
>   rx = 0.192747
>   ry = 0.811098
>   rz = -2.60301
>   tx = -4.62819
>   ty = -3.98937
>   tz = -4.89128
>   Metric value  = -0.135144
> 
> Conclusions: same as above
> 
> ***** 5) Non Multi Res Euler3D Transform, One Plus One Optimizer, Mutual Information *****
> 
>  -- TEST #1 --
> Image 1: Iso.img
> Image 2: Iso.img
> Image Standard Deviation: 0.4
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 100
> Spatial Samples Number: 100
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 1
> Optimizer Translation Scale: 1
> 
> Results =
>   tx = 0
>   ty = 0
>   tz = 0
>   rx = 0
>   ry = 0
>   rz = 0
> 
>   Metric value  = 0.00217487
> 
>  -- TEST #2 --
> Image 1: Iso.img
> Image 2: Iso_m3p0p0p0p0m3.img
> Image Standard Deviation: 0.4
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 100
> Spatial Samples Number: 100
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 500
> Optimizer Translation Scale: 0.6
> 
> Results =
>   tx = -0.215202
>   ty = 2.74183
>   tz = 21.8943
>   rx = 0.627152
>   ry = -0.756522
>   rz = -1.92467
> 
>   Metric value  = 0.00141822
> 
>  -- TEST #3 --
> Image 1: Iso.img
> Image 2: Iso_m3p0p0p0p0m3.img
> Image Standard Deviation: 0.4
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 100
> Spatial Samples Number: 100
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 600
> Optimizer Translation Scale: 0.6
> 
> Results =
>   tx = 6.53754
>   ty = -43.7381
>   tz = -32.9487
>   rx = -1.4375
>   ry = 1.83113
>   rz = 0.596882
> 
>   Metric value  = 0.000340883
> 
>  -- TEST #4 --
> Image 1: Iso.img
> Image 2: Iso_m5p2p0p11p0m11.img
> Image Standard Deviation: 0.4
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 100
> Spatial Samples Number: 100
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 465
> Optimizer Translation Scale: 0.63
> 
> Results =
>   tx = 7.08646
>   ty = -5.34661
>   tz = 4.644
>   rx = 0.246308
>   ry = 0.699108
>   rz = -2.94823
> 
>   Metric value  = 0.00143262
> 
>  Conclusions: same as above
> 
> ***** 6) Non Multi Res Euler3D Transform, One Plus One Optimizer, Mattes Mutual Information *****
> 
>  -- TEST #1 --
> Image 1: Iso.img
> Image 2: Iso.img
> Number of Histogram Bins: 50
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 100
> Spatial Samples Number: 100
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 1
> Optimizer Translation Scale: 1
> 
> Results = GOOD RESULTS!!
>   tx = 0
>   ty = 0
>   tz = 0
>   rx = 0
>   ry = 0
>   rz = 0
> 
>   Metric value  = -0.919918
> 
>  -- TEST #2 --
> Image 1: Iso.img
> Image 2: Iso_m3p0p0p0p0m3.img
> Number of Histogram Bins: 50
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 35
> Spatial Samples Number: 36000
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 500
> Optimizer Translation Scale: 0.6
> 
> Results =
>   tx = -1.31566
>   ty = 0.822948
>   tz = -1.06168
>   rx = 0.188891
>   ry = -0.0216432
>   rz = -0.0238193
> 
>   Metric value  = -0.185033
> 
>  -- TEST# 3 --
> Image 1: Iso.img
> Image 2: Iso_m3p0p0p0p0m3.img
> Number of Histogram Bins: 50
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 500
> Spatial Samples Number: 36000
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 75
> Optimizer Translation Scale: 0.5
> 
> Results =
>   rx = -2.30585
>   ry = -2.00108
>   rz = -4.79591
>   tx = -4.15627
>   ty = -1.13632
>   tz = -2.09898
>   Metric value  = -0.176136
> 
>    -- TEST# 4 --
> Image 1: Iso.img
> Image 2: Iso_m3p0p0p0p0m3.img
> Number of Histogram Bins: 50
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 500
> Spatial Samples Number: 36000
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 100
> Optimizer Translation Scale: 0.55
> 
> Results =
>   tx = -4.07701
>   ty = -1.04191
>   tz = 1.33124
>   rx = 1.72982
>   ry = 1.34101
>   rz = -0.00479485
> 
>   Metric value  = -0.255697
> 
>  -- TEST #5 --
> Image 1: Iso.img
> Image 2: Iso_m5p2p0p11p0m11.img
> Number of Histogram Bins: 50
> Growth Factor: 1.01
> Initial Radius: 5
> Number of Iterations: 35
> Spatial Samples Number: 36000
> Initial Rotation: 0,0,0
> Initial Translation: 0,0,0
> Optimizer Rotation Scale: 450
> Optimizer Translation Scale: 0.55
> 
> Results =
>   tx = -6.97405
>   ty = -1.1299
>   tz = 8.14866
>   rx = 1.51754
>   ry = -2.10816
>   rz = 0.636971
> 
>   Metric value  = -0.0717165
> 
> Conclusions: same as above