A small add-on (copied from ITK document): ExtractImageFilter also collapses dimensions so that the input image may have more dimensions than the output image (i.e. 4-D input image to a 3-D output image). To specify what dimensions to collapse, the ExtractionRegion must be specified. For any dimension dim where ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index to collapse on is specified by ExtractionRegion.Index[dim]. For example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and ExtractionRegion.Index = [0,0,0,2].
Regards, Chao 2016-05-04 13:27 GMT+02:00 Cyril Mory <[email protected]>: > Hi Amjad, > > You can use an ITK extract filter to extract a region that corresponds to > one of your slices (along the axis you want). The output of the extract > filter will be 3D, so you will need to cast it into a 2D images using an > ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: > > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently I am > getting output of XY axis. What should I do in order to get the other axes. > My code is shown below. > > typedef itk::StreamingImageFilter<FloatImageType, FloatImageType> > StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing > [email protected]http://public.kitware.com/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > [email protected] > http://public.kitware.com/mailman/listinfo/rtk-users > >
_______________________________________________ Rtk-users mailing list [email protected] http://public.kitware.com/mailman/listinfo/rtk-users
