Re: beginner question

Hi Ricardo,

> I'm learning visad for the first time.  I had found that is an excellet
> tool for my work but I can't find how to do some things I need.  Please
> could somebody answer this questions:
> 1.  I Load a satellite image as a funcion
> (x,y)->(band1,band2,...,band7).  When I display the image using
> DisplayImplJ2D it is deformated into a scuare but I want it to be
> dispayed as a rectangle because my image is rectangular.  How can I made
> it?
In your program you construct ScalarMaps like: 
  ScalarMap xmap = new ScalarMap(x, Display.XAxis);
  ScalarMap ymap = new ScalarMap(y, Display.YAxis);

You can adjust the aspect ration of the image display by
appropriate calls to:

  xmap.setRange(low_x, hi_x);
  ymap.setRange(low_y, hi_y);

You can also use a call like:

  ProjectionControl pc = display.getProjectionControl();
  pc.setAspect(new double[] {1.0, 0.5}); // would need 3 values for Java3D

But in general setRange() is better than setAspect.

> 2.  I want to interactively paint cirlcles or other shapes over the
> dispalyed image.  Can I do it? How?

You can do it by constructing UnionSets of Gridded2DSets with
manifold dimension = 1, as in visad/examples/

You can also do it by mapping RealTypes to Display.Shape, as 
in visad/examples/ and  There is also
a more recent and sophisticated example of Shape in

Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738

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