Sounds like you're on the right track.  You can sort it into a regular
grid ordering pretty easily.  Then because arrays are flat, you're one step
away from having the regular grid you want.

     I think you want something like this, probably from the Compute module
down:

     #
     # An odd way to convert from row-major to column-major array order.
     #
     row_major = Construct( {[0,0,0]}, {[0,0,1],[0,1,0],[1,0,0]}, [2,2,2],
                            {0,1,2,3,4,5,6,7} );
     mark = Mark( row_major, "positions" );
     compute = Compute( "$0.x * 2*2 + $0.y * 2 + $0.z", mark );
     sort = Sort( compute );
     unmark = Unmark( sort );
     column_major = Construct( {[0,0,0]}, {[1,0,0],[0,1,0],[0,0,1]}, [2,2,2] );
     replace = Replace( unmark, column_major, "data", "data" );
     Print( replace, "d", "data" );

     Since your x/y/z are on separate data fields, you'll probably be
feeding them into separate inputs of the Compute module.  Then just compute
any number that puts the positions in the desired order and Sort.  Move
"saved data" back to "data", and then transfer the whole array to a regular
grid with the appropriate geometry (that is, one where the positions are
implicitly numbered in the same order you've used to sort the data).  Just
remember that the deltas are ordered slowest-varying to fastest-varying (I
believe that's right -- see the User's Guide pg. 31 for a picture).

     If your data has varying dimensions in X/Y/Z, you can generalize this
with some Inquire("counts"), Inquire("position gridcounts"), or similar.

Randy

-- 
Randall Hopper
[EMAIL PROTECTED]


[EMAIL PROTECTED]:
 | After numerous sleepless nights I finally give up and ask you for help.
 | With the help of Donna (thanks again) I succeeded in importing a set of 
 | data
 | with ImportSpreadsheet.
 | 
 | "x"  "y"  "z"  "b"
 | 0     0    0    100
 | 0     0    1    103
 | ...
 | 0     0    10   -98
 | 0     1    10   -95
 | 0     1     9   -99
 | ...
 | 
 | 
 | It's organized into columns and imported with ImportSpreadsheet.
 | I know the field misses 'connections' but I can't figure out how to add 
 | these.
 | I attached a jpeg image from my data.
 | The way it is measured is shown by 'ShowConnections'.
 | The x-axis is from bottom to top.
 | The z-axis is from left to right (red to blue)
 | 
 | I understand Connections should be integers pointing to the nth-element 
 | of the data.
 | But how can I make cubic connections in this dataset.
 | Do I have to sort the data first ?
 | 
 | Larry de Graaf

Reply via email to