[Insight-users] Re: regarding 2D stacking
Luis Ibanez
luis . ibanez at kitware . com
Fri, 17 Oct 2003 17:38:12 -0400
Hi Sharad,
You can read series of 2D images and pack them in a 3D image
by using the SeriesFileIterator and the ImageSeriesReader.
The code will look like:
typedef itk::NumericSeriesFileIterator NameGeneratorType;
typedef itk::ImageSeriesReader<Image3DType> ReaderType;
NameGeneratorType::Pointer nameIter = NameGeneratorType::New();
nameIter->SetSeriesFormat("file%03d.png");
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileIterator(fileIter);
reader->Update();
You may want to take a look at the file:
Insight/Testing/Code/IO/itkImageSeriesIOTest.cxx
Note that you will have to manually set the spacing in
the third dimension since the 2D files don't provide
this information.
Also, if by "bitmaps" you meant .BMP files, you may have
to convert them first to PNG format. There is currently
no support for BMP files in ITK, partially because this
is a poor format for represnting medical images. You
can convert the files using the ImageMagick tools, or...
it is likely that your microscope offer an alternative
file format for saving images.
Regards,
Luis
---------------------------
Sharad Kumar Somanchi wrote:
> Hi Luis
> I am trying to stack 2D bitmap images from a fluorescent microscope to get
> a 3D image. so can you tell me or send me some reference of how i can do
> this 2D image stacking to get a 3D image
>
> thank you
> regards
> sharad
>