[ITK-users] what is the best way to do TriangleMeshToBinaryImageFilter on a region

Dženan Zukić dzenanz at gmail.com
Mon Jan 2 12:39:26 EST 2017


Hi Lee,

I created a test for the behavior you described (attached). The problem
occurred only with multiple calls to Update of
TriangleMeshToBinaryImageFilter. Can you review my patch
<http://review.source.kitware.com/#/c/21896/>?

Regards,
Dženan

On Mon, Jan 2, 2017 at 9:09 AM, Young Lee <questionleon at gmail.com> wrote:

>
> Thanks for Dženan's  suggestion,  I tried RegionOfInterestImageFilter but
> still crash. Looks like there is  a bug and following code in
> itkTriangleMeshToBinaryImageFilter.hxx   does not support regional
> process,
> zInc = extent[3] - extent[2] + 1; zInc  can be huge as for a region
> m_Size[1] - 1 can be  < m_Index[1].
>
>  Should it be extent[3] = region.GetUpperIndex()[1];
>
> itk4100\Modules\Core\Mesh\include\itkTriangleMeshToBinaryImageFilter.hxx
> code
> // create a similar extent like vtk
>   extent[0] = m_Index[0];
>   extent[1] = m_Size[0] - 1;
>   extent[2] = m_Index[1];
>   extent[3] = m_Size[1] - 1;
>   extent[4] = m_Index[2];
>   extent[5] = m_Size[2] - 1;
>
> int          zInc = extent[3] - extent[2] + 1;
> int          zSize = extent[5] - extent[4] + 1;
>
>
>
>
>
> My code to try ROI filter
> typedef itk::RegionOfInterestImageFilter< OutputImageType,
> OutputImageType >
> ROIImageFilter;
>                                                 ROIImageFilter::Pointer
> roifilter = ROIImageFilter::New();
>
>                                                 roifilter->SetInput(
> meshVisualInforVol);
>                                                 roifilter->
> SetRegionOfInterest(region);
>                                                 roifilter->Update();
>
> meshCastFilter->SetInfoImage(roifilter->GetOutput());
> //VisualizingImageType::Pointer visualizing
>
>
>
> --
> View this message in context: http://itk-insight-users.
> 2283740.n2.nabble.com/Re-ITK-users-what-is-the-best-way-to-do-
> TriangleMeshToBinaryImageFilter-on-a-region-tp7589528p7589530.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20170102/0cc77bc6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tester.cpp
Type: text/x-c++src
Size: 2662 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20170102/0cc77bc6/attachment.cpp>


More information about the Insight-users mailing list