[Insight-users] trying to pass a transform in and register

ronn kling ronn at rlkling.com
Wed Feb 27 07:21:17 EST 2013


All,

I have both the transform from
both registration->GetLastTransformParameters();
and transform->GetFixedParameters() that I want to use to re-register an
imagecube.  The goal is to only register the cube once and then use the
saved transform to re-register to save time.  For other reasons I cannot
use the transformFileWriter and transformFileReader.

I reload them like this

typedef itk::VersorRigid3DTransform<double> TransformType;

typedef TransformType::ParametersType ParametersType;
ParametersType parameters( 6 );
for( int i=0;i<5;i++) {
parameters[i] = outTransform[i];
}
TransformType::Pointer finalTransform = TransformType::New();
finalTransform->SetParameters(parameters);

ParametersType fixedParameters( 3 );
for( int i=0;i<2;i++) {
fixedParameters[i] = outFixedParameters[i];
}
finalTransform->SetFixedParameters(fixedParameters);

Import the moving image from a buffer, set the center, origin, etc exactly
like I do when I register it the first time.

I then create, load, and update the resampleImageFilter like this

typedef itk::ResampleImageFilter<MovingImageType,FixedImageType >
ResampleFilterType;
ResampleFilterType::Pointer resampler = ResampleFilterType::New();
resampler->SetTransform(finalTransform);
resampler->SetInput(movingImportFilter->GetOutput());
resampler->SetSize(size);
resampler->SetOutputOrigin(fixedOrigin);
resampler->SetOutputSpacing(fixedSpacing);
resampler->SetDefaultPixelValue(100);
resampler->Update();

But the imagecube that comes out is all the default value of 100.

Any suggestions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130227/b9dacb64/attachment.htm>


More information about the Insight-users mailing list