[ITK] how to output 3d tiff stack from a memory buffer

Bradley Lowekamp blowekamp at mail.nih.gov
Fri Jan 30 09:04:19 EST 2015


Hello,

I believe you are looking for the ImportImageFilter:

http://www.itk.org/Doxygen/html/classitk_1_1ImportImageFilter.html

There are a few examples listed in the doxygen to get you started.

Brad


On Jan 30, 2015, at 8:30 AM, Ronn Kling <ronn at rlkling.com> wrote:

> All,
> 
> I have a 3D memory buffer (resampledBuffer) that came from a non ITK source and I want to write it out as a 3D tiff stack. This is what I am trying.  Now I know that FillBuffer only takes a constant fixed pixel type, but there must be a way to get resampledBuffer into them resampleImage pointer?
> 
>          typedef   itk::ImageFileWriter< movingImageType > MovingWriterType;
>          MovingWriterType::Pointer movingWriter = MovingWriterType::New();
>          itk::ImageIOBase::Pointer imageIO3 = itk::TIFFImageIO::New();
>          movingWriter->SetImageIO(imageIO3);
>          movingWriter->SetFileName(outputFileName);
> 
>         //output the 3d tiff stack
>         typedef itk::Image< int, 3 >  ImageType;
>         ImageType::Pointer  resampledImage = ImageType::New();
> 
>         resampledImage->FillBuffer(resampledBuffer);  //not right, but what to use instead?
> 
>         movingWriter->SetInput(resampledImage);
>         movingWriter->Write();
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community



More information about the Community mailing list