473,383 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

1D pointer to 3D array casting

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[i][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 '05 #1
5 3331
* su*******@gmail.com:
[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[i][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?
Sep 23 '05 #2
<su*******@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
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[i][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.
Sep 23 '05 #3
If you don't know the answer please keep quite, some body will answer
it definitely. Thanx to Jim Langston..

Sep 23 '05 #4
su*******@gmail.com 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
kb******@gascad.at
Sep 23 '05 #5
su*******@gmail.com 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.
Sep 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: ali | last post by:
Hi, I'm trying to understand the reason for different output on the following codes Code1: #include <iostream.h> int main()
5
by: overbored | last post by:
I can do this: int asdf; int* zxcv = asdf; but not this: int asdf; int** zxcv = asdf;
22
by: Alex Fraser | last post by:
From searching Google Groups, I understand that void pointer arithmetic is a constraint violation, which is understandable. However, generic functions like qsort() and bsearch() must in essence do...
11
by: Edd | last post by:
Hello all, I've made a data structure and an associated set of functions to enable me to store a dynamically-sized array of elements of whatever data type I like. Well that's the idea anyway......
204
by: Alexei A. Frounze | last post by:
Hi all, I have a question regarding the gcc behavior (gcc version 3.3.4). On the following test program it emits a warning: #include <stdio.h> int aInt2 = {0,1,2,4,9,16}; int aInt3 =...
8
by: Sam | last post by:
I have a situation occuring in my code and I just can't see to figure out why I have an structure called employee that will put all of the employee id's into a char array set to 10 struct...
17
by: Christian Wittrock | last post by:
Hi, What does ANSI C say about casting an 8 bit pointer to a 16 bit one, when the byte pointer is pointing to an odd address? I have detected a problem in the Samsung CalmShine 16 compiler. This...
9
by: Sarath | last post by:
Why the following happening? UINT m_uArrXpos; UINT **p = m_uArrXposSchema; // Failed to compile UINT **p = (UINT**)m_uArrXposSchema; // Success compilation
11
by: jois.de.vivre | last post by:
I am interfacing with a third party API (written in C, if that matters) that has an "event handler" function with the following definition: void event_handler(int event_code, unsigned long...
25
by: Ioannis Vranos | last post by:
Are the following codes guaranteed to work always? 1. #include <iostream> inline void some_func(int *p, const std::size_t SIZE) {
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.