Hi Brian,<br><br>Thanks for your response, but I still have some questions:<br><br>Consider a local support transform with parameters \theta = [\theta1, \theta2 ... \thetaP]. <br><br>Then the derivative of each voxel location w.r.t. \|theta will be non zero only for a few parameters (due to the local support assumption). However, I do not understand how we can get away with "m_LocalDerivativeByParzenBin" being of size 4xP. (In MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::BeforeThreadedExecution()<br>
lines 114-130.)<br><br>Is the assumption here that each parameter \theta_p affects only 4 bins in the joint & moving-image-marginal PDFs?<br>If so, I'm not sure that the assumption holds:<br><br>For an arbitrary local support transform, each parameter \theta_p will affect all voxels within its region of interest (ROI). So, for instance, if the ROI for \theta_p has 2 voxels v_i and v_j, such that v_i contributes to bins [k1 k2 k3 k4] and v_j contributes to [k3 k4 k5 k6] in the moving-image-marginal PDF, then the derivatives of the joint and marginal PDFs w.r.t \theta_p will be non-zero at at-least all six bins [k1 k2 k3 .. k6].<br>
<br>Along the same lines, I do not follow how all the results are combined in the <br>MattesMutualInformationImageToImageMetricv4::ComputeResults() function:<br><br>// Apply the pRatio and sum the per-window derivative<br>
// contributions, in the local-support case.<br> if( this->m_ComputeDerivative )<br> {<br> if( this->HasLocalSupport() )<br> {<br> for( SizeValueType i = 0; i < this->m_DerivativeResult->Size(); i++ )<br>
{<br> for( SizeValueType bin = 0; bin < 4; bin++ )<br> {<br> // Increment the m_JointPdfIndex1DArray index by bin in order to recover<br> // the pRatio at the moving indecies used for each portion of the derivative.<br>
// Note: in old v3 metric ComputeDerivatives, derivativeContribution is subtracted in global case,<br> // but added in "local" (implicit) case. These operations have been switched to minimize the metric.<br>
SizeValueType pRatioIndex = this->m_JointPdfIndex1DArray[i] + bin;<br> (*(this->m_DerivativeResult))[i] -= m_LocalDerivativeByParzenBin[bin][i] * this->m_PRatioArray[pRatioIndex];<br> }<br>
}<br> }<br> }<br><br>Here again the assumption seems to be that for the "i"th parameter \theta_i, only 4 bins are affected and hence only the bin-specific weighting of those bins is multiplied before adding the results.<br>
<br>IMHO, m_PRatioArray[][] should be pre-computed and then the derivative contributions should be multiplied with the appropriate values before being added.<br><br>That is, in MattesMutualInformationImageToImageMetricv4GetValueAndDerivativeThreader::ComputePDFDerivatives()<br>
(lines 373-377)<br><br>on line 375:<br>*( localSupportDerivativeResultPtr ) += derivativeContribution*m_PRatioArray[fixedImageParzenWindowIndex][pdfMovingIndex] ;<br>in place of *( localSupportDerivativeResultPtr ) += derivativeContribution;<br>
<br>Does this make sense or am I missing something completely?<br>Please let me know what you think.<br><br>Thanks,<br>Roshni<br><br><br>On Sat, Aug 18, 2012 at 12:46 PM, brian avants <span dir="ltr"><<a href="mailto:stnava@gmail.com" target="_blank">stnava@gmail.com</a>></span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hi R<br>
<br>
yes, a local support transformation only needs a few of the parameters<br>
to define a transformation of a given point. for instance, the<br>
transformation of a point by a discrete displacement field is<br>
determined by a small local neighborhood of information. for<br>
transformations of this type, the derivative of a specific parameter<br>
only depends upon the support or the local neighborhood that affects<br>
it. one of the main changes in v4 is that you can use the same<br>
metros for both local and global support transformations. the Mattes<br>
MI metric originated from this paper:<br>
<br>
"PET-CT Image Registration in the Chest Using Free-form Deformations"<br>
D. Mattes, D. R. Haynor, H. Vesselle, T. Lewellen and W. Eubank IEEE<br>
Transactions in Medical Imaging. Vol.22, No.1, January 2003.<br>
pp.120-128<br>
<br>
but much has changed in the implementation since then and there is<br>
currently no technical paper that accurately describes what's being<br>
done, in particular for the local support case. however, the basic<br>
idea is as described above: just compute the local derivative if your<br>
transform has local support.<br>
<br>
hope this helps,<br>
<br>
brian<br>
<div><div class="h5"><br>
<br>
<br>
<br>
On Fri, Aug 17, 2012 at 8:51 PM, Roshni <<a href="mailto:roshni.b@gmail.com">roshni.b@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I am trying to modify "itkMattesMutualInformationMetricv4" but am having<br>
> trouble following the logic behind the derivative computations when a "local<br>
> support" transformation is used.<br>
> Please could someone explain the basic ideas used?<br>
><br>
> Also, do local support transforms imply dense transformations with local<br>
> support basis functions, e.g. BSpline deformations?<br>
> Please help!<br>
><br>
> Thanks much,<br>
> R<br>
><br>
><br>
</div></div>> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><br>
</blockquote></div><br>