[Insight-users] MultiResMIRegistration with masking
Martin Kavec
kavec at messi.uku.fi
Wed Mar 16 09:17:41 EST 2005
Hi,
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:
31a32,36
#include "itkImageMaskSpatialObject.h"
#include "itkBinaryThresholdImageFilter.h"
148a154,164
typedef ImageMaskSpatialObject< TMovingImage::ImageDimension > MaskType;
typedef BinaryThresholdImageFilter< MovingImageType, Image< unsigned char, 3 >
FilterType;
219a236,240
typename MaskType::Pointer spatialObjectMask;
typename FilterType::Pointer filter;
and MIMRegistrator.txx
54a57,61
spatialObjectMask = MaskType::New();
filter = FilterType::New();
135a148,161
//Setup filter
filter->SetOutsideValue( 0 );
filter->SetInsideValue( 1 );
filter->SetLowerThreshold( 150 );
filter->SetInput( m_MovingImage );
filter->Update();
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.
Martin
More information about the Insight-users
mailing list