[Insight-users] MultiResMIRegistration with masking

Martin Kavec kavec at messi.uku.fi
Wed Mar 16 09:17:41 EST 2005


I am trying to modify InsightApplications-2.0.0/MultiResMIRegistration to 
perform registration based on a region defined by masking either fixed or 
moving image.

Here are the modifications I made in MIMRegistrator.h:

#include "itkImageMaskSpatialObject.h"
#include "itkBinaryThresholdImageFilter.h"
typedef ImageMaskSpatialObject< TMovingImage::ImageDimension >   MaskType;
typedef BinaryThresholdImageFilter< MovingImageType, Image< unsigned char, 3 > 
typename MaskType::Pointer                  spatialObjectMask;
typename FilterType::Pointer                filter;

and MIMRegistrator.txx

spatialObjectMask  = MaskType::New();
filter = FilterType::New();
//Setup filter
filter->SetOutsideValue( 0 );
filter->SetInsideValue( 1 );
filter->SetLowerThreshold( 150 );
filter->SetInput( m_MovingImage );

spatialObjectMask->SetImage( filter->GetOutput() );

m_Metric->SetMovingImageMask( spatialObjectMask );

The problem is that no matter how I SetLowerThreshold, I always get identical  
output transformation. I get perfect registration even if I set the threshold 
to 235/255 so only few pixeld pass the threshold. It seems to me as if the 
mask would not have any effect on the registration.

In the same manner I modified MultiResImageRegistration2 from 
ITK/Examples/Registration (with appropriate filter->SetInput( ... ) ) and 
there it works just fine.

I suspect m_MovingImage is not passed correctly to the filter, but when I call 
m_MovingImage->Print(std::cout), it seems it contains the correct image.

I would very much appreciate any help.


More information about the Insight-users mailing list