Changeset 2424


Ignore:
Timestamp:
03/12/07 09:49:19 (13 years ago)
Author:
melissa
Message:

Various bugfixes - can now choose not to cache images.

Location:
trunk/loci/plugins/browser
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/plugins/browser/CacheManager.java

    r2026 r2424  
    19191919    Arrays.sort(tL); 
    19201920 
    1921     zInd.setIndicator(zC, zL, sizeZ); 
    1922     tInd.setIndicator(tC, tL, sizeT); 
     1921    if (zInd != null) zInd.setIndicator(zC, zL, sizeZ); 
     1922    if (tInd != null) tInd.setIndicator(tC, tL, sizeT); 
    19231923  } 
    19241924 
  • trunk/loci/plugins/browser/CustomWindow.java

    r2327 r2424  
    9797    FilePattern fp = null; 
    9898 
    99     if(db.fStitch != null) { 
     99    if (db.fStitch != null) { 
    100100      try { 
    101101        fp = db.fStitch.getFilePattern(id); 
     
    122122      } 
    123123    }; 
    124  
    125 //    imagePane.setLayout(getLayout()); // ImageLayout 
    126 //    imagePane.setBackground(Color.white); 
    127124 
    128125    // redo layout for master window 
     
    221218    tPanel.add(tSliceSel,BorderLayout.CENTER); 
    222219 
    223     if(db.virtual) { 
     220    if (db.virtual) { 
    224221      zIndicator = new CacheIndicator(zSliceSel); 
    225222      tIndicator = new CacheIndicator(tSliceSel); 
     
    632629  public void windowClosed(WindowEvent e) { 
    633630    if (animationTimer != null) animationTimer.stop(); 
    634     db.manager.finish(); 
     631    if (db.manager != null) db.manager.finish(); 
    635632    super.windowClosed(e); 
    636633  } 
  • trunk/loci/plugins/browser/ImagePlusWrapper.java

    r2327 r2424  
    6363 
    6464      try { 
     65        if (stitch && fs == null) fs = new FileStitcher(r);  
     66         
    6567        numTotal = fs.getImageCount(name); 
    6668 
     
    7173        sizeT = fs.getSizeT(name); 
    7274        sizeC = fs.getSizeC(name); 
     75         
    7376        if (LociDataBrowser.DEBUG) { 
    7477          System.err.println("numTotal = "+numTotal); 
     
    8083      } 
    8184 
    82       int num = r.getImageCount(name); 
     85      int num = fs.getImageCount(name); 
    8386      ImageStack stackB = null, stackS = null, 
    8487        stackF = null, stackO = null; 
    8588      long start = System.currentTimeMillis(); 
    8689      long time = start; 
     90      
    8791      for (int i=0; i<num; i++) { 
    8892        long clock = System.currentTimeMillis(); 
     
    9296        } 
    9397        IJ.showProgress((double) i/num); 
    94         BufferedImage img = r.openImage(name, i); 
     98        BufferedImage img = fs.openImage(name, i); 
    9599 
    96100        // scale image if it is the wrong size 
     
    108112        int c = raster.getNumBands(); 
    109113        int tt = raster.getTransferType(); 
     114         
    110115        if (c == 1) { 
    111116          if (tt == DataBuffer.TYPE_BYTE) { 
  • trunk/loci/plugins/browser/LociDataBrowser.java

    r2327 r2424  
    124124 
    125125  /** 
    126   * Displays the given ImageJ image in a 4D browser window. 
    127   * NB: this method is needed only internally. Do not call. 
    128   */ 
     126   * Displays the given ImageJ image in a 4D browser window. 
     127   */ 
    129128  private void show(ImagePlus imp) { 
    130129    int stackSize = imp == null ? 0 : imp.getStackSize(); 
     
    140139      return; 
    141140    } 
    142     if(cw != null) { 
     141    if (cw != null) { 
    143142      cw.ow.dispose(); 
    144143      cw.ow = null; 
     
    244243 
    245244  public void toggleCache(boolean cached) { 
    246     if(cached) { 
    247       if(!virtual) { 
    248         virtual = true; 
    249         run(""); 
    250       } 
    251     } 
    252     else { 
    253       if(virtual) { 
    254         virtual = false; 
    255         run(""); 
    256       } 
     245    if (cached != virtual) { 
     246      virtual = !virtual; 
     247      run(""); 
    257248    } 
    258249  } 
     
    260251  public void toggleMerge() {     
    261252    if (reader instanceof ChannelMerger) { 
    262       IFormatReader parent = ((ReaderWrapper)reader).getReader(); 
     253      IFormatReader parent = ((ReaderWrapper) reader).getReader(); 
    263254      reader = new ChannelSeparator(parent); 
    264255      run(""); 
    265256    } 
    266     else if(reader instanceof ChannelSeparator) { 
    267       IFormatReader parent = ((ReaderWrapper)reader).getReader(); 
     257    else if (reader instanceof ChannelSeparator) { 
     258      IFormatReader parent = ((ReaderWrapper) reader).getReader(); 
    268259      reader = new ChannelMerger(parent); 
    269260      run(""); 
    270261    } 
    271     else throw new RuntimeException("Unsuported reader class: " + reader.getClass().getName()); 
     262    else { 
     263      throw new RuntimeException("Unsupported reader class: " +  
     264        reader.getClass().getName()); 
     265    }  
    272266  } 
    273267   
    274268  public boolean isMerged() { 
    275     if (reader instanceof ChannelMerger) return true; 
    276     else return false; 
     269    return reader instanceof ChannelMerger; 
    277270  } 
    278271 
     
    359352        } 
    360353        else { 
     354          manager = null;  
    361355          ipw = new ImagePlusWrapper(id, reader, fStitch, true); 
    362356          setDimensions(); 
  • trunk/loci/plugins/browser/OptionsWindow.java

    r2026 r2424  
    909909 
    910910      int finalState = (zState | tState | cState); 
    911       manager.setAxis(finalState); 
     911      if (manager != null) manager.setAxis(finalState); 
    912912    } 
    913913  } 
Note: See TracChangeset for help on using the changeset viewer.