<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap:break-word; color:rgb(0,0,0); font-size:14px; font-family:Calibri,sans-serif">
<div><br>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; border-bottom:medium none; border-left:medium none; padding-bottom:0in; padding-left:0in; padding-right:0in; border-top:#b5c4df 1pt solid; border-right:medium none; padding-top:3pt">
<span style="font-weight:bold">From: </span>Chad Stanford &lt;<a href="mailto:chadz111@hotmail.com">chadz111@hotmail.com</a>&gt;<br>
<span style="font-weight:bold">Date: </span>Tuesday, July 3, 2012 9:13 PM<br>
<span style="font-weight:bold">To: </span>&quot;<a href="mailto:insight-users@itk.org">insight-users@itk.org</a>&quot; &lt;<a href="mailto:insight-users@itk.org">insight-users@itk.org</a>&gt;<br>
<span style="font-weight:bold">Subject: </span>[Insight-users] Possible LevelSet Bug Due To Filters' Default UseDirectionOn?<br>
</div>
<div><br>
</div>
<div><style>
<!--
.hmmessage p
        {margin:0px;
        padding:0px}
body.hmmessage
        {font-size:10pt;
        font-family:Tahoma}
-->
</style>
<div class="hmmessage">
<div dir="ltr">
<div>Hello,&nbsp;</div>
<div><br>
</div>
<div>I think have found a bug in many of the level set functions where the level set function derivatives could potentially not correspond with the advection derivatives and possibly other terms. &nbsp;Essentially, many of the level set methods use derivative/gradient
 filters which take into account image direction by default to compute some of their terms e.g. advection. &nbsp;The ComputeUpdate function in itkLevelSetFunction.hxx does not seem to take this into account when it computes the derivatives/gradients of the level
 set function. &nbsp;In my case where the cosine direction matrix was diagonal and had -1 for the first 2 elements, the x and y advection gradient were off by a sign with respect to the sign of the level set function gradients.</div>
<div><br>
</div>
<div>Suggestion: &nbsp;It'd be really great if the UseDirection option being set by default could be mentioned in the user guide because I was not aware of it until I'd spent a lot of time tracing a bug to one of the gradient filter's having that option set by default.
 &nbsp;Also, the option is easy to miss because the user guide does not mention the direction matrix once (as far as I can tell), which would also be a nice addition, amongst other things.</div>
<div><br>
</div>
<div><br>
</div>
<div>While we're on the topic of the direction matrix, this problem has raised some questions I have about it. &nbsp;Any answers or general insight would be greatly appreciated:</div>
<div><br>
</div>
<div>1.) I just want to verify that the direction matrix does not need to be diagonal or have unit elements and is fine as long as it's orthogonal?</div>
</div>
</div>
</div>
</span>
<div>Correct. &nbsp;It does not need to be orthogonal.</div>
<span id="OLK_SRC_BODY_SECTION">
<div>
<div class="hmmessage">
<div dir="ltr">
<div><br>
</div>
<div>2.) What coordinate system is the direction matrix rotating the image-coordinate system to? Basically I'm wondering where it comes from, not how it's made, as I understand given another coordinate system how to generate it.</div>
</div>
</div>
</div>
</span>
<div>The direction cosign follows the conventions described in the DICOM standard.</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div>
<div class="hmmessage">
<div dir="ltr">
<div><br>
</div>
<div>Thanks!</div>
<div>- Chad</div>
</div>
</div>
</div>
</span><br>
<br>
<hr>
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.&nbsp; If you are not the intended recipient, you are hereby notified that any
 retention, dissemination, distribution, or copying of this communication is strictly prohibited.&nbsp; Please reply to the sender that you have received the message in error, then delete it.&nbsp; Thank you.
<hr>
</body>
</html>