[Insight-users] What is 4D image and how is it organized?

Luis Ibanez luis.ibanez at kitware.com
Sun Aug 31 10:42:12 EDT 2008


Hi Namgyun,


        ITK was designed to support N-D images.


A 4D image is not constructed as a stack of 3D images, nor as
a tensor product of 2D images of 2D images.


      Instead, the 4D image is a *native* 4D structure.


The same goes for the 5D image, the 6D images... and so on.


When you declare a 4D image in ITK you get an array that you
address with 4D indices (x,y,z,w).

Internally what you get is a contiguous block of memory
containing enough bytes for holding the data of:


         ND1 x ND2 x ND3 x ND4 x NBPP

ND1: number of pixels along dimension 1
ND2: number of pixels along dimension 2
ND3: number of pixels along dimension 3
ND4: number of pixels along dimension 4

NBPP: number of bytes per pixel.



Every pixel in a 4D image is addressed by a 4-components index.
A pixel addressed by the index (i,j,k,l) is located in memory
at offset:


  ( ( ( ( l * ND4 ) + k ) * ND3 + j ) * ND2 + i ) * NBPP



The pixel also has coordinates in a 4-dimensional space.
The interpretation of these dimensions is up to you.

You could say that

     Dimension 1 is X,
     Dimension 2 is Y,
     Dimension 3 is Z,
     Dimension 4 is W


or you could say that

     Dimension 1 is time,
     Dimension 2 is X,
     Dimension 3 is Y,
     Dimension 4 is Z

or you could say that

     Dimension 1 is wavelength,
     Dimension 2 is X,
     Dimension 3 is Y,
     Dimension 4 is Z

and so on....



Please let us know if you have further questions.


    Thanks


       Luis



=================
namgyun Lee wrote:
> Hi ,everyone!!
> I am a new ITK user and have a question about image organization.
> 
> 
> Without any doubt, I used to think that 4D image was a stack of 3D 
> images, where each 3D image is volume possessing 3 dimension (x,y,z).
> For example, if I have  27 volumes, let say they are 256x256x60 in 
> dimension, then I thought 4D image would be 256*256*(60*27).
> 
> However, as I study more about the ITK, I came across to think that the 
> definition of 4D image in ITK  might be not equal to what I have been 
> thinking.
> Could anyone explain about this?
> 
> I am not sure about what I am thinking, but it seems like 4D image has 3 
> Dimension (row, column, slice)
> and each voxel contains several values equal to the number of volumes 
> (27 different values if I use above 27 different volumes).
> 
> 
> 
> Please correct me if I am wrong.
> If you know the answer, could you also give me the reference about it?
> I am currently reading the ITK software guide, but I have not found any 
> information about the structure of 4D image yet.
> 
> 
> 
> Thank you so much.
> 
> Sincerely,
> Namgyun Lee
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list