1D pointer to 3D array casting

S

suresh.gn

Hey all,

I have a small problem. I have a 3D image data. I am reading it as a
pointer *Inputimage. I need to convert it to 3D at only one point. can
any one tell me the mapping equation?

e,g
image[j][k] = *(InputImage + something*i +something*j +k)
I am sure it is possible. and the soln should look like something
like this.

Thanx
 
A

Alf P. Steinbach

* (e-mail address removed):
[OFF-TOPIC, IMPROBABLE, and also looks like HOMEWORK]

I have a small problem. I have a 3D image data.

Where did you obtain 3D image data?

That's not easy to come by, and processing it requires high-end equipment.

So already your story is highly IMPROBABLE.

I am reading it as a pointer *Inputimage.

You are not.

At best you're reading it as a sequence of bytes.

At worst you're creatively rewording a homework assignment, without getting it
right.

I need to convert it to 3D at only one point. can
any one tell me the mapping equation?

e,g
image[j][k] = *(InputImage + something*i +something*j +k)
I am sure it is possible. and the soln should look like something
like this.


This looks very much like a reworded HOMEWORK assignment: such problem doesn't
crop up in practice, and certainly not for a complete novice.

Anyway it's got nothing to do with C++.

Hence, it's OFF-TOPIC in this group even if it isn't homework.
 
J

Jim Langston

Hey all,

I have a small problem. I have a 3D image data. I am reading it as a
pointer *Inputimage. I need to convert it to 3D at only one point. can
any one tell me the mapping equation?

e,g
image[j][k] = *(InputImage + something*i +something*j +k)
I am sure it is possible. and the soln should look like something
like this.

Thanx


Consider 2 dimentional array 10x10. First 10 elements take the first row,
2nd 10 the 2nd row, etc.. So to get the first element (column) of the second
row it's *[Row*width + column] or 1*10+0 = 10 (remember, arrays are 0 based
in C/C++). Notice that width refers to the number of columns (first array
size).

Now, you have Row, Column, Depth. [Row*Width + Column*Height + Depth]
should do.
 
S

suresh.gn

If you don't know the answer please keep quite, some body will answer
it definitely. Thanx to Jim Langston..
 
K

Karl Heinz Buchegger

If you don't know the answer please keep quite, some body will answer
it definitely. Thanx to Jim Langston..

Could you please eleborate how your inability to set up an
equation is related to C++?

You are new to this newsgroup and want to tell the regulars to shut up.
Ts, ts.
In *this* newsgroup we have rules, and just because you have a problem
we don't trash this rules.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top