[Insight-users] Extract 2D from 3D

wydesenej wydesenej at gmail.com
Mon Oct 15 09:50:47 EDT 2012


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.


More information about the Insight-users mailing list