<br>Hi Motes<br><br><br>Let's call<br><br>x = physical point in the fixed image coordinate system<br><br>T = transform<br><br>p = Transform parameters<br><br>x' = T(p,x) = physical point x mapped to moving image <br>
coordinate system by using the Transform T with<br> parameters p.<br><br>J = dx' / dp = Jacobian of mapped point x' with respect<br> to the Transform parameters p.<br><br><br>Therefore, what Luke meant is that <br>
you can use the chain rule as:<br><br> dM / dp = ( dM / dx' ) * ( dx' / dp )<br><br>where<br><br>dM / dx' = Gradient vector of the Moving image<br><br>and<br><br>dx' / dp = Jacobian of the Transform.<br>
<br><br><br> Regards,<br><br><br> Luis<br><br><br>------------------------------------------------------------------------------<br><div class="gmail_quote">On Sun, Sep 6, 2009 at 3:38 PM, motes motes <span dir="ltr"><<a href="mailto:mort.motes@gmail.com">mort.motes@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hm not sure I understand:<br>
<br>
dM/dx(T(p,x)) * dT/dp:<br>
<br>
<br>
<br>
Don't you mean:<br>
<br>
dM/dx' * dT(p,x)/dp:<br>
<br>
where:<br>
<br>
x' = T(p,x)<br>
<br>
corresponding to the transformed pixel in the moving image M?<br>
<div><div></div><div class="h5"><br>
<br>
<br>
<br>
<br>
On Sun, Sep 6, 2009 at 5:07 PM, Luke Bloy<<a href="mailto:luke.bloy@gmail.com">luke.bloy@gmail.com</a>> wrote:<br>
> You use the chain rule.<br>
><br>
> dt/dp = dM(T(p,x))/dp = dM/dx(T(p,x)) * dT/dp<br>
><br>
> so dM/dx(T(p,x)) is the gradient of the moving image evaluated at T(p,x) and<br>
> dT/dp is the jacobian of the transform.<br>
><br>
> -luke<br>
><br>
> motes motes wrote:<br>
>><br>
>> Ok I am trying to do the metric E differentiation by hand:<br>
>><br>
>> E = \sum[F(x) - M(T(p,x))]^2<br>
>> = t^2<br>
>><br>
>> where:<br>
>><br>
>> t = F(x) - M(T(p,x))<br>
>><br>
>> dE/dp = 2t * dt/dp<br>
>><br>
>> where:<br>
>><br>
>> dt/dp = dM(T(p,x))/dp<br>
>><br>
>> since the fixed image is treated as a constant because we are<br>
>> differentiating with respect to the parameters p.<br>
>><br>
>><br>
>> Now I think I understand why its the gradient of the moving image that<br>
>> is used. But how are the Jacobian introduced in:<br>
>><br>
>> dt/dp = dM(T(p,x))/dp<br>
>><br>
>> ?<br>
>><br>
>><br>
>><br>
>><br>
>> On Sun, Sep 6, 2009 at 3:30 PM, motes motes<<a href="mailto:mort.motes@gmail.com">mort.motes@gmail.com</a>> wrote:<br>
>><br>
>>><br>
>>> Thanks for the hint I have read those pages but I still have two<br>
>>> questions to the below expression:<br>
>>><br>
>>> sum += 2.0 * diff * jacobian( dim, par ) * gradient[dim];<br>
>>><br>
>>> 1) In the above expression gradient[dim] corresponds to the gradient<br>
>>> for the current pixel in the moving image? On page 249 in the "Insight<br>
>>> Into Images" this is the first term in (10.6). But why are the<br>
>>> gradient of the moving image used to compute the derivative of the<br>
>>> metric? I know this is a very basic question but I still cannot see<br>
>>> the connection.<br>
>>><br>
>>> 2) When I debug the code the jacobian actually just contains the<br>
>>> weights (computed using the transform kernel) for each node in the<br>
>>> support region. But are the jacobian not supposed to contain the first<br>
>>> order partial derivatives? It seems a bit confusing that the jacobian<br>
>>> is used as a container for the kernel transform weights.<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> On Sun, Sep 6, 2009 at 1:01 PM, Neuner Markus<<a href="mailto:neuner.markus@gmx.net">neuner.markus@gmx.net</a>><br>
>>> wrote:<br>
>>><br>
>>>><br>
>>>> Hi,<br>
>>>><br>
>>>> To understand why the jacobian is used i would suggest to read pages<br>
>>>> 249-251<br>
>>>> in the Book "Insight Into Images" by Terry S. Yoo. Ther eis described<br>
>>>> how<br>
>>>> and why the jacobian is used.<br>
>>>><br>
>>>> Greets<br>
>>>><br>
>>>> motes motes wrote:<br>
>>>><br>
>>>>><br>
>>>>> In itkMeanSquaresImageToImageMetric.txx the metric value and the<br>
>>>>> gradient is computed. I pretty much understand how the metric value is<br>
>>>>> computed but am a bif confused on how the gradient is computed:<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> const RealType movingValue = this->m_Interpolator->Evaluate(<br>
>>>>> transformedPoint );<br>
>>>>> const TransformJacobianType & jacobian =<br>
>>>>> this->m_Transform->GetJacobian( inputPoint );<br>
>>>>> const RealType fixedValue = ti.Value();<br>
>>>>> this->m_NumberOfPixelsCounted++;<br>
>>>>> const RealType diff = movingValue - fixedValue;<br>
>>>>> measure += diff * diff;<br>
>>>>><br>
>>>>> for(unsigned int par=0; par<ParametersDimension; par++)<br>
>>>>> {<br>
>>>>> RealType sum = NumericTraits< RealType >::Zero;<br>
>>>>> for(unsigned int dim=0; dim<ImageDimension; dim++)<br>
>>>>> {<br>
>>>>> sum += 2.0 * diff * jacobian( dim, par ) * gradient[dim];<br>
>>>>> }<br>
>>>>> derivative[par] += sum;<br>
>>>>> }<br>
>>>>> }<br>
>>>>><br>
>>>>> It basically comes down to this line:<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> sum += 2.0 * diff * jacobian( dim, par ) * gradient[dim];<br>
>>>>><br>
>>>>> why is the jacobian multiplied with the current gradient?<br>
>>>>> _____________________________________<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>
>>>>> 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>
>>>>><br>
>>>>><br>
>><br>
>> _____________________________________<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>
>> 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>
><br>
_____________________________________<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>
Please keep messages on-topic and check the ITK FAQ at: <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>
</div></div></blockquote></div><br>