<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hey all,
<div class=""><br class="">
</div>
<div class="">I’m just getting started with ITK, and I’m using the python bindings, which are really awesome. It looks like it was a fair bit of work to get such a heavily templated library to work in Python, but it’s really nice to be able to build scripts
in python!</div>
<div class=""><br class="">
</div>
<div class="">I set out to reimplement Slicer’s “Simple Region Growing Segmentation” using ITK-Python, but I keep getting an error when I try to define a ConfidenceConnectedImageFilter template on a 3d float (and double, too). IMG_F == itk.Image[itk.F, 3] elsewhere
in the script.</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""></div>
</div>
<blockquote type="cite" class="">
<div class="">
<div class="">Traceback (most recent call last):</div>
<div class=""> File "simple_region_growing_segmentation.py", line 169, in <module></div>
<div class=""> sys.exit(main(sys.argv))</div>
<div class=""> File "simple_region_growing_segmentation.py", line 154, in main</div>
<div class=""> args.seed)</div>
<div class=""> File "simple_region_growing_segmentation.py", line 98, in attach_connect</div>
<div class=""> ccif = ConfidenceConnectedImageFilter[IMG_F, IMG_F].New()</div>
<div class=""> File "/home/jporter/usr/local/ITK/bin/Wrapping/Generators/Python/itkTemplate.py", line 263, in __getitem__</div>
<div class=""> (str(parameters), self.__name__))</div>
<div class="">KeyError: "itkTemplate : No template (<class 'itkImagePython.itkImageF3'>, <class 'itkImagePython.itkImageF3'>) for the itk::ConfidenceConnectedImageFilter class"</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">I’m pretty sure I built the bindings appropriately to get float support:</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""></div>
</div>
<blockquote type="cite" class="">
<div class="">
<div class="">cmake -DITK_USE_REVIEW=ON -DITK_WRAP_PYTHON=ON -DBUILD_SHARED_LIBS=ON -DITK_LEGACY_SILENT=ON -DITK_WRAP_float=ON -DITK_WRAP_rgb_unsigned_char=ON -DITK_WRAP_vector_double=ON -DITK_WRAP_complex_double=ON -DITK_WRAP_double=ON </div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">Interestingly, I <i class="">can</i> build a CurvatureFlowImageFilter or a CastImageFilter templated against 3d floats. I can also instantiate a ConfidenceConnectedImageFilter templated against itk.UC (presumably unsigned char?). That made me
think that it’s not possible to build a ConfidenceConnectedImageFilter templated on floats, but the <a href="http://www.itk.org/Doxygen/html/Examples_2Segmentation_2ConfidenceConnected_8cxx-example.html#_a5" class="">ConfidenceConnected</a> example segmentation
script does just that.</div>
<div class=""><br class="">
</div>
<div class="">I’d love to hear thought/suggestions as to how I can proceed!</div>
<div class=""><br class="">
</div>
<div class="">Cheers,</div>
<div class="">Justin</div>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif""><o:p></o:p></span>
<p></p>
<div></div>
<p class="MsoNormal"><o:p> </o:p></p>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="100%" align="center">
</div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:gray">The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended
recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone
or return mail.</span></p>
</body>
</html>