What is the region covered by <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">labelMapRegion? </span><div>Try writing the result of the region of interest filter </div>
<div>to a file to make sure that your problem is not related </div><div>to the ROI filter. <br><div><div><br></div><div>Cagatay</div><div><br><div class="gmail_quote">On Mon, Oct 15, 2012 at 6:50 AM, wydesenej <span dir="ltr">&lt;<a href="mailto:wydesenej@gmail.com" target="_blank">wydesenej@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello.<br>
<br>
I need to extract 2D binary image from 3D label map.<br>
I have got this error while trying to do this task:<br>
<br>
*/usr/local/include/ITK-4.2/itkMatrix.h:240: itk::ERROR: Singular matrix.<br>
Determinant is 0.*<br>
<br>
I am using this sequence of filters:<br>
<br>
/typedef itk::LabelMapToBinaryImageFilter&lt; LabelMapType, BinaryImageType &gt;<br>
LabelMapToBinaryImageFilterType;<br>
LabelMapToBinaryImageFilterType::Pointer mapToBinary =<br>
LabelMapToBinaryImageFilterType::New();<br>
mapToBinary-&gt;SetInput(m_labels[label_id].map);<br>
mapToBinary-&gt;SetBackgroundValue(0);<br>
mapToBinary-&gt;SetForegroundValue(255);<br>
mapToBinary-&gt;Update();<br>
<br>
typedef itk::RegionOfInterestImageFilter&lt;BinaryImageType,BinaryImageType&gt;<br>
RegionOfInterestFilterType;<br>
RegionOfInterestFilterType::Pointer region =<br>
RegionOfInterestFilterType::New();<br>
region-&gt;SetInput(mapToBinary-&gt;GetOutput());<br>
region-&gt;SetRegionOfInterest(labelMapRegion);<br>
region-&gt;Update();<br>
<br>
typedef itk::ExtractImageFilter&lt; BinaryImageType, Binary2ImageType &gt;<br>
ExtractImageFilterType;<br>
ExtractImageFilterType::Pointer extract = ExtractImageFilterType::New();<br>
extract-&gt;SetInput(region-&gt;GetOutput());<br>
extract-&gt;SetDirectionCollapseToIdentity();<br>
extract-&gt;Update();<br>
/<br>
<br>
Please HELP!<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://itk-insight-users.2283740.n2.nabble.com/Extract-2D-from-3D-tp7581326.html" target="_blank">http://itk-insight-users.2283740.n2.nabble.com/Extract-2D-from-3D-tp7581326.html</a><br>

Sent from the ITK Insight Users mailing list archive at Nabble.com.<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" 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" target="_blank">http://www.kitware.com/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" target="_blank">http://www.kitware.com/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" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Cemal Cagatay Bilgin</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Life Sciences Division</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Lawrence Berkeley National Lab</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">MS977, One Cyclotron Road</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Berkeley, CA 94720, USA</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Email: ccbilgin</span><a href="mailto:hchang@lbl.gov" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)" target="_blank">@lbl.gov</a><br>

</div></div></div>