Re: Different colors in different displays

Hi Mathias,

The difference in colors occurs because the different ScalarMaps
to RGB have different data ranges.  If you don't call
ScalarMap.setRange() then the auto-scaling logic sets the
ScalarMap range to the actual data range, and the slice may have
a narrower range than the original 3-D data.  You can either
1) explicitly call setRange() for both ScalarMaps to RGB, with
the same ranges, or 2) add a ScalarMapListener to the first
ScalarMap, and when you get a ScalarMapEvent with id
AUTO_SCALE, then call its getRange() and pass the values to
the setRange() of the second ScalarMap.

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

On Fri, 13 Oct 2000, Mathias [ISO-8859-1] Stü wrote:

> Hi together,
> I developed an app which displays 4D-Datasets in a DisplayImplJ3D. The
> user should be able to make a slice of his data. Therefore I implemented (with
> former help of yours, thanks btw. :) a slicer with the
> DirectManipulationRendererJ3D. So far so good.
> Now it's getting a little bit more complicated. The slice should not be
> shown in the original DisplayImplJ3D but in an alternative DisplayImplJ2D in a
> new JFrame. Therefore I initialize the new display with all the relevant
> data (ScalarMaps, ConstantMaps, MathTypes, etc.) of the original display and
> pass, with the help of the doAction-Method of a CellImpl, the respective
> samples to the FlatField of the new DisplayImplJ2D. This works pretty good. 
> But
> there seems to be a problem with the color visualization. The colours in the
> new 2D-display are in some cases nearly the same than in the 3D-display.
> But in some other cases they are terribly different from the original colors.
> It seems to me as if the ranges of the ScalarMaps are not equal. But the
> ScalarMaps of the 2D-display are exact copies of these of the 3d-display so 
> the
> ranges should also be exactly the same. Can you please help me out of this
> problem?
> cheers, Mathias
> -- 
> Sent through GMX FreeMail -