<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Leon,</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">have you tried using <a href="https://itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html">RegionOfInterest</a> instead of ExtractImageFilter? Extract is used for changing image dimension, e.g. extracting a 2D slice from a 3D volume.</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 Sun, Jan 1, 2017 at 4:38 AM, Y T <span dir="ltr"><<a href="mailto:magicimaging@gmail.com" target="_blank">magicimaging@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-size:12.8px">Subject: what is the best way to do TriangleMeshToBinaryImageFilte<wbr>r on a region</span><br style="font-size:12.8px"><span style="font-size:12.8px">I want to show a small local mesh in a big volume, but I encounter following</span><br style="font-size:12.8px"><span style="font-size:12.8px">issue</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">when  Info Image is big (meshCastFilter->SetInfoImage(</span><span style="font-size:12.8px"><wbr>meshVisualInfor) =</span><br style="font-size:12.8px"><span style="font-size:12.8px">512x512x1300)  even the mesh is a small locally generated mesh (100x50x50),</span><br style="font-size:12.8px"><span style="font-size:12.8px">the TriangleMeshToBinaryImageFilte</span><span style="font-size:12.8px"><wbr>r   filter take ~1 second to finish.</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">If try following ExtractImageFilter code to get a small region of original</span><br style="font-size:12.8px"><span style="font-size:12.8px">full volume (meshVisualInfor) TriangleMeshToBinaryImageFilte</span><span style="font-size:12.8px"><wbr>r  will crash at</span><br style="font-size:12.8px"><span style="font-size:12.8px">m_InfoImage->Update();</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">Is there good way to do regional TriangleMeshToBinaryImageFilte</span><span style="font-size:12.8px"><wbr>r ?</span><br style="font-size:12.8px"><span style="font-size:12.8px">Thanks and happy 2017!</span><br style="font-size:12.8px"><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">typedef itk::ExtractImageFilter< OutputImageType, OutputImageType ></span><br style="font-size:12.8px"><span style="font-size:12.8px">ExtractImageFilter;</span><br style="font-size:12.8px"><span style="font-size:12.8px">ExtractImageFilter::Pointer roifilter = ExtractImageFilter::New();</span><br style="font-size:12.8px"><span style="font-size:12.8px">roifilter-></span><span style="font-size:12.8px">SetDirectionCollaps<wbr>eToSubmatri</span><span style="font-size:12.8px">x();</span><br style="font-size:12.8px"><span style="font-size:12.8px">roifilter->SetInput(</span><span style="font-size:12.8px">meshVisual<wbr>Infor);</span><br style="font-size:12.8px"><span style="font-size:12.8px">roifilter-></span><span style="font-size:12.8px">SetExtractionRegion<wbr>(region);</span><br style="font-size:12.8px"><span style="font-size:12.8px">roifilter->Update();</span><br style="font-size:12.8px"><span style="font-size:12.8px">meshCastFilter->SetInfoImage(</span><span style="font-size:12.8px">r<wbr>oifilter->GetOutput()); //meshVisualInfor work</span><br style="font-size:12.8px"><span style="font-size:12.8px">but take ~1 second</span><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 31, 2016 at 10:55 AM,  <span dir="ltr"><<a href="mailto:insight-users-owner@itk.org" target="_blank">insight-users-owner@itk.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You are not allowed to post to this mailing list, and your message has<br>
been automatically rejected. This mailing list requires subscription<br>
before you can post any messages. For subscription information, go to:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://www.itk.org/mailman/lis<wbr>tinfo/insight-users</a><br>
<br>
If you think that your messages are being rejected in error, contact<br>
the mailing list owner at <a href="mailto:insight-users-owner@itk.org" target="_blank">insight-users-owner@itk.org</a>.<br>
<br>
<br><br>---------- Forwarded message ----------<br>From: Leon Tan <<a href="mailto:magicimaging@gmail.com" target="_blank">magicimaging@gmail.com</a>><br>To: <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a><br>Cc: <br>Date: Sat, 31 Dec 2016 08:55:26 -0700 (MST)<br>Subject: what is the best way to do TriangleMeshToBinaryImageFilte<wbr>r  on a region<br>I want to show a small local mesh in a big volume, but I encounter following<br>
issue<br>
<br>
when  Info Image is big (meshCastFilter->SetInfoImage(<wbr>meshVisualInfor) =<br>
512x512x1300)  even the mesh is a small locally generated mesh (100x50x50),<br>
the TriangleMeshToBinaryImageFilte<wbr>r   filter take ~1 second to finish.<br>
<br>
If try following ExtractImageFilter code to get a small region of original<br>
full volume (meshVisualInfor) TriangleMeshToBinaryImageFilte<wbr>r  will crash at<br>
m_InfoImage->Update();<br>
<br>
Is there good way to do regional TriangleMeshToBinaryImageFilte<wbr>r ?<br>
Thanks and happy 2017!<br>
<br>
<br>
typedef itk::ExtractImageFilter< OutputImageType, OutputImageType ><br>
ExtractImageFilter;<br>
ExtractImageFilter::Pointer roifilter = ExtractImageFilter::New();<br>
roifilter->SetDirectionCollaps<wbr>eToSubmatrix();<br>
roifilter->SetInput(meshVisual<wbr>Infor);<br>
roifilter->SetExtractionRegion<wbr>(region);<br>
roifilter->Update();<br>
meshCastFilter->SetInfoImage(r<wbr>oifilter->GetOutput()); //meshVisualInfor work<br>
but take ~1 second<br>
<br>
<br><span class="HOEnZb"><font color="#888888">
<br>
--<br>
View this message in context: <a href="http://itk-insight-users.2283740.n2.nabble.com/what-is-the-best-way-to-do-TriangleMeshToBinaryImageFilter-on-a-region-tp7589525.html" rel="noreferrer" target="_blank">http://itk-insight-users.22837<wbr>40.n2.nabble.com/what-is-the-<wbr>best-way-to-do-TriangleMeshToB<wbr>inaryImageFilter-on-a-region-<wbr>tp7589525.html</a><br>
Sent from the ITK Insight Users mailing list archive at Nabble.com.<br>
<br></font></span></blockquote></div><br></div>
<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>
<br></blockquote></div><br></div>