Changeset 1394


Ignore:
Timestamp:
08/31/06 12:01:34 (14 years ago)
Author:
melissa
Message:

added support for multi-series files to Data Browser

File:
1 edited

Legend:

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

    r1346 r1394  
    2525 
    2626import ij.*; 
     27import ij.gui.GenericDialog; 
    2728import ij.gui.ImageCanvas; 
    2829import ij.io.FileInfo; 
     
    7475  /** cache manager (if virtual stack is used). */ 
    7576  protected CacheManager manager; 
     77 
     78  /** Series to use in a multi-series file. */ 
     79  protected int series; 
    7680 
    7781  private ImageStack stack; 
     
    133137    for (int i=0; i<pos.length; i++) raster += offsets[i] * pos[i]; 
    134138    return raster; 
     139  } 
     140 
     141  /** Set the series to open. */ 
     142  public void setSeries(int num) { 
     143    // TODO : this isn't the prettiest way of prompting for a series 
     144    GenericDialog datasets = 
     145      new GenericDialog("4D Data Browser Series Chooser"); 
     146 
     147    String[] values = new String[num]; 
     148    for (int i=0; i<values.length; i++) values[i] = "" + i; 
     149 
     150    datasets.addChoice("Series ", values, "0"); 
     151 
     152    if (num > 1) datasets.showDialog(); 
     153 
     154    series = Integer.parseInt(datasets.getNextChoice()); 
    135155  } 
    136156 
     
    182202          FileStitcher fs = new FileStitcher(fr); 
    183203          ChannelMerger cm = new ChannelMerger(fs); 
     204          setSeries(cm.getSeriesCount(absname)); 
     205          cm.setSeries(absname, series); 
    184206 
    185207          int num = cm.getImageCount(absname); 
Note: See TracChangeset for help on using the changeset viewer.