[Rtk-users] Reconstructed Slice save as tiff
Cyril Mory
cyril.mory at uclouvain.be
Wed May 4 07:27:24 EDT 2016
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 list
> Rtk-users at public.kitware.com
> http://public.kitware.com/mailman/listinfo/rtk-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/rtk-users/attachments/20160504/bcc6bf68/attachment-0010.html>
More information about the Rtk-users
mailing list