1D pointer to 3D array casting

Discussion in 'C++' started by suresh.gn@gmail.com, Sep 23, 2005.

  1. Guest

    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
     
    , Sep 23, 2005
    #1
    1. Advertising

  2. * :
    > [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.

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
     
    Alf P. Steinbach, Sep 23, 2005
    #2
    1. Advertising

  3. Jim Langston Guest

    <> wrote in message
    news:...
    > 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.
     
    Jim Langston, Sep 23, 2005
    #3
  4. Guest

    If you don't know the answer please keep quite, some body will answer
    it definitely. Thanx to Jim Langston..
     
    , Sep 23, 2005
    #4
  5. wrote:
    >
    > 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.

    --
    Karl Heinz Buchegger
     
    Karl Heinz Buchegger, Sep 23, 2005
    #5
  6. Default User Guest

    wrote:

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


    How about this?

    *plonk*



    Brian

    --
    Please quote enough of the previous message for context. To do so from
    Google, click "show options" and use the Reply shown in the expanded
    header.
     
    Default User, Sep 23, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kevin
    Replies:
    11
    Views:
    5,816
    Andrew McDonagh
    Jan 8, 2005
  2. ken
    Replies:
    3
    Views:
    2,523
    Rolf Magnus
    Nov 8, 2003
  3. Abhishek

    Casting a file pointer to char pointer

    Abhishek, Mar 21, 2006, in forum: C Programming
    Replies:
    9
    Views:
    659
    santosh
    Mar 22, 2006
  4. Replies:
    11
    Views:
    1,411
    James Kanze
    Jun 7, 2007
  5. , India

    pointer to an array vs pointer to pointer

    , India, Sep 20, 2011, in forum: C Programming
    Replies:
    5
    Views:
    464
    James Kuyper
    Sep 23, 2011
Loading...

Share This Page