Changeset 1981


Ignore:
Timestamp:
12/29/06 12:56:22 (13 years ago)
Author:
chris
Message:

Importer:
1) Changed to circumvent loading of ImagePlus if 4DBrowser
is selected. This way browser makes its own readers as is
usual. Kind of a workaround. Unfortunately many features
in importer are not supported currently in the browser.

Browser:
1) Found some wierd bug trying Curtis' fake.tif files
when they're been stitched together, browser does not
like this at all and the sliders don't seem to work and
the channels are not recognized. Very strange.

Location:
trunk/loci/plugins
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/plugins/Importer.java

    r1980 r1981  
    224224        if (mergeChannels) r = new ChannelMerger(fs); 
    225225        else r = new ChannelSeparator(fs); 
     226        IJ.showMessage("fs != null"); 
    226227      } 
    227228      else { 
  • trunk/loci/plugins/browser/CustomWindow.java

    r1980 r1981  
    8181  private JPanel channelPanel; 
    8282  private String patternTitle; 
    83   private boolean update; 
     83  protected boolean update; 
    8484 
    8585  // -- Constructor -- 
     
    371371  /** Adds 3rd and 4th dimension slice position. */ 
    372372  public void drawInfo(Graphics g) { 
    373     if (db == null) return; 
    374     int zVal = zSliceSel == null ? 1 : zSliceSel.getValue(); 
    375     int tVal = tSliceSel == null ? 1 : tSliceSel.getValue(); 
    376  
    377     int textGap = 0; 
    378  
    379     int nSlices = db.numZ * db.numT * db.numC; 
    380     int currentSlice = imp.getCurrentSlice(); 
    381     if (db.manager != null) currentSlice = db.manager.getSlice(); 
    382  
    383     StringBuffer sb = new StringBuffer(); 
    384     sb.append(currentSlice); 
    385     sb.append("/"); 
    386     sb.append(nSlices); 
    387     sb.append("; "); 
    388     if (db.hasZ) { 
    389       sb.append(zString); 
    390       sb.append(": "); 
    391       sb.append(zVal); 
     373    if(update) { 
     374      if (db == null) return; 
     375      int zVal = zSliceSel == null ? 1 : zSliceSel.getValue(); 
     376      int tVal = tSliceSel == null ? 1 : tSliceSel.getValue(); 
     377   
     378      int textGap = 0; 
     379   
     380      int nSlices = db.numZ * db.numT * db.numC; 
     381      int currentSlice = imp.getCurrentSlice(); 
     382      if (db.manager != null) currentSlice = db.manager.getSlice(); 
     383   
     384      StringBuffer sb = new StringBuffer(); 
     385      sb.append(currentSlice); 
    392386      sb.append("/"); 
    393       sb.append(db.numZ); 
     387      sb.append(nSlices); 
    394388      sb.append("; "); 
    395     } 
    396     if (db.hasT) { 
    397       sb.append(tString); 
    398       sb.append(": "); 
    399       sb.append(tVal); 
    400       sb.append("/"); 
    401       sb.append(db.numT); 
     389      if (db.hasZ) { 
     390        sb.append(zString); 
     391        sb.append(": "); 
     392        sb.append(zVal); 
     393        sb.append("/"); 
     394        sb.append(db.numZ); 
     395        sb.append("; "); 
     396      } 
     397      if (db.hasT) { 
     398        sb.append(tString); 
     399        sb.append(": "); 
     400        sb.append(tVal); 
     401        sb.append("/"); 
     402        sb.append(db.numT); 
     403        sb.append("; "); 
     404      } 
     405      if (db.names != null) { 
     406        String name = db.names[currentSlice - 1]; 
     407        if (name != null) { 
     408          sb.append(name); 
     409          sb.append("; "); 
     410        } 
     411      } 
     412   
     413      int width = imp.getWidth(), height = imp.getHeight(); 
     414      Calibration cal = imp.getCalibration(); 
     415      if (cal.pixelWidth != 1.0 || cal.pixelHeight != 1.0) { 
     416        sb.append(IJ.d2s(width * cal.pixelWidth, 2)); 
     417        sb.append("x"); 
     418        sb.append(IJ.d2s(height * cal.pixelHeight, 2)); 
     419        sb.append(" "); 
     420        sb.append(cal.getUnits()); 
     421        sb.append(" ("); 
     422        sb.append(width); 
     423        sb.append("x"); 
     424        sb.append(height); 
     425        sb.append("); "); 
     426      } 
     427      else { 
     428        sb.append(width); 
     429        sb.append("x"); 
     430        sb.append(height); 
     431        sb.append(" pixels; "); 
     432      } 
     433      int type = imp.getType(); 
     434      int stackSize = imp.getStackSize(); 
     435      if (db.manager != null) stackSize = db.manager.getSize(); 
     436      int size = (width * height * stackSize) / 1048576; 
     437      switch (type) { 
     438        case ImagePlus.GRAY8: 
     439          sb.append("8-bit grayscale"); 
     440          break; 
     441        case ImagePlus.GRAY16: 
     442          sb.append("16-bit grayscale"); 
     443          size *= 2; 
     444          break; 
     445        case ImagePlus.GRAY32: 
     446          sb.append("32-bit grayscale"); 
     447          size *= 4; 
     448          break; 
     449        case ImagePlus.COLOR_256: 
     450          sb.append("8-bit color"); 
     451          break; 
     452        case ImagePlus.COLOR_RGB: 
     453          sb.append("RGB"); 
     454          size *= 4; 
     455          break; 
     456      } 
    402457      sb.append("; "); 
    403     } 
    404     if (db.names != null) { 
    405       String name = db.names[currentSlice - 1]; 
    406       if (name != null) { 
    407         sb.append(name); 
    408         sb.append("; "); 
    409       } 
    410     } 
    411  
    412     int width = imp.getWidth(), height = imp.getHeight(); 
    413     Calibration cal = imp.getCalibration(); 
    414     if (cal.pixelWidth != 1.0 || cal.pixelHeight != 1.0) { 
    415       sb.append(IJ.d2s(width * cal.pixelWidth, 2)); 
    416       sb.append("x"); 
    417       sb.append(IJ.d2s(height * cal.pixelHeight, 2)); 
    418       sb.append(" "); 
    419       sb.append(cal.getUnits()); 
    420       sb.append(" ("); 
    421       sb.append(width); 
    422       sb.append("x"); 
    423       sb.append(height); 
    424       sb.append("); "); 
    425     } 
    426     else { 
    427       sb.append(width); 
    428       sb.append("x"); 
    429       sb.append(height); 
    430       sb.append(" pixels; "); 
    431     } 
    432     int type = imp.getType(); 
    433     int stackSize = imp.getStackSize(); 
    434     if (db.manager != null) stackSize = db.manager.getSize(); 
    435     int size = (width * height * stackSize) / 1048576; 
    436     switch (type) { 
    437       case ImagePlus.GRAY8: 
    438         sb.append("8-bit grayscale"); 
    439         break; 
    440       case ImagePlus.GRAY16: 
    441         sb.append("16-bit grayscale"); 
    442         size *= 2; 
    443         break; 
    444       case ImagePlus.GRAY32: 
    445         sb.append("32-bit grayscale"); 
    446         size *= 4; 
    447         break; 
    448       case ImagePlus.COLOR_256: 
    449         sb.append("8-bit color"); 
    450         break; 
    451       case ImagePlus.COLOR_RGB: 
    452         sb.append("RGB"); 
    453         size *= 4; 
    454         break; 
    455     } 
    456     sb.append("; "); 
    457     sb.append(size); 
    458     sb.append("M"); 
    459  
    460     Insets insets = super.getInsets(); 
    461     g.drawString(sb.toString(), 5, insets.top + textGap); 
     458      sb.append(size); 
     459      sb.append("M"); 
     460   
     461      Insets insets = super.getInsets(); 
     462      g.drawString(sb.toString(), 5, insets.top + textGap); 
     463    } 
    462464  } 
    463465 
  • trunk/loci/plugins/browser/LociDataBrowser.java

    r1980 r1981  
    100100    this(); 
    101101    id = name; 
     102    virtual = true; 
    102103  } 
    103104   
  • trunk/loci/plugins/browser/OptionsWindow.java

    r1980 r1981  
    773773      } 
    774774      else if (getBoxIndex((JComboBox)source) >= 0) { 
     775        cw.update = false; 
    775776        int index = getBoxIndex((JComboBox)source); 
    776777        axes[index] = getAxis(blockBoxes[index].getSelectedIndex()); 
     
    785786        if(cw.db.virtual) cw.db.manager.dimChange(); 
    786787        cw.updateControls(); 
     788        cw.update = true; 
    787789      } 
    788790    } 
Note: See TracChangeset for help on using the changeset viewer.