[Insight-users] Extract 2D from 3D

Cagatay Bilgin bilgincc at gmail.com
Mon Oct 15 12:18:10 EDT 2012


What is the region covered by labelMapRegion?
Try writing the result of the region of interest filter
to a file to make sure that your problem is not related
to the ROI filter.

Cagatay

On Mon, Oct 15, 2012 at 6:50 AM, wydesenej <wydesenej at gmail.com> wrote:

> Hello.
>
> I need to extract 2D binary image from 3D label map.
> I have got this error while trying to do this task:
>
> */usr/local/include/ITK-4.2/itkMatrix.h:240: itk::ERROR: Singular matrix.
> Determinant is 0.*
>
> I am using this sequence of filters:
>
> /typedef itk::LabelMapToBinaryImageFilter< LabelMapType, BinaryImageType >
> LabelMapToBinaryImageFilterType;
> LabelMapToBinaryImageFilterType::Pointer mapToBinary =
> LabelMapToBinaryImageFilterType::New();
> mapToBinary->SetInput(m_labels[label_id].map);
> mapToBinary->SetBackgroundValue(0);
> mapToBinary->SetForegroundValue(255);
> mapToBinary->Update();
>
> typedef itk::RegionOfInterestImageFilter<BinaryImageType,BinaryImageType>
> RegionOfInterestFilterType;
> RegionOfInterestFilterType::Pointer region =
> RegionOfInterestFilterType::New();
> region->SetInput(mapToBinary->GetOutput());
> region->SetRegionOfInterest(labelMapRegion);
> region->Update();
>
> typedef itk::ExtractImageFilter< BinaryImageType, Binary2ImageType >
> ExtractImageFilterType;
> ExtractImageFilterType::Pointer extract = ExtractImageFilterType::New();
> extract->SetInput(region->GetOutput());
> extract->SetDirectionCollapseToIdentity();
> extract->Update();
> /
>
> Please HELP!
>
>
>
> --
> View this message in context:
> http://itk-insight-users.2283740.n2.nabble.com/Extract-2D-from-3D-tp7581326.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://www.itk.org/mailman/listinfo/insight-users
>



-- 
Cemal Cagatay Bilgin
Life Sciences Division
Lawrence Berkeley National Lab
MS977, One Cyclotron Road
Berkeley, CA 94720, USA
Email: ccbilgin at lbl.gov <hchang at lbl.gov>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20121015/a4e424c5/attachment.htm>


More information about the Insight-users mailing list