Changeset 404 for trunk/loci/visbio/view


Ignore:
Timestamp:
05/25/05 14:14:46 (15 years ago)
Author:
curtis
Message:

Add option for adjusting maximum image stack resolution.

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

Legend:

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

    r390 r404  
    4040  /** Maximum number of simultaneous displays. */ 
    4141  public static final int MAX_DISPLAYS = 32; 
     42 
     43  /** String for image stack resolution limit option. */ 
     44  public static final String STACK_LIMIT = "Limit image stack resolution"; 
    4245 
    4346  /** String for ImageJ quit warning. */ 
     
    122125  public DisplayControls getControls() { return displayControls; } 
    123126 
     127  /** Gets maximum resolution of stacked images from VisBio options. */ 
     128  public int[] getStackResolution() { 
     129    OptionManager om = (OptionManager) bio.getManager(OptionManager.class); 
     130    ResolutionToggleOption opt = (ResolutionToggleOption) 
     131      om.getOption(STACK_LIMIT); 
     132    if (opt.getValue()) return new int[] {opt.getValueX(), opt.getValueY()}; 
     133    else return new int[] {Integer.MAX_VALUE, Integer.MAX_VALUE}; 
     134  } 
     135 
    124136 
    125137  // -- LogicManager API methods -- 
     
    198210    bio.setSplashStatus(null); 
    199211    OptionManager om = (OptionManager) bio.getManager(OptionManager.class); 
     212    int stackRes = StackHandler.DEFAULT_STACK_RESOLUTION; 
     213    om.addOption("Visualization", new ResolutionToggleOption(STACK_LIMIT, 'l', 
     214      "Adjusts resolution limit of image stacks", true, stackRes, stackRes)); 
    200215    om.addBooleanOption("Warnings", WARN_IMAGEJ, 'i', 
    201216      "Toggles whether VisBio displays a warning about " + 
  • trunk/loci/visbio/view/DisplayWindow.java

    r394 r404  
    147147  public VisBioFrame getVisBio() { return manager.getVisBio(); } 
    148148 
     149  /** Gets associated display manager. */ 
     150  public DisplayManager getManager() { return manager; } 
     151 
    149152  /** Gets the associated VisAD display. */ 
    150153  public DisplayImpl getDisplay() { return display; } 
  • trunk/loci/visbio/view/StackHandler.java

    r373 r404  
    2828import loci.visbio.data.DataTransform; 
    2929import loci.visbio.data.ImageTransform; 
    30 import loci.visbio.state.SaveException; 
     30import loci.visbio.state.*; 
    3131import loci.visbio.util.XMLUtil; 
    3232import org.w3c.dom.Element; 
     
    6262  protected Vector positions; 
    6363 
    64   /** Resolution of stack images. */ 
    65   protected int stackRes; 
    66  
    6764 
    6865  // -- Constructor -- 
     
    7269    super(dw); 
    7370    positions = new Vector(); 
    74     stackRes = DEFAULT_STACK_RESOLUTION; 
    7571  } 
    76  
    77  
    78   // -- StackHandler API methods -- 
    79  
    80   /** Sets maximum resolution per axis of stacked images. */ 
    81   public void setStackResolution(int res) { stackRes = res; } 
    82  
    83   /** Gets maximum resolution per axis of stacked images. */ 
    84   public int getStackResolution() { return stackRes; } 
    8572 
    8673 
     
    127114  // -- Saveable API methods -- 
    128115 
    129   /** Writes the current state to the given DOM element ("Display"). */ 
    130   public void saveState(Element el) throws SaveException { 
    131     super.saveState(el); 
    132     Element child = XMLUtil.getFirstChild(el, "LinkedData"); 
    133  
    134     // save other parameters 
    135     child.setAttribute("stackRes", "" + stackRes); 
    136   } 
    137  
    138116  /** Restores the current state from the given DOM element ("Display"). */ 
    139117  public void restoreState(Element el) throws SaveException { 
     
    161139    fps = Integer.parseInt(child.getAttribute("FPS")); 
    162140    animAxis = Integer.parseInt(child.getAttribute("animationAxis")); 
    163     stackRes = Integer.parseInt(child.getAttribute("stackRes")); 
    164141  } 
    165142 
  • trunk/loci/visbio/view/StackLink.java

    r390 r404  
    466466    int[] res = new int[len.length]; 
    467467    boolean same = true; 
    468     int maxRes = ((StackHandler) handler).getStackResolution(); 
     468    int[] maxRes = handler.getWindow().getManager().getStackResolution(); 
    469469    for (int i=0; i<len.length; i++) { 
    470       if (len[i] > maxRes) { 
     470      if (len[i] > maxRes[i]) { 
    471471        same = false; 
    472         res[i] = maxRes; 
     472        res[i] = maxRes[i]; 
    473473      } 
    474474      else res[i] = len[i]; 
Note: See TracChangeset for help on using the changeset viewer.