[Insight-developers] OrientedImage and gradient calculations
Blezek, Daniel J (GE, Research)
blezek at crd.ge.com
Fri Mar 17 10:10:24 EST 2006
I would suggest changing the word "stumbled" to "used his deductive powers to figure out an extremely vexing ITK bug".
8-P
-dan
-----Original Message-----
From: insight-developers-bounces+blezek=crd.ge.com at itk.org [mailto:insight-developers-bounces+blezek=crd.ge.com at itk.org]On Behalf Of Miller, James V (GE, Research)
Sent: Friday, March 17, 2006 9:49 AM
To: Insight-developers (E-mail)
Subject: [Insight-developers] OrientedImage and gradient calculations
Dan Blezek stumbled across the following problem:
In the registration framework, the metrics use the image gradient in the calculation of the derivative of the metric wrt to the parameters of the transformation. The image gradients are calculated taking into account the image spacing to provide a gradient in physical space.
When an OrientedImage is used, these gradient calculations are not truly in physical space since gradients are not reoriented into the physical coordinate frame. This affects the registration because the mapping of positions does take into account orientation but the image gradients, and hence the derivative of the metric wrt the parameters, does not. In Dan's test case, when the derivative of the metric should force the transformation to move the image up, it ends up moving the image down.
One solution would be to add methods to image like:
template<class TCoordRep>
void TransformIndexGradientToPhysicalGradient(
const IndexType & index,
CovariantVector<TCoordRep, VImageDimension>& gradient) const
which would convert a gradient computed in index space (without taking into account spacing or orientation) to a gradient computed in physical space.
In Image, this method would merely apply the spacing scale factors. In OrientedImage, this method would apply the spacing scale factors and the orientation matrix. Anywhere gradients are calculated, we would have to make an extra function call to convert the gradients into physical space.
We may also need methods for transforming higher order derivatives (and cross-derivatives).
Alternatively, wherever gradients are calculated, we could check whether we are operating on an Image or an OrientedImage and reorient the gradients as necessary there.
Any other suggestions?
Jim Miller
_____________________________________
Visualization & Computer Vision
GE Research
Bldg. KW, Room C223
1 Research Circle, Schenectady NY 12309-1027
millerjv at research.ge.com < mailto:millerjv at research.ge.com>
(518) 387-4005, Dial Comm: 8*833-4005
Cell: (518) 505-7065, Fax: (518) 387-6981
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20060317/73712ae7/attachment.htm
More information about the Insight-developers
mailing list