Re: Taking CrossSections of Volumetric Data

Hi Steve,
 
> I am plotting some volumetric data as (x,y,z)->w and using a mapContour+
> ContourWidget to view the (Linear3DSet) 64x64x64 data.
>
> I would like to try several display/speed up trade offs but I haven't
> yet been able to figure how to do some things with visad.
>
> 1. how does one get or display planar sections?
 
In the future we may add planar sections to VisAD displays,
but it can be done now by invoking the resample method of
Function (implemented by FieldImpl and FlatField) to resample
values of your ((x,y,z)->w) FlatField to a Set in (x,y,z)
whose samples all lie on a plane.
 
Specifically, if 'volume' is your FlatField with MathType
((x,y,z)->w), then:
 
  SampledSet set = (SampledSet) volume.getDomainSet();
 
will get its domain sampling and set.getLow() and set.getHi()
will return the ranges of values of samples.  Then construct
a Gridded3DSet with manifold dimension 2 using the constructor
 
  Gridded3DSet planar_set = Gridded3DSet(MathType type,
               float[][] samples, int lengthX, int lengthY);
 
where the samples[3][lengthX * lengthY] array defines a grid of
lengthX * lengthY points on the planar slice you want to display
(the ranges of values of 'set' samples will be useful for picking
the extents of these planar samples).  Then resample 'volume' to
this planar set by
 
  FlatField slice = volume.resample(planar_set,
                       Data.WEIGHTED_AVERAGE, Data.NO_ERRORS);
 
now you can just link 'slice' to a DisplayImpl.
 
You can also create an interactive slice, by linking some
RealTuples with MathType (x,y,z) to the same DisplayImpl via
DirectManipulationRendererJ3D, and linking them to a CellImpl
that compute the location of the planar slice and resample
'volume' to it.  Three such RealTuples would uniquely define a
plane.
 
Tom Rink's answer about domain factoring refers to new methods
that transform ((x,y,z)->w) into (x->((y,z)->w)) and hence
could be used to render on slices parallel to the (y,z) (or
(x,z) or (x,y)) planes.
 
> 2. is there a way of adding a clipping plane to see "inside" the volume?
 
Sorry, not yet.  Clipping for Java3D and Java2D are on our "to do" list.
 
> 3. are there routines which will "re-sample" the data at a lower rate?
 
You can do the same thing as described above under question 1, except
resample to a Linear3DSet with the same extents as the domain set of
'volume' but fewer samples.
 
Cheers,
Bill
 
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
whibbard@xxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html
 
"kill cross-platform Java by growing the polluted Java market"
   - from an internal Microsoft planning document
 

  • 1998 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: