Sorry if this repeats - i just got a bounce from Insight Developers, so im trimming the message and resending....<br clear="all">--------------------------------------------------------------<br>Rupert Brooks<br><a href="mailto:rupert.brooks@gmail.com">rupert.brooks@gmail.com</a><br>
<br>
<br><br><div class="gmail_quote">On Wed, Jul 25, 2012 at 4:03 PM, Rupert Brooks <span dir="ltr"><<a href="mailto:rupert.brooks@gmail.com" target="_blank">rupert.brooks@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It could be the Jacobian - the change from having a member jacobian, which made the transforms non-threadsafe, to an external jacobian that is filled by the GetJacobianWithRespectToParameters function places the responsibility for the jacobian allocation /deallocation in the Metric, where it used to be in the transform.<div>
<br></div><div>Check around line 202 of itkMeanSquaresImageToImageMetric.</div><div><br></div><div><div> // Jacobian should be evaluated at the unmapped (fixed image) point.</div><div> TransformJacobianType jacobian;</div>
<div> transform->ComputeJacobianWithRespectToParameters(fixedImagePoint, jacobian);</div><div> for( unsigned int par = 0; par < this->m_NumberOfParameters; par++ )</div></div><div><br></div><div>But this does not use operator=()... So maybe not what you are seeing. Still looking...</div>
<div><br></div><div>Rupert<br clear="all">--------------------------------------------------------------<br>Rupert Brooks<br><a href="mailto:rupert.brooks@gmail.com" target="_blank">rupert.brooks@gmail.com</a><div><div class="h5">
<br><br>
<br><br><div class="gmail_quote">On Wed, Jul 25, 2012 at 1:51 PM, Bradley Lowekamp <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Just to summarize:<div><br></div><div>Most of the filters are about the same performance, however the otsu thresholding is significantly slower.</div><div><br></div><div>The registration is about 2x slower the v3.20.</div>
<div><br></div><div>I quickly sampled the process during registration with on my apple and it revealed the following interesting bit:</div><div><br></div><div><div> 88.45% itk::ImageToImageMetric<itk::Image<unsigned char, 3u>, itk::Image<unsigned char, 3u> >::GetValueAndDerivativeThread(unsigned int) const</div>
<div> 56.62% itk::MeanSquaresImageToImageMetric<itk::Image<unsigned char, 3u>, itk::Image<unsigned char, 3u> >::GetValueAndDerivativeThreadProcessSample(unsigned int, unsigned long, itk::Point<double, 3u> const&, double, itk::CovariantVector<double, 3u> const&) const</div>
<div> 25.04% vnl_matrix<double>::operator=(vnl_matrix<double> const&)</div><div> 15.69% malloc</div></div><div><br></div><div>So there is a significant amount of time spent creating and destroying the matrix.</div>
<div><br></div><div>Most likely this indicates that there is a variable inside the inner loop in the registration that is requiring new and delete, we could likely regain a significant portion of the performance by moving this allocation out side of the loop.</div>
<div><br></div><div>Brad</div><div><br></div><div><snipped></div></div></blockquote></div></div></div></div></blockquote></div>