<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello Aditya,<div><br></div><div>There are a couple of things you should know about SimpleITK:</div><div><br></div><div>1) Almost all of the filter documentation in SimpleITK is taken from ITK. So some time it needs to be taken with a grain of thought and adapted from the templated ITK world to SimpleITK. Looking at the original ITK documentation can be helpful at time.</div><div><br></div><div>2) The SimpleITK Image class contains a variety of ITK images inside using the pimpl idiom to encapsulate.The these are listed as PixelIDs in a a couple different spots, sitkPixelIDValues.h, for example. So we have chosen to use the itk::Image class with large number of scalar type. In ITK there are many types of multi-component pixel type, RGB, RGBA, FixedArray, Vector, and CovariantVector, to name just a few. Because there are too many combinations of these specific fixed length types, we have chosen to go with the more general VectorImage where the number of components can be chosen at run-time. So For the EdgePotentialImageFilter, it is expecting an SimpleITK Image which holds a VectorImage, or an image a type of vector pixelIDs.</div><div><br></div><div>So embarrassingly, we haven't wrapped either of the GradientImage filters yet. However, I thought it should be easily enough to compute the derivatives and compose them into a VectorImage. Unfortunately, the Compose filter was not there. So I have just added, it to SimpleITK's experimental next development branch. With this patch you can use the filter as follows in python:</div><div><br></div><div>import SimpleITK as sitk</div><div><br></div><div><div>img = sitk.ReadImage("cthead1-Float.mha" ) # note that this is a floating point pixel type</div><div>D = [sitk.Derivative( img, 0 ), sitk.Derivative( img, 1 ) ]</div><div>grad = sitk.Compose( D )</div></div><div>sitk.Show( sitk.EdgePotential( grad ), "EdgePotential" )</div><div><br></div><div>Looking at the equation in the ITK code you could also try the more flexible but less efficient:</div><div><br></div><div>e = &nbsp;sitk.Exp( - sitk.Sqrt( (D[0]**2+D[1]**2) )</div><div>sitk.Show( e, "ManualEdgePotential" )</div><div><br></div><div><br></div><div>I am not sure what I think of the results of the filter, likely some aggressive de-noising may be needed before taking the EdgePotential.</div><div><br></div><div>This should get you up and running. I am going to work on getting the Gradient filters directly working on SimpleITK, however this will require a couple of changes to ITK do to &nbsp;some issues related to the CovariantVector.</div><div><br></div><div>Hope this help,</div><div>Brad</div><div><br><div><div>On Apr 24, 2012, at 5:39 PM, <a href="mailto:aptea@mskcc.org">aptea@mskcc.org</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">

<title>CovariantVector image in SimpleITK </title>

<div>
<font face="Arial"><span style="font-size:12pt">I am trying out the EdgePotentialImageFilter in SimpleITK. It mentions that the input should be a CovariantVector image. But I do no find any class in SimpleITK which implements the CovariantVector image. Any pointers to create a CovariantVector image in SimpleITK would be great.<br>
<br>
Thanks,<br>
Aditya<br>
</span></font><div><br class="webkit-block-placeholder"></div><pre wrap=""> 
     =====================================================================
     
     Please note that this e-mail and any files transmitted from
     Memorial Sloan-Kettering Cancer Center may be privileged, confidential,
     and protected from disclosure under applicable law. If the reader of
     this message is not the intended recipient, or an employee or agent
     responsible for delivering this message to the intended recipient,
     you are hereby notified that any reading, dissemination, distribution, 
     copying, or other use of this communication or any of its attachments
     is strictly prohibited.  If you have received this communication in 
     error, please notify the sender immediately by replying to this message
     and deleting this message, any attachments, and all copies and backups
     from your computer.
</pre><div><br class="webkit-block-placeholder"></div></div>


_____________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br>http://www.kitware.com/products/protraining.php<br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://www.itk.org/mailman/listinfo/insight-users<br></blockquote></div><br><div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 12px; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">========================================================</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Bradley Lowekamp<span class="Apple-converted-space">&nbsp;</span><span class="Apple-converted-space">&nbsp;</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Medical Science and Computing for</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Office of High Performance Computing and Communications</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">National Library of Medicine<span class="Apple-converted-space">&nbsp;</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; "><a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a></font></p><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline">
</div>
<br></div></body></html>