Getting plane slices from array data
- by umanga
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.