[Insight-users] How to "concatenate" images.

Luis Ibanez luis.ibanez at kitware.com
Wed, 07 Apr 2004 17:32:05 -0400


Hi George,

If your RAW file actually contains the series of 3D images,
you could create a 4D ITK image for loading it.  For the
RAW file you create a MetaImage header with a 4D especification.

Then in your code you instantiate a 4D image like

    typedef itk::Image<char,4> ImageType;

and the reader as

    typedef itk::ImageFileReader< ImageType > ReaderType;

Once you have the image in memory you could extract the
3D images corresponding to each instant by using the
ExtractImageFilter.  Then perform registration and
reinsert the resampled moving images into an output 4D
image.

Finally save the 4D image using MetaImage, which will
produce a metaimage header and a raw file.

Note that this is by no means a good use of memory, and
you probably want to consider other data flow strategies
unless your 3D images are really small.



    Regards,


      Luis



-----------------------
George Iordanescu wrote:

> Hello everybody,
> 
> I have to register a time sequence of 3D images to a single 3D image.
> The whole time sequence is stored in a single raw file. I read it in a
> "fake" itk image and from there I extract each volume, corresponding to
> a moment in time.  Then I register each extracted volume to a fixed 3D
> image and then I need to save the registered volumes again in a single
> raw file. I was thinking of creating another itk image object and then
> put in it each registered volume, one after another. I know how to do it
> by allocating the space corresponding to all the registered volumes and
> then using memcpy and pixel buffer to copy each registered volume to the
> corresponding adress in the allocated space. Is there a better way to do
> it? I looked at the PasteImageFilter but it is not clear how to add
> extra volumes.
> 
> Thank you.
> 
> George  
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>