Hey guys, I'm back
I'm basically expanding my program to make a different view of the images that I created by creating a "3D cube" where it will take 31 front-view images and make a side-view image e.g.
31 original images that look like this: (front view)
http://www.nlm.nih.gov/research/visible/image/head_mri.jpg
To produce 256 images that look like something like this: (side view)
http://www.qedata.se/bilder/grafik/mri-scan.jpg
Well, that's not really important. I know how I would go by doing that once I get the data into a 3D array, but I'm stuck on the importing part.
Say for instance, I have a set of data that looks like this:
255 0 0 0 0 0 0 255
255 50 50 50 50 50 50 255
255 50 70 70 70 70 50 255
255 50 50 50 50 50 50 255
255 0 0 0 0 0 0 255
255 50 50 50 50 50 50 255
255 50 70 70 70 70 50 255
255 50 50 50 50 50 50 255
255 0 0 0 0 0 0 255
255 50 50 50 50 50 50 255
255 50 70 70 70 70 50 255
255 50 50 50 50 50 50 255
and I want to place each set of data in it's own specific location i.e. the first one would be imagearray[4][8][0], the second [4][8][1] and the third [4][8][2] (kind of in the form [x][y][z])
The problem is that I don't know how I would go about addressing the z value. I have no idea how I would make it so the data from the first table goes into [4][8][0], and the second [4][8][1] etc. Is it simply a modification of my original code (which I owe you guys a million for helping me with)
So, I was thinking of something like this:
But the part that gets me is how I would tell the program to skip to the next table once the data has been entered into the previous one. Am I missing something really simple here?
I'm basically expanding my program to make a different view of the images that I created by creating a "3D cube" where it will take 31 front-view images and make a side-view image e.g.
31 original images that look like this: (front view)
http://www.nlm.nih.gov/research/visible/image/head_mri.jpg
To produce 256 images that look like something like this: (side view)
http://www.qedata.se/bilder/grafik/mri-scan.jpg
Well, that's not really important. I know how I would go by doing that once I get the data into a 3D array, but I'm stuck on the importing part.
Say for instance, I have a set of data that looks like this:
255 0 0 0 0 0 0 255
255 50 50 50 50 50 50 255
255 50 70 70 70 70 50 255
255 50 50 50 50 50 50 255
255 0 0 0 0 0 0 255
255 50 50 50 50 50 50 255
255 50 70 70 70 70 50 255
255 50 50 50 50 50 50 255
255 0 0 0 0 0 0 255
255 50 50 50 50 50 50 255
255 50 70 70 70 70 50 255
255 50 50 50 50 50 50 255
and I want to place each set of data in it's own specific location i.e. the first one would be imagearray[4][8][0], the second [4][8][1] and the third [4][8][2] (kind of in the form [x][y][z])
The problem is that I don't know how I would go about addressing the z value. I have no idea how I would make it so the data from the first table goes into [4][8][0], and the second [4][8][1] etc. Is it simply a modification of my original code (which I owe you guys a million for helping me with)
Code:
for (row = 0; row < ROWS; row++)
{
for (col = 0; col < COLS; col++) // Enters data into array column-by-column and row-by-row
{
fscanf(inf, "%d", &imagearray[row][col]); //Stores image data into the array
}
}
So, I was thinking of something like this:
Code:
for (set = 0; set < SETS; set++)
{
for (row = 0; row < ROWS; row++)
{
for (col = 0; col < COLS; col++) // Enters data into array column-by-column and row-by-row
{
fscanf(inf, "%d", &imagearray[row][col][set]); //Stores image data into the array
}
}
}
But the part that gets me is how I would tell the program to skip to the next table once the data has been entered into the previous one. Am I missing something really simple here?