[Insight-users] Extract ROI from 3D Volume

agatte wiatrak11 at poczta.onet.pl
Sat Jan 7 14:15:27 EST 2012


Hi All Itk- Users ;)

I' m trying to extract ROI from 3D Volume .
I receive some of errors.
What can I apply this filter to 3D Image (Volume dicom) ?
Could anybody know some examples with 3D Volume ?

typedef signed short PixelType;
const unsigned int Dimension = 3;
typedef itk::Image<PixelType,Dimension> ImageType;
typedef itk::ImageFileReader<ImageType> ReaderType;
typedef itk::ImageFileWriter<ImageType> WriterType;


std::string p = "ImageDCM.dcm";
reader->SetFileName(p);
reader->Update();


 ImageType::SizeType inSize =
reader->GetOutput()->GetLargestPossibleRegion().GetSize();
 typedef itk::RegionOfInterestImageFilter< ImageType, ImageType >
RoiFilterType;
 RoiFilterType::Pointer roiFilter = RoiFilterType::New();

 ImageType::IndexType start;
 start[0] = inSize[0]/2;
 start[1] = inSize[1]/2;

 ImageType::SizeType size;
 size[0] = inSize[0]/2;
 size[1] = inSize[1]/2;

 start.Fill(10);
 size.Fill(254);

 ImageType::RegionType desiredRegion;
 desiredRegion.SetSize(size);
 desiredRegion.SetIndex(start);
 roiFilter->SetRegionOfInterest(desiredRegion);
 roiFilter->SetInput(reader->GetOutput());

 WriterType::Pointer writerROI = WriterType::New();
 writerROI->SetFileName("writerRoiFilter.dcm");
 writerROI->SetInput(roiFilter->GetOutput());
 writerROI->Update(); 


I would appreciate for any help


Best,
Agatte
		

-- 
View this message in context: http://old.nabble.com/Extract-ROI-from-3D-Volume-tp33099645p33099645.html
Sent from the ITK - Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list