The way to do this is to Map the colors from the imported tiff image onto
the 2D elevation field prior to using RubberSheet to deform it into 3-D.
Lets suppose that your two initial data objects are a 2-D elevation field,
with a 'data' component carrying height info and with positions in some
arbitrary coordinate space - maybe lat-long?  and a field object resulting
from ReadImage-ing the tiff file, which will have a 'colors' component and
coordinates in pixel space.

By default, Map takes each entry in the "positions" component of the input
input and interpolates a data value for that geometrical point from the map
input.  Thus the two inputs should be in the same coordinate space.
Imagine that you have two fields, one representing the temperature at the
surface in Colorado (a conveniently rectangular state) and the other the
barometric pressure, also at the surface in Colorado.  Both grids represent
the same geometrical space, but can be specified quite differently; for
example, at different resolutions and perhaps using different element types
(eg. triangles and quads).  You want to create a simple field object
representing both the temp and pressure; for example, to RubberSheet by
pressure and Color by temperature.  To do so, you would pass the two inputs
into Map.  Depending on which is passed in as the input input, you'd map
the data from one onto the grid of the other; generally, you'd want to
preserve the higher resolution representation, since otherwise you'd
undersample the higher res field which, presumably, is represented at that
res to avoid sampling artifacts.  Instead, you supersample the lower res
grid.

Map allows you to specify the name of the newly created component; thus, if
the two input fields have "data" components, you could specify that Map
leaves the "data" component of input alone, and creates a "temp"
component... Map(pressure_field, temp_field, NULL, "temp").

To place the tiff image into the same coordinate space as the elevation
data you can Construct an appropriate field, then Replace the "colors"
component of the tiff image onto the constructed field.  To Construct the
grid you need the origin, counts and delta vectors for the grid.  This is
easily done, especially if the elevation grid is regular. The counts has to
match the pixel resolution of the tiff field; the origin should match the
origin of the elevation field,  and the deltas should be determined to fill
the same area as the elevation field - by taking the deltas of the
elevation field, multiplying by the counts of that field minus one, and
dividing by the counts of the tiff field, again minus 1.   If the elevation
field is irregular, you can determine the necessary origin and delta
information by Extracting the "positions" component of the elevation field,
pass it into two Computes to select each coordinate, passing these two
results into Statistics to get the min and max and deriving the origin and
deltas  for the bounding box of the elevation data.

I've attached an example... a macro that, given a arbitrary 2D regular
field and a field representing an image, creates a new field in which the
colors from the image field are preserved, but the coordinate space is
derived from the other field, and an example showing its use.  I hope this
makes sense.

Greg

(See attached file: tiff_rs_example.cfg)(See attached file:
tiff_rs_example.net)(See attached file: tiff2fld.net)

Gib Bogle <[EMAIL PROTECTED]>@opendx.watson.ibm.com on 09/11/2001 01:00:29
AM

Please respond to [email protected]

Sent by:  [EMAIL PROTECTED]


To:   "'[email protected]'"
      <[email protected]>
cc:
Subject:  RE: [opendx-users] Clipping



Thanks for the advice on using Slab.  That gets me a couple of steps closer
to my goal.  I have now run into another difficulty.  I want to Construct a
field corresponding to the TIFF image, but with actual (x,y) positions,
then
attach the image colors to this field.  My reason for doing this is so that
I then hope to use Map to map these colors onto the rubbersheeted image of
the field with the elevation data.  To use Map I believe I need the two
fields to be in the same coordinate system.

I have been doing some testing with Construct and Map to see how to map
colors, without much success.  My simple test has two Constructed fields
which are identically created.  I pass each through Autocolor (here I vary
the parameters) then use Map with Positions and Colors, i.e. I try to map
the colors of one field onto the other.  This gives an error message about
unsupported color format.  If I send the output of each Autocolor module to
Image it displays OK.  Am I trying to do something with Map that it was not
designed to do?

Sorry for asking so many questions.

Gib

NOTICE - This e-mail is only intended to be read by the named recipient.
It
may contain information which is confidential, proprietary or the subject
of
legal privilege. If you are not the intended recipient please notify the
sender immediately and delete this e-mail. You may not use any information
contained in it.  Legal privilege is not waived because you have read this
e-mail.

For further information on the Beca Group of Companies, visit our web page
http://www.beca.co.nz

Attachment: tiff_rs_example.cfg
Description: Binary data

Attachment: tiff_rs_example.net
Description: Binary data

Attachment: tiff2fld.net
Description: Binary data

Reply via email to