<html>
<body>
<br>
Hi Luis, <br>
Thank you very much for your useful comments. Actually I hadn't
understood very well the role of the 'maximum step' parameter, and of
course I have already tried this correction. However, it looked not to be
enough, since <b>the error persists</b>... <br>
Answering to your questions:<br><br>
1) None. Actually I checked that it failed just when beginning the
registration process. That's why I guess that it was due to
initialization...<br><br>
2) No, but how could I reflect them on the scales? In this particular
case (but I use to work with different images), the characteristics
are:<br>
&nbsp;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>Size of
every volume in the series = 512 x 512 x 24<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
ElementSpacing = 0.742188 x 0.742188 x 6.6<br>
&nbsp; <br>
3) I had chosen MomentsOn(),&nbsp; but actually I'd like to know which
would be more recommendable and which criteria should I
consider?<br><br>
4) I got it now. But then I have another question. Wouldn't be equivalent
to change the scales and then allow a larger step? So for example (just
like an approximation):<br><br>
<font face="Arial, Helvetica" color="#0000FF"><i>typedef</font>
<font face="Arial, Helvetica">
OptimizerType::ScalesType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
OptimizerScalesType;<br>
&nbsp; OptimizerScalesType optimizerScales(
transform-&gt;GetNumberOfParameters() );<br>
&nbsp;
</font><font face="Arial, Helvetica" color="#0000FF">const</font>
<font face="Arial, Helvetica">
</font><font face="Arial, Helvetica" color="#0000FF">double</font>
<font face="Arial, Helvetica"> translationScale = 1.0 / 1000.0; <br>
&nbsp;
</font><font face="Arial, Helvetica" color="#0000FF">const</font>
<font face="Arial, Helvetica">
</font><font face="Arial, Helvetica" color="#0000FF">double</font>
<font face="Arial, Helvetica"> rotationScale = 1.0 / 60.0; <br><br>
&nbsp; optimizerScales[0] = rotationScale ;<br>
&nbsp; optimizerScales[1] = rotationScale ;<br>
&nbsp; optimizerScales[2] = rotationScale ;<br>
&nbsp; optimizerScales[3] = translationScale;<br>
&nbsp; optimizerScales[4] = translationScale;<br>
&nbsp; optimizerScales[5] = translationScale;<br><br>
<br><br>
<br>
</i></font>I have another 2 comments:<br><br>
5) What about the <b>rotation description?</b> I didn't change nothing in
this piece of code, but maybe that's the clue...<br><br>
<font face="Arial, Helvetica" color="#0000FF"><i>typedef</font>
<font face="Arial, Helvetica"> TransformType::VersorType&nbsp;
VersorType;<br>
&nbsp;
</font><font face="Arial, Helvetica" color="#0000FF">typedef</font>
<font face="Arial, Helvetica">
VersorType::VectorType&nbsp;&nbsp;&nbsp;&nbsp; VectorType;<br><br>
&nbsp; VersorType&nbsp;&nbsp;&nbsp;&nbsp; rotation;<br>
&nbsp; VectorType&nbsp;&nbsp;&nbsp;&nbsp; axis;<br>
&nbsp; <br>
&nbsp; axis[0] = 0.0; <br>
&nbsp; axis[1] = 0.0; <br>
&nbsp; axis[2] = 1.0; <br><br>
&nbsp;
</font><font face="Arial, Helvetica" color="#0000FF">const</font>
<font face="Arial, Helvetica">
</font><font face="Arial, Helvetica" color="#0000FF">double</font>
<font face="Arial, Helvetica"> angle = 0;<br><br>
&nbsp; rotation.Set(&nbsp; axis, angle&nbsp; );<br>
&nbsp; transform-&gt;SetRotation( rotation );<br><br>
</i></font>6) Which could be a good size for the
<b>'<font face="Arial, Helvetica">numberOfHistogramBins' </b>defined for
the metric? I am working with unsigned short format, and the images have
intensities about the range min = 0.000000, max = 660.000000. I guess
that depending on that parameter the computational cost will change, but
would you give me a suggestion? 32, 64, 128,... would be any of them
ok?<br><br>
<br>
</font>I'm looking forward to your answer.<br>
Thanks,<br>
Rosario<br><br>
<br>
At 03:19 13/06/2007, Luis Ibanez wrote:<br><br>
<blockquote type=cite class=cite cite="">Hi Rosario,<br><br>
Thanks for the detailed description of your problem.<br><br>
The combination of registration components that you<br>
are using looks fine.<br><br>
You are also guessing correctly that the problem is<br>
probably related to the initialization.<br><br>
<br>
A couple of questions:<br><br>
<br>
1) How many iterations of the optimizer do you see<br>
&nbsp;&nbsp; with the Observer before the Exception is thrown ?<br><br>
<br>
2) I see that in the translation scales you are not<br>
&nbsp;&nbsp; taking into account the spacing and number of<br>
&nbsp;&nbsp; pixels of your images. It is usually wise to do<br>
&nbsp;&nbsp; so because in that way you can be sure that the<br>
&nbsp;&nbsp; translation scaling really correspond to the<br>
&nbsp;&nbsp; physical extent of your images.<br><br>
&nbsp;&nbsp; What are the number of pixels of your images,<br>
&nbsp;&nbsp; and what are their pixel spacings ?<br><br>
<br>
3) What mode of the CenteredTransformInitializer are<br>
&nbsp;&nbsp; you using:&nbsp; Geometry ? or Moments ?<br><br>
<br>
4) The value 0.2 as initial maximum step is a bit<br>
&nbsp;&nbsp; large. Note that since the parameter scaling<br>
&nbsp;&nbsp; for the Versor (unit quaternion) components of<br>
&nbsp;&nbsp; the transform is 1.0, that means that your first<br>
&nbsp;&nbsp; jump in the parametric space is going to be of<br>
&nbsp;&nbsp; 11 degrees in rotation. You may want to start<br>
&nbsp;&nbsp; with a smaller amount, maybe something like just<br>
&nbsp;&nbsp; 1 degree or rotation, which should be a step of<br>
&nbsp;&nbsp; 0.02.<br><br>
<br><br>
Please let us know,<br><br>
<br>
&nbsp; Thanks<br><br>
<br>
&nbsp;&nbsp;&nbsp; Luis<br><br>
<br><br>
<br>
=====================<br>
Rosario Sance wrote:<br>
<blockquote type=cite class=cite cite="">Hi all,<br>
My question is regarding to a particular implementation of a Registration
algorithm I have just tried without success.<br>
Firstly I checked the example &quot; ImageRegistration8.cxx&quot;, in
which the use of the &quot; itkVersorRigid3DTransform&quot; is
illustrated, and it worked.<br>
Then I did the same with the example &quot;
ImageRegistrationHistogramPlotter.cxx&quot;, which deals with the &quot;
MutualInformationHistogramImageToImageMetric&quot;, and also worked
properly with my images. (Since they are 3D volumes I did the required
changes and I had no problems at all).<br>
However, when I tried to create a new algorithm with the elements:<br>
TRANSFORM: itkVersorRigid3DTransform (with the
itkCenteredTransformInitializer)<br>
OPTIMIZER: itkVersorRigid3DTransformOptimizer<br>
METRIC: MutualInformationHistogramImageToImageMetric<br>
INTERPOLATOR: itkLinearInterpolateImageFunction<br>
The code was properly built but I achieved a permanent error in
execution:<br>
/ExceptionObject caught !<br>
itk::ExceptionObject (013CF7FC)<br>
Location: &quot;void __thiscall itk::HistogramImageToImageMetric&lt;class
itk::Image&lt;float,3&gt;,class itk::Image&lt;float,3&gt;
&gt;::ComputeHistogram(const class itk::Array&lt;double&gt; &amp;,class
itk::Statistics::Histogram&lt;double,2,class
itk::Statistics::DenseFrequencyContainer&gt; &amp;) const&quot;<br>
File:
c:\itk\insighttoolkit-3.2.0\code\algorithms\itkHistogramImageToImageMetric.txx<br>
Line: 303<br>
Description: itk::ERROR:
MutualInformationHistogramImageToImageMetric(018A50D8): All the points
mapped to outside of the moving image<br>
/I guessed that the problem came from the initialization of the
Optimizer:<br>
&nbsp; /typedef/ /
OptimizerType::ScalesType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
OptimizerScalesType;<br>
&nbsp; OptimizerScalesType optimizerScales(
transform-&gt;GetNumberOfParameters() );<br>
&nbsp; const double translationScale = 1.0 / 1000.0;<br>
&nbsp; optimizerScales[0] = 1.0;<br>
&nbsp; optimizerScales[1] = 1.0;<br>
&nbsp; optimizerScales[2] = 1.0;<br>
&nbsp; optimizerScales[3] = translationScale;<br>
&nbsp; optimizerScales[4] = translationScale;<br>
&nbsp; optimizerScales[5] = translationScale;<br>
&nbsp; optimizer-&gt;SetScales( optimizerScales );<br>
&nbsp; optimizer-&gt;SetMaximumStepLength( 0.2000&nbsp; );<br>
&nbsp; optimizer-&gt;SetMinimumStepLength( 0.0001 );<br>
&nbsp; optimizer-&gt;SetNumberOfIterations( 200 );<br><br>
/but I was playing with it and I couldn't avoid the fail... The same with
the initialization of the transform:<br>
/ / /typedef itk::CenteredTransformInitializer&lt; TransformType,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb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nbsp;&nbsp;&nbsp;&nbsp;
TransformInitializerType::New();<br>
(/...)<br>
I have tried it with different images (different sizes and resolution).
All of them are MRI dynamic studies of the abdominal region (3D volumes
on time). I'd really like to know what's happening with my piece of code.
*Is there any specific limitation for mixing those elements in a new
algorithm?<br>
*Thank you very much in advance.<br>
Rosario<br>
___________________________________________________<br>
Rosario Sance Garzón<br>
Grupo de Tecnologías de Imagen Biomédica<br>
Dpto. Ingeniería Electrónica<br>
E.T.S.I. Telecomunicación - UPM<br>
Ciudad Universitaria<br>
28040 - Madrid<br>
Teléfono: 91 549 57 00 (Ext. 4220)
Fax:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 91 336 73 23<br>
Web:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="http://www.die.upm.es/im" eudora="autourl">
http://www.die.upm.es/im</a><br>
___________________________________________________<br>
/Rosario Sance Garzón<br>
Biomedical Image Techologies<br>
Electronic Engineering Department<br>
E.T.S.I. Telecomunicación - UPM<br>
Ciudad Universitaria<br>
E-28040 - Madrid (SPAIN)<br>
//Telephone: +34 91 549 57 00 (Ext. 4220)
Fax:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +34 91 336 73 23<br>
Web:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="http://www.die.upm.es/im" eudora="autourl">
http://www.die.upm.es/im</a><br>
/ ___________________________________________________<br><br>
------------------------------------------------------------------------<br>
_______________________________________________<br>
Insight-users mailing list<br>
Insight-users@itk.org<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" eudora="autourl">
http://www.itk.org/mailman/listinfo/insight-users</a></blockquote><br><br>
-- <br>
No virus found in this incoming message.<br>
Checked by AVG Free Edition. Version: 7.5.472 / Virus Database:
269.8.15/847 - Release Date: 12/06/2007 21:42<br>
</blockquote>
<x-sigsep><p></x-sigsep>
<font face="Eras Medium ITC">
___________________________________________________</font> <br><br>
<font face="Arial TUR, Helvetica">Rosario Sance Garzón<br>
Grupo de Tecnologías de Imagen Biomédica<br>
Dpto. Ingeniería Electrónica<br>
E.T.S.I. Telecomunicación - UPM<br>
Ciudad Universitaria<br>
28040 - Madrid <br><br>
</font>Teléfono: 91 549 57 00 (Ext. 4220)&nbsp; <br>
Fax:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 91 336 73 23<br>
Web:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="http://www.die.upm.es/im" eudora="autourl">
http://www.die.upm.es/im<br>
</a><font face="Eras Medium ITC">
___________________________________________________</font> <br><br>
<font face="Arial TUR, Helvetica"><i>Rosario Sance Garzón<br>
Biomedical Image Techologies<br>
Electronic Engineering Department<br>
E.T.S.I. Telecomunicación - UPM<br>
Ciudad Universitaria<br>
E-28040 - Madrid (SPAIN)<br><br>
</font>Telephone: +34 91 549 57 00 (Ext. 4220)&nbsp; <br>
Fax:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +34 91 336 73 23<br>
Web:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="http://www.die.upm.es/im" eudora="autourl">
http://www.die.upm.es/im<br>
</a></i><font face="Eras Medium ITC">
___________________________________________________</font> <br>
</body>
</html>