[Insight-users] Demons registration filter converged to a local minimum
Xuan Zhao
xuanaux at gmail.com
Sun May 30 16:29:16 EDT 2010
Hi,
I use Demons algorithm (SymmetricForcesDemonsRegistrationFilter) to register
two CT images. The input two images of Demons are of size (112x77x27). I
used MultiResolutionPDEDeformableRegistration to register in 3 resolutions.
But the result is not that good. In the coarsest resolution, the MSE firstly
increased and then decreased. After about 200 iterations, the deformation
converge to a local minimum. And the original image is seriously distorted.
I also tried to use only the finest resolution, but the MSE seems keep
increasing. Could someone let me know what is the possible reason? Thanks in
advance.
Code of the Demons registration is here:
ImageType::Pointer
Registration::DemonsDeformableRegistration(ImageType::Pointer fixedImage,
ImageType::Pointer movingImage)
{
typedef float InternalPixelType;
typedef itk::Image< InternalPixelType, Dimension > InternalImageType;
typedef itk::Vector< InternalPixelType, Dimension > VectorPixelType;
typedef itk::Image< VectorPixelType, Dimension > DeformationFieldType;
typedef itk::CastImageFilter< ImageType, InternalImageType >
ImageCasterType;
typedef itk::CastImageFilter< InternalImageType, ImageType >
ImageCasterBackType;
typedef itk::SymmetricForcesDemonsRegistrationFilter< InternalImageType,
InternalImageType, DeformationFieldType> RegistrationFilterType;
typedef itk::HistogramMatchingImageFilter< InternalImageType,
InternalImageType > MatchingFilterType;
typedef itk::MultiResolutionPDEDeformableRegistration< InternalImageType,
InternalImageType, DeformationFieldType >
MultiResRegistrationFilterType;
ImageCasterType::Pointer fixedImageCaster = ImageCasterType::New();
ImageCasterType::Pointer movingImageCaster = ImageCasterType::New();
fixedImageCaster->SetInput( fixedImage );
movingImageCaster->SetInput( movingImage );
MatchingFilterType::Pointer matcher = MatchingFilterType::New();
matcher->SetInput( movingImageCaster->GetOutput() );
matcher->SetReferenceImage( fixedImageCaster->GetOutput() );
matcher->SetNumberOfHistogramLevels( 1024 );
matcher->SetNumberOfMatchPoints( 7 );
matcher->ThresholdAtMeanIntensityOn();
RegistrationFilterType::Pointer filter = RegistrationFilterType::New();
filter->SetStandardDeviations( 3.0 );
CommandIterationUpdateDemons::Pointer observer =
CommandIterationUpdateDemons::New();
filter->AddObserver( itk::IterationEvent(), observer );
MultiResRegistrationFilterType::Pointer multires =
MultiResRegistrationFilterType::New();
multires->SetRegistrationFilter( filter );
multires->SetNumberOfLevels( 3 );
multires->SetFixedImage( fixedImageCaster->GetOutput() );
multires->SetMovingImage( matcher->GetOutput() );
unsigned int nIterations[3] = {1000, 10, 1};
multires->SetNumberOfIterations( nIterations );
CommandResolutionLevelUpdate::Pointer levelobserver =
CommandResolutionLevelUpdate::New();
multires->AddObserver( itk::IterationEvent(), levelobserver );
typedef itk::WarpImageFilter< ImageType, ImageType, DeformationFieldType >
WarperType;
typedef itk::NearestNeighborInterpolateImageFunction< ImageType, double >
InterpolatorType;
WarperType::Pointer warper = WarperType::New();
InterpolatorType::Pointer interpolator = InterpolatorType::New();
warper->SetInput( movingImage );
warper->SetInterpolator( interpolator );
warper->SetOutputSpacing( fixedImage->GetSpacing() );
warper->SetOutputOrigin( fixedImage->GetOrigin() );
warper->SetOutputDirection( fixedImage->GetDirection() );
warper->SetDeformationField( multires->GetOutput() );
warper->Update();
return warper->GetOutput();
}
--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Demons-registration-filter-converged-to-a-local-minimum-tp5119596p5119596.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.
More information about the Insight-users
mailing list