[Insight-users] MultiResMIRegistration control

Karthik Krishnan Karthik.Krishnan at kitware.com
Thu Apr 14 12:12:59 EDT 2005


Laurent,

the error "All the sampled point mapped to outside of the moving image." 
usually means that the transform mapped your image so far away that 
there is very little overlap between the moving and the fixed image.

The Quaternion transform has two sets of parameters with varying degrees 
of influence (translation and rotation).

1. Provide a reasonable initial transform with at least the translation 
params of the quaternion transform
2. Look at the transform paramters that you are printing out. And see 
which of the paramters are diverging.

To account for the varying degrees of influence, you will need to set 
the translation scale to a lot less than the rotation scale

  const unsigned int numberOfParameters = 
m_Transform->GetNumberOfParameters();
  OptimizerScalesType optimizerScales( numberOfParameters );
  optimizerScales[0] = 100.0; // scale for rotation
  optimizerScales[1] = 100.0; // scale for rotation
  optimizerScales[2] = 100.0; // scale for rotation
  optimizerScales[3] = 1.0 / ( 10 * fixedImageSize[0] * 
fixedImageSpacing[0] ); // for translations
  optimizerScales[4] = 1.0 / ( 10 * fixedImageSize[1] * 
fixedImageSpacing[1] );
  optimizerScales[5] = 1.0 / ( 10 * fixedImageSize[2] * 
fixedImageSpacing[2] );

Please see IMageRegistration8.cxx

Thanks
Regards
Karthik

laurent.paul at club-internet.fr wrote:

>
>
> Hi Karthik,
>
> Thanks for your answer, that's exactly what I was looking for.
> I redirected the standard flow to a text file, so I can now look for 
> the parameter's evolution and know when algorithm reaches stable level.
> That's great!
>
> Just a last question:
> In another project, I test the MultiResImageRegistration1.cxx
> I modified it:
> -To register 3D volumes (I just change the /dimension/ variable to 3)
> -MutualInformationImageToImageMetric instead of MattesMutual...
> -QuaternionRigidTransform instead of TranslationTransform
> -QuaternionRigidTransformGradientDescentOptimizer instead of 
> RegularStepGradientDescentOptimizer
> -Add observer to control the evolution
> I wonder if this example can work on volumes. After some iterations, I 
> got an itkexception.
>
> Description: itk::ERROR: 
> MutualInformationImageToImageMetric(012DAED8): All the
> sampled point mapped to outside of the moving image.
>
> Algorithme diverges!
> With some parameters, I manage to finish the registration but the 
> resulting volume is black (!?) and parameters don't evolveafter 3/4 
> iterations.
>
> If you see something wrong, tell me!
>
> Thanks.
>
> Laurent.
>
>
>
> ----Message d'origine----
> Date: Wed, 13 Apr 2005 15:51:56 -0400
> De: Karthik Krishnan
> A: laurent.paul at club-internet.fr
> Copie à: insight-users at itk.org
> Sujet: Re: [Insight-users] MultiResMIRegistration control
>
> Laurent,
>
> 1. you should
>     optimizer->AddObserver( itk::IterationEvent()
> rather than add it to the registration method,
>     m_Registration.
>
> The reason being that MultiResolutionRegistrationMethod invokes an 
> iteration event before each resolution level and what you want to do 
> is invoke an event at each iteration.
>
> 2. m_Optimizer->GetCurrentPosition() will give you the parameters at 
> the current position and this is what you want to print out.
>
> 3. The registration->GetTransform() is only a pointer. You should have had
> std::cout << registration->GetTransform()->GetParamters() << std::endl;
>
> Please take a look at Examples/Registration/MultiResImageRegistration1.cxx
>
> Thanks
> Regards
> Karthik
>
>
>
>
> laurent.paul at club-internet.fr wrote:
>
>>
>> Hi users,
>>
>> Few times ago, I tried to register two volumes coming from PET, CT 
>> scan and MRI.
>> Thanks to your helpful advices, I managed!.
>> I use the MultiResMIRegistration application from 
>> insightApplications. I'd like to modify this application to control 
>> the evolution of the algorithm. So I add an observer on 
>> IterationEvent. That works.
>> I'd want to display parameters at each iteration (or each 100 
>> iterations, that isn't the problem) but I don't manage to get the 
>> parameters.
>> At the end of the application, final parameters are displayed. So, I 
>> tried to "copy" and use that line:
>> /std::cout << "trans:" << registrator->GetTransformParameters() << 
>> std::endl;
>>
>> /At compilation time,/ /I got an error, the compiler doesn't know the 
>> GetTransformParameters Method. I tried with GetTransform but it 
>> displays "00000000"!
>>
>> Where can I get the parameters, from the optimizer or from the 
>> registrator?
>> Which method permits to do this?
>>
>> Thanks for your help.
>>
>> Laurent.
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
>>  
>>
>



More information about the Insight-users mailing list