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.
2nd and 3rd functions both resample your data set (they are basically expressing your image in a new referential).
So they must reorganize the data:
ny*nzfor YZ andnx*nzfor XZ(In this scenario, the caller is responsible of deallocating the newly allocated memory.)
Your algorithm for the YZ plane is: