Hi,<div><br></div><div>I am having troubles writing a BSpline transform produced by DeformableRegistration15.cxx example. I have implemented a bsplineRegistration method, based on that example, that returns the final transform. From my main program, I apply the transform to the image and observing the transformed image I can see that the transform has been applied successfully. At the same time, I write the transform using the itkTransformFileWriter but the parameters field of the produced file is empty. Here is an example:</div>
<div><br></div><div><div>****************************************</div><div>#Insight Transform File V1.0</div><div># Transform 0</div><div>Transform: BSplineDeformableTransform_double_3_3</div><div>Parameters: </div><div>
FixedParameters: 11 11 11 -73 -17 -36.4286 73 17 36.4286 1 0 0 0 1 0 0 0 1</div><div>***************************************</div><div><br></div><div>And the code to write the transform is as follows:</div><div><br></div>
<div><br></div><div>****************************************</div><div><div>    itk::TransformFileWriter::Pointer writerTransform;</div><div>    writerTransform = itk::TransformFileWriter::New();</div><div><br></div><div>
    writerTransform-&gt;AddTransform(transform);</div><div>    writerTransform-&gt;SetFileName(filename.c_str());</div><div><br></div><div>    try{</div><div>        writerTransform-&gt;Update();</div><div>    }</div><div>
    catch( itk::ExceptionObject &amp; excp )</div><div>    {</div><div>        std::cerr &lt;&lt; &quot;Exception thrown INPUT_OUTPUT TransformWriter&quot; &lt;&lt; std::endl;</div><div>        std::cerr &lt;&lt; excp &lt;&lt; std::endl;</div>
<div>        return EXIT_FAILURE;</div><div>    }</div><div>**********************************</div><div><br></div></div><div><br></div><div>I have noticed of this problem when I have tried to read the transform file and I got the following error:</div>
<div><br></div><div>*******************************************************</div><div><div>Loading Transform: .../Transforms/2_3.txt</div><div>terminate called after throwing an instance of &#39;itk::ExceptionObject&#39;</div>
<div>  what():  /usr/local/include/InsightToolkit/Common/itkBSplineDeformableTransform.txx:510:</div><div>itk::ERROR: BSplineDeformableTransform(0x100bb9bf0): Mismatched between parameters size 0 and region size 1331</div>
<div>******************************************************</div><div><br></div><div>And the program produces the error when is executing the Update() of the next lines:</div><div><br></div><div><div>**************************************************</div>
<div>typedef itk::TransformFileReader  TransformReaderType;</div><div>TransformReaderType::Pointer transformReader = TransformReaderType::New();</div><div><br></div><div>std::cout &lt;&lt; &quot;Loading Transform: &quot; &lt;&lt; filename &lt;&lt; std::endl;</div>
<div>transformReader-&gt;SetFileName( filename.c_str());</div><div>transformReader-&gt;Update();</div><div>**************************************************</div><div><br></div><div><br></div><div>Finally comment that same code has been tested with Affine transform and I have not had problems reading, writing and using the Affine transform.</div>
<div><br></div><div>Any idea about what I am doing wrong? </div><div><br></div><div><br></div><div>Thanks in advance.</div><div><br></div></div></div>-- <br>Albert<br>
</div>