[Insight-users] DeformableRegistration6 error

Luis Ibanez luis.ibanez at kitware.com
Tue Nov 2 13:35:10 EST 2004


Hi Kingaza,

Please post to the list the error message that you
get from the Exception.



Did you follow the guidelines of the example

     DeformableRegistration7.cxx    ??


Please let us know,


   Thanks


    Luis



------------------------
kingaza at gmail.com wrote:

> thx for your help
> and now I try to use LBGSBOptimizer  inplace of LBGSOptimizer 
> but it seems that the two optimizers are different in use
> for examle,
> LBGSBOptimzer does not hava the member function :SetDefaultStepLength()
> 
> and it seems some problems if I do in this way:
> 
> //for transformLow
> /*  //for LBFGSOptimizer
> 	optimizer->SetGradientConvergenceTolerance( 0.05 );
> 	optimizer->SetLineSearchAccuracy( 0.9 );
> 	optimizer->SetDefaultStepLength( 1.5 );
> 	optimizer->TraceOn();
> 	optimizer->SetMaximumNumberOfFunctionEvaluations( 1000 );
> */
> 	//for LBFGSOptimizer
> 	OptimizerType::BoundSelectionType boundSelect(
> transformLow->GetNumberOfParameters() );
> 	OptimizerType::BoundValueType upperBound(
> transformLow->GetNumberOfParameters() );
> 	OptimizerType::BoundValueType lowerBound(
> transformLow->GetNumberOfParameters() );
> 
> 	boundSelect.Fill( 0 );
> 	upperBound.Fill( 0.0 );
> 	lowerBound.Fill( 0.0 );
> 
> 	optimizer->SetBoundSelection( boundSelect );
> 	optimizer->SetUpperBound( upperBound );
> 	optimizer->SetLowerBound( lowerBound );
> 
> 	optimizer->SetCostFunctionConvergenceFactor( 1e+12 );
> 	optimizer->SetProjectedGradientTolerance( 1.0 );
> 	optimizer->SetMaximumNumberOfIterations( 500 );
> 	optimizer->SetMaximumNumberOfEvaluations( 500 );
> 	optimizer->SetMaximumNumberOfCorrections( 5 );
> 
> //for transformHigh
> /*  //for LBFGSOptimizer
> 	optimizer->SetGradientConvergenceTolerance( 0.01 );
> 	optimizer->SetDefaultStepLength( 0.25 );
> */
>     //for LBFGSOptimizer
> 	optimizer->SetProjectedGradientTolerance( 0.01 );
> 
> but it can work only in the first registraion, and throw a exception
> in the second registration.
> 
> could you tell me how to use LBGSBOptimizer  in a multi-resolution registration?
> 
> On Sat, 30 Oct 2004 11:52:43 -0400, Luis Ibanez <luis.ibanez at kitware.com> wrote:
> 
>>Hi Kingaza,
>>
>>This is a known problem of the LBGSOptimizer that tends to happen
>>when  at the first iteration the optimizer doesn't find a better point
>>to move in the parametric space.
>>
>>It is unrelated to the fact that you are reading DICOM files and it is
>>unrelated to the image size.  The real cause is that you are inadvertedly
>>starting the optimizer in a local optimium.
>>
>>Please try the new example
>>
>>                   DeformableRegistration7.cxx
>>
>>That uses the modified optimizer
>>
>>                           LBFGSBOptimizer
>>
>>This example was committed recently in CVS, so you will
>>have to update your CVS checkout in order to get the file.
>>
>>http://www.itk.org/cgi-bin/viewcvs.cgi/Examples/Registration/DeformableRegistration7.cxx?rev=1.1&root=Insight&sortby=date&view=log
>>
>>  Regards,
>>
>>       Luis
>>
>>------------------------------------
>>
>>
>>kingaza at gmail.com wrote:
>>
>>
>>>hi all,
>>>
>>>I try DeformableRegistration6 using images which size is 256*256, but
>>>an exception occures:
>>>
>>>itk::ExceptionObject (0108F840)
>>>Location: "Unknown"
>>>File: .\itkLBFGSOptimizer.cxx
>>>LIne: 252
>>>Description: itk::ERROR: LBFGSOpimeizer(00376680): Error occured in optimization
>>>
>>>and then i debug deeply, and find in itkLBFGSOptimizer.cxx
>>>parameters.size = 0 while initialPosition.size() =128
>>>this is where the exception is caught.
>>>I had thought it is because of the dicom file format , so I try it
>>>again using png file, and the same appears.
>>>But if I use images which size is 64*64, anything is OK, and the
>>>output is perfect.
>>>please help me!
>>>
>>>
>>>
>>>itkLBFGSOptimizer.cxx
>>>/////////////////////////////////////////////////////////////////////////////////////////////
>>>......
>>> m_VnlOptimizer->minimize( parameters );
>>>
>>>if ( parameters.size() != initialPosition.size() )
>>>   {
>>>   // set current position to initial position and throw an exception
>>>   this->SetCurrentPosition( initialPosition );
>>>   itkExceptionMacro( << "Error occured in optimization" );
>>>   }
>>>......
>>>/////////////////////////////////////////////////////////////////////////////////////////////
>>>_______________________________________________
>>>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