[Insight-users] extracting slice problem

alaamegawer alaamegawer at yahoo.com
Sat Jun 2 16:18:24 EDT 2012



Hi All

i have dataset with dimensions 512 * 512 *148  and i need to extract slice
from this volume . all things is going good in case of  extracting  in z dir
but when  i try to change dir i got unexpected slice . so i wanna know what
should i do to get correct slice 

       typedef itk::ExtractImageFilter< InputImageType, OutputImageType >
FilterType;

	FilterType::Pointer filter = FilterType::New();
	filter->InPlaceOn();

	//reader->UpdateOutputInformation();
	InputImageType::RegionType inputRegion =
reader->GetOutput()->GetLargestPossibleRegion();

	InputImageType::SizeType size = inputRegion.GetSize();
	size[1] = 0;

	InputImageType::IndexType start = inputRegion.GetIndex();
	const unsigned int sliceNumber = 100;
	start[1] = sliceNumber;

	InputImageType::RegionType desiredRegion;
	desiredRegion.SetSize(  size  );
	desiredRegion.SetIndex( start );

	 filter->SetExtractionRegion( desiredRegion );
	 filter->SetDirectionCollapseToIdentity();
	 filter->SetInput( SampleFilter->GetOutput() );
	 filter->Update();

Thanks In advance 

Alaa
-- 
View this message in context: http://old.nabble.com/extracting-slice-problem-tp33950911p33950911.html
Sent from the ITK - Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list