Easiest way, IMHO, is to forgo the general array importer format and use
the standard OpenDX format.  I figured out the correct syntax by creating a
fake data set in OpenDX and exporting it, using options to specify that the
output be placed in two separate files, one containing the header and the
other the data, and to make the data file ascii, rather than binary.  I did
it in script mode, for a 9x9x9 array rather than 90x90x90 (I'm low on disk
space)

dx -script

a = Construct([0 0 0], {[0.5 0.5 0.0][0.5 0.5 0.0][0.0 0.5 0.5]}, [9 9 9], { 
1.0 .. 729 });
a = Compute("$0", a);
Export(a, "test", "dx ascii 2");

(the compute is so that the data file contained something other than a regular 
array).

The result, in test.dx, is
object 1 class gridpositions counts 9 9 9
 origin             0             0             0
 delta            0.5           0.5             0
 delta            0.5           0.5             0
 delta              0           0.5           0.5
attribute "dep" string "positions"
#
object 2 class gridconnections counts 9 9 9
attribute "element type" string "cubes"
attribute "dep" string "connections"
attribute "ref" string "positions"
#
object 3 class array type float rank 1 shape 1 items 729 data file test.data,0
attribute "dep" string "positions"
#
object "default" class field
component "positions" value 1
component "connections" value 2
component "data" value 3
#
end

And test.data simply contains 729 ascii floats.  If I hadn't specified 'ascii', 
then test.data would have contained 729 binary floats.

Greg

Please respond to [email protected]

Sent by:  [EMAIL PROTECTED]


To:   [email protected]
cc:
Subject:  [opendx-users] Importing data in a FCC grid




 Dear all,


  I use opendx for visualizing volumes, up today these volumes where
described by a single file composed by a header and an array of
floats. For importing the data I use "headers files" like:

-------------------
file =spher.fcc
grid = 90 x 90 x 90
#linux
format = lsb ieee
#sgi
#format = msb ieee
interleaving = record
majority = column
header = bytes 1296
field = Density
structure = scalar
type = float
dependency = positions
#positions = -45, 1, -45, 1, -45, 1
positions = 0, 1, 0, 1, 0, 1

end
----------------

These volumes are sampled using a cubic grid with sampling rate 1, or what
is the same using the opendx vocabulary the deltas are:

delta             1             0             0
delta             0             1.0           0
delta             0             0             1.0

Now I need to visualize volumes recorded using

delta             0.5             0.5             0
delta             0.5             0.0             0.5
delta             0.0             0.5             0.5


How should I change the header file? My guess is that the field
"positions" is the one that need to be modified but how?

    thanks for the help


      Roberto




Reply via email to