Changeset 423 for trunk/loci/visbio/view


Ignore:
Timestamp:
06/03/05 18:09:57 (15 years ago)
Author:
curtis
Message:

Use new switchTypes with units.

Location:
trunk/loci/visbio/view
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/visbio/view/ColorHandler.java

    r417 r423  
    175175        if (trans instanceof ImageTransform) { 
    176176          ImageTransform it = (ImageTransform) trans; 
    177           if (ff != null) ff = VisUtil.switchType(ff, it.getType()); 
     177          if (ff != null) { 
     178            ff = VisUtil.switchType(ff, it.getType(), it.getImageUnits()); 
     179          } 
    178180        } 
    179181        colorPane.setPreviewData(ff); 
  • trunk/loci/visbio/view/StackLink.java

    r409 r423  
    401401      RealType ybox = it.getYType(); 
    402402      RealType zbox = it.getZType(); 
     403      Unit[] imageUnits = it.getImageUnits(); 
     404      Unit[] xyzUnits = {imageUnits[0], imageUnits[1], it.getZUnit(stackAxis)}; 
     405      // CTR START HERE: 
     406      //why isn't this unit assignment orienting the bounding box properly? 
    403407      try { 
    404408        RealTupleType xyz = new RealTupleType(xbox, ybox, zbox); 
    405         setData(new Gridded3DSet(xyz, samps, 5)); 
     409        setData(new Gridded3DSet(xyz, samps, 5, null, xyzUnits, null, false)); 
    406410      } 
    407411      catch (VisADException exc) { exc.printStackTrace(); } 
     
    470474    if (stackAxis >= 0) pos[stackAxis] = 0; 
    471475 
     476    // compute volume data 
    472477    if (thumbs) setData(DUMMY, volumeRef, false); 
    473478    else { 
     
    479484        RealType zType = it.getZType(); 
    480485        FunctionType imageType = it.getType(); 
     486        Unit[] units = it.getImageUnits(); 
    481487        try { 
    482488          if (collapse == null) { 
    483489            // use image transform's recommended MathType 
    484490            for (int i=0; i<len; i++) { 
    485               slices[i] = VisUtil.switchType((FlatField) slices[i], imageType); 
     491              slices[i] = 
     492                VisUtil.switchType((FlatField) slices[i], imageType, units); 
    486493            } 
    487494            // compile slices into a single volume and collapse 
  • trunk/loci/visbio/view/TransformLink.java

    r409 r423  
    476476      // special case: use ImageTransform's suggested MathType instead 
    477477      FlatField ff = (FlatField) d; 
    478       FunctionType ftype = ((ImageTransform) trans).getType(); 
    479       try { d = VisUtil.switchType(ff, ftype); } 
     478      ImageTransform it = (ImageTransform) trans; 
     479      FunctionType ftype = it.getType(); 
     480      Unit[] units = it.getImageUnits(); 
     481      try { d = VisUtil.switchType(ff, ftype, units); } 
    480482      catch (VisADException exc) { exc.printStackTrace(); } 
    481483      catch (RemoteException exc) { exc.printStackTrace(); } 
Note: See TracChangeset for help on using the changeset viewer.