Getting plane slices from array data

Posted by umanga on Stack Overflow See other posts from Stack Overflow or by umanga
Published on 2010-06-09T08:33:28Z Indexed on 2010/06/09 8:52 UTC
Read the original article Hit count: 220

Filed under:
|
|
|

Greetings all,

I read 3d grid data (from multiple TIF images) into a structure as follows :

typedef struct VolumeData{
 int nx;
 int ny;
 int nz;
 unsigned char *data; // size is nx*ny*nz
}

Now I want to get the plane slices from this 1-D grid data:

eg:

unsigned char* getXYPlaneStack(VolumeData *vol,int z); 

 I could implement above function because the *data array stores image stack.

But i am having difficult time implement along the other axes:

unsigned char* getYZPlaneStack(VolumeData *vol,int x);

and

unsigned char* getXZPlaneStack(VolumeData *vol,int y);

any easy algorithm for this? thanks in advance.

© Stack Overflow or respective owner

Related posts about c

    Related posts about algorithm