<div dir="ltr">Dear Matt,<div><br></div><div>I have tried following your suggestion but, unfortunately, it didn't work out.</div><div><br></div><div>In particular:</div><div><ol><li>I read a pair of uint16 images;</li><li>I cast them to float pixel type via the CastImageFilter;</li><li>I change the TInternalComputationValueType for the metric, the optimizer, the transform and the registration doing something like:</li></ol></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">const unsigned int Dimension = 3; </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">typedef float PixelType;</blockquote></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>typedef unsigned short IOPixelType;</div></blockquote></div><div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">typedef itk::Image<IOPixelType, Dimension> IOImageType; </blockquote></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">typedef itk::Image<PixelType, Dimension> ImageType;</blockquote></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">typedef itk::AffineTransform<float, Dimension > TransformType;</blockquote></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">typedef itk::RegularStepGradientDescentOptimizerv4<float> OptimizerType;</blockquote></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">typedef itk::MeanSquaresImageToImageMetricv4<ImageType, ImageType,ImageType,float> MetricType;</blockquote></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">typedef itk::ImageRegistrationMethodv4<ImageType, ImageType, TransformType> RegistrationType;</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">typedef itk::ResampleImageFilter<IOImageType, IOImageType, float,float> ResampleFilterType;</blockquote><div> </div></div></blockquote><div><br></div><div><div><br></div><div>I have put one memory probe before the registration procedure and one afterwards of it. In the "double" case and in the "float" case I've seen the same memory consumption.</div><div><br></div><div>Am I missing something? Are there other things I should change in my code?</div></div><div><br></div><div>Thanks again for the support,</div><div>Luigi</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-09 17:23 GMT+01:00 Matt McCormick <span dir="ltr"><<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Luigi,<br>
<br>
The type of optimizer should not have too large of an impact on memory<br>
consumption.  Using a gradient-free optimizer may help slightly, but<br>
try changing the pixel type of the input images or, if possible, the<br>
parameter type of the transformation, from double to float.<br>
<br>
HTH,<br>
Matt<br>
<div><div class="h5"><br>
On Mon, Nov 9, 2015 at 10:24 AM, Luigi Riba <<a href="mailto:ribaluigi@gmail.com">ribaluigi@gmail.com</a>> wrote:<br>
> Dear all,<br>
><br>
> I am registering a couple of volumes with ITK 4 on windows 7 64 bit.<br>
><br>
> I wrote a code based on the affine transformation, with the mean square<br>
> error metric and the RegularStepGradientDescentOptimizerv4. Unfortunately,<br>
> the memory usage is pretty high.<br>
><br>
> I have checked memory consumption with the itkMemoryProbe and, after looking<br>
> around on previous mailing list messages I have decided to try with a<br>
> gradient free optimizer like the Nelder-Mead one.<br>
><br>
> So I have rewrote the code using the AmoebaOptimizerV4 and I have continued<br>
> monitoring the memory consumption via MemoryProbe. Unfortunately, it seems<br>
> that nothing has changed. Is this working as expected? If this is the case,<br>
> do you have any suggestion to gave me in order to reduce the memory<br>
> consumption of the code?<br>
><br>
> Thanks in advance for the help.<br>
><br>
> Best,<br>
><br>
> Luigi<br>
><br>
</div></div>> _______________________________________________<br>
> Community mailing list<br>
> <a href="mailto:Community@itk.org">Community@itk.org</a><br>
> <a href="http://public.kitware.com/mailman/listinfo/community" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/community</a><br>
><br>
</blockquote></div><br></div>