[Insight-developers] Sanity Check on itkFiniteCylinderSpatialFunction Evaluate
Williams, Norman K
norman-k-williams at uiowa.edu
Mon Nov 12 17:41:04 EST 2012
I'm investigating this bug report:
https://itk.icts.uiowa.edu/jira/browse/ITK-2576
I suspect that the assumption made by the reporter of this bug is wrong;
for one thing, the one test of this function in ITK doesn't use a cylinder
axis perpendicular to one of the principal axes.
On the other hand, this doesn't make any sense to me either:
//take square root to normalize the orientation vector
medialAxisVector[0] = vcl_sqrt(m_Orientation[0]);
medialAxisVector[1] = vcl_sqrt(m_Orientation[1]);
medialAxisVector[2] = vcl_sqrt(m_Orientation[2]);
You don't normalize a vector by taking its square root, it should be
something like what the bug report suggests. I have a patch pushed into
Gerrit that passes existing regression tests:
http://review.source.kitware.com/#/c/8477/
I will hoist the computation of the normalized orientation vector out into
the SetOrientation method tomorrow.
I guess I have this question: Is this comment wrong if I fix this:
/** Set the orientation vectors (must be orthogonal) of the ellipsoid
axes.
* Must be normalized!!!!! */
itkGetConstMacro(Orientation, InputType);
itkSetMacro(Orientation, InputType);
It seems like the normalized/orthogonal preconditions are unnecessary.
There's also this:
http://www.flipcode.com/archives/Fast_Point-In-Cylinder_Test.shtml
That code has a slightly different definition of a cylinder, but it isn't
a big job to convert between ITK and that code's conventions.
--
Kent Williams norman-k-williams at uiowa.edu
________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you.
________________________________
More information about the Insight-developers
mailing list