[Insight-users] itkPDEDeformableRegistrationFilter
Maarten Beek
beekmaarten at yahoo.com
Thu Apr 15 12:28:20 EDT 2010
Hi all;
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.
Using their respective Get* functions, I get the values I set earlier
returned.
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.
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.
My code looks like this:
typedef itk::PDEDeformableRegistrationFilter<ImageType, ImageType,
DeformType> ItkPDEType;
ItkPDEType::Pointer AlgoPtr = NULL;
switch ( portAlgorithm.getIndex() ) // to choose between various
PDE algorithms
{
case 0: // Demons
typedef itk::DemonsRegistrationFilter<ImageType, ImageType,
DeformType> DemonsType;
AlgoPtr = DemonsType::New();
static_cast<DemonsType*>(AlgoPtr.GetPointer())->SetIntensityDifferenceThreshold(
portIDT.getValue() );
break;
case 1:
......
default:
break;
}
AlgoPtr->SetMaximumError( 0.1 );
AlgoPtr->SetMaximumKernelWidth( 45 );
AlgoPtr->SetMaximumRMSError( 0.001 );
typedef itk::MultiResolutionPDEDeformableRegistration<ImageType,
ImageType, DeformType> ItkMultiResPDEType;
ItkMultiResPDEType::Pointer multiresfilter = ItkMultiResPDEType::New();
multiresfilter->SetRegistrationFilter( AlgoPtr );
multiresfilter->SetFixedImage( pItkRefImage );
multiresfilter->SetMovingImage( pItkMovingImage );
if ( pItkDeformField )
{
multiresfilter->SetArbitraryInitialDeformationField(
pItkDeformField );
}
multiresfilter->SetNumberOfLevels( levels );
multiresfilter->SetNumberOfIterations( iterations );
multiresfilter->SetNumberOfThreads( 4 );
try
{
double maxerror = AlgoPtr->GetMaximumError();
unsigned int width = AlgoPtr->GetMaximumKernelWidth();
double rmserror = AlgoPtr->GetMaximumRMSError();
theMsg->printf( "Maximum error: %f, Maximum kernel width: %d,
Maximum RMS error: %f",
maxerror, width, rmserror );
multiresfilter->Update();
}
catch( itk::ExceptionObject& err )
{
return;
}
Thanks - Maarten Beek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100415/38913030/attachment.htm>
More information about the Insight-users
mailing list