<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Lee,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">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 <a href="http://review.source.kitware.com/#/c/21896/">patch</a>?</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Dženan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 2, 2017 at 9:09 AM, Young Lee <span dir="ltr"><<a href="mailto:questionleon@gmail.com" target="_blank">questionleon@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Thanks for Dženan's  suggestion,  I tried RegionOfInterestImageFilter but<br>
still crash. Looks like there is  a bug and following code in<br>
itkTriangleMeshToBinaryImageFi<wbr>lter.hxx   does not support regional process,<br>
zInc = extent[3] - extent[2] + 1; zInc  can be huge as for a region<br>
m_Size[1] - 1 can be  < m_Index[1].<br>
<br>
 Should it be extent[3] = region.GetUpperIndex()[1];<br>
<br>
itk4100\Modules\Core\Mesh\<wbr>include\<wbr>itkTriangleMeshToBinaryImageFi<wbr>lter.hxx<br>
code<br>
// create a similar extent like vtk<br>
  extent[0] = m_Index[0];<br>
  extent[1] = m_Size[0] - 1;<br>
  extent[2] = m_Index[1];<br>
  extent[3] = m_Size[1] - 1;<br>
  extent[4] = m_Index[2];<br>
  extent[5] = m_Size[2] - 1;<br>
<br>
int          zInc = extent[3] - extent[2] + 1;<br>
int          zSize = extent[5] - extent[4] + 1;<br>
<br>
<br>
<br>
<br>
<br>
My code to try ROI filter<br>
typedef itk::<wbr>RegionOfInterestImageFilter< OutputImageType, OutputImageType ><br>
ROIImageFilter;<br>
                                                ROIImageFilter::Pointer roifilter = ROIImageFilter::New();<br>
<br>
                                                roifilter->SetInput(<wbr>meshVisualInforVol);<br>
                                                roifilter-><wbr>SetRegionOfInterest(region);<br>
<span class="">                                                roifilter->Update();<br>
                                                meshCastFilter->SetInfoImage(<wbr>roifilter->GetOutput());<br>
</span>//VisualizingImageType::<wbr>Pointer visualizing<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://itk-insight-users.2283740.n2.nabble.com/Re-ITK-users-what-is-the-best-way-to-do-TriangleMeshToBinaryImageFilter-on-a-region-tp7589528p7589530.html" rel="noreferrer" target="_blank">http://itk-insight-users.<wbr>2283740.n2.nabble.com/Re-ITK-<wbr>users-what-is-the-best-way-to-<wbr>do-<wbr>TriangleMeshToBinaryImageFilte<wbr>r-on-a-region-<wbr>tp7589528p7589530.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the ITK Insight Users mailing list archive at Nabble.com.<br>
______________________________<wbr>_______<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_<wbr>FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br></div>