All,<div><br></div><div>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.</div>
<div><br></div><div>I reload them like this</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::VersorRigid3DTransform<double> TransformType;</div><div><br></div><div>
<span class="Apple-tab-span" style="white-space:pre">        </span>typedef TransformType::ParametersType ParametersType;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ParametersType parameters( 6 );</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>for( int i=0;i<5;i++) {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>parameters[i] = outTransform[i];</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>TransformType::Pointer finalTransform = TransformType::New();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>finalTransform->SetParameters(parameters); </div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ParametersType fixedParameters( 3 );</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>for( int i=0;i<2;i++) {</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>fixedParameters[i] = outFixedParameters[i];</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>finalTransform->SetFixedParameters(fixedParameters);</div>
</div><div><br></div><div>Import the moving image from a buffer, set the center, origin, etc exactly like I do when I register it the first time.</div><div><br></div><div>I then create, load, and update the resampleImageFilter like this</div>
<div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::ResampleImageFilter<MovingImageType,FixedImageType > ResampleFilterType;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ResampleFilterType::Pointer resampler = ResampleFilterType::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>resampler->SetTransform(finalTransform);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>resampler->SetInput(movingImportFilter->GetOutput());</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>resampler->SetSize(size);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>resampler->SetOutputOrigin(fixedOrigin);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>resampler->SetOutputSpacing(fixedSpacing);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>resampler->SetDefaultPixelValue(100);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>resampler->Update();</div></div><div><br>
</div><div>But the imagecube that comes out is all the default value of 100.</div><div><br></div><div>Any suggestions?</div>