<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hi all;
<br>
<br>I am using the functions SetMaximumError( ), SetMaximumKernelWidth( ),
and SetMaximumRMSError( ) of the itk::PDEDeformableRegistrationFilter
class to set the values for these three parameters to 0.1, 45, 0.001,
respectively.
<br>Using their respective Get* functions, I get the values I set earlier
returned.
<br>
<br>However when I run the registration algorithm I get the warning from the
itk::GaussianOperator class concerning the maximum kernel size. What I
don't understand is that the warning tells me the specified maximum
width is 32. Where did my value of 45 go? Also the source code of the
itk::GaussianOperator class tells me the default value for the
MaximumKernelWidth is 30.
<br>
<br>Where (in which class) is the value for the maximum kernel width set to
32? Because I think that's where I should set the value to its desired
value, as opposed to setting it in the PDEDeformableRegistrationFilter
(DemonsRegistrationFilter) class.
<br>
<br>My code looks like this:
<br> typedef itk::PDEDeformableRegistrationFilter<ImageType, ImageType,
DeformType> ItkPDEType;
<br> ItkPDEType::Pointer AlgoPtr = NULL;
<br> switch ( portAlgorithm.getIndex() ) // to choose between various
PDE algorithms
<br> {
<br> case 0: // Demons
<br> typedef itk::DemonsRegistrationFilter<ImageType, ImageType,
DeformType> DemonsType;
<br> AlgoPtr = DemonsType::New();
<br>
<br>
static_cast<DemonsType*>(AlgoPtr.GetPointer())->SetIntensityDifferenceThreshold(
portIDT.getValue() );
<br> break;
<br> case 1:
<br> ......
<br> default:
<br> break;
<br> }
<br>
<br> AlgoPtr->SetMaximumError( 0.1 );
<br> AlgoPtr->SetMaximumKernelWidth( 45 );
<br> AlgoPtr->SetMaximumRMSError( 0.001 );
<br>
<br> typedef itk::MultiResolutionPDEDeformableRegistration<ImageType,
ImageType, DeformType> ItkMultiResPDEType;
<br> ItkMultiResPDEType::Pointer multiresfilter = ItkMultiResPDEType::New();
<br> multiresfilter->SetRegistrationFilter( AlgoPtr );
<br> multiresfilter->SetFixedImage( pItkRefImage );
<br> multiresfilter->SetMovingImage( pItkMovingImage );
<br> if ( pItkDeformField )
<br> {
<br> multiresfilter->SetArbitraryInitialDeformationField(
pItkDeformField );
<br> }
<br> multiresfilter->SetNumberOfLevels( levels );
<br> multiresfilter->SetNumberOfIterations( iterations );
<br> multiresfilter->SetNumberOfThreads( 4 );
<br>
<br> try
<br> {
<br> double maxerror = AlgoPtr->GetMaximumError();
<br> unsigned int width = AlgoPtr->GetMaximumKernelWidth();
<br> double rmserror = AlgoPtr->GetMaximumRMSError();
<br> theMsg->printf( "Maximum error: %f, Maximum kernel width: %d,
Maximum RMS error: %f",
<br> maxerror, width, rmserror );
<br>
<br> multiresfilter->Update();
<br> }
<br> catch( itk::ExceptionObject& err )
<br> {
<br> return;
<br> }
<br>
<br>Thanks - Maarten Beek
</div>
</div><br>
</body></html>