Changeset 1976


Ignore:
Timestamp:
12/28/06 11:03:54 (13 years ago)
Author:
chris
Message:

Importer:
1) Should now use updated constructer to show in 4DBrowser
when chosen to do so. Defaults to virtual CacheManager

Browser:
1) New constructor added to be compatible with Importer.
2) Run method brought up to date so that another FileOpener
window isn't called when the second constructor is used.

Location:
trunk/loci/plugins
Files:
2 edited

Legend:

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

    r1971 r1976  
    4141import loci.formats.*; 
    4242import loci.formats.in.ImageJReader; 
     43import loci.plugins.browser.LociDataBrowser; 
    4344 
    4445/** 
     
    867868      if (stackFormat.equals(VIEW_STANDARD)) imp.show(); 
    868869      else if (stackFormat.equals(VIEW_BROWSER)) { 
     870        LociDataBrowser ldb = new LociDataBrowser(r,id); 
    869871      } 
    870872      else if (stackFormat.equals(VIEW_IMAGE_5D)) { 
  • trunk/loci/plugins/browser/LociDataBrowser.java

    r1899 r1976  
    9393    reader = new ChannelSeparator(fStitch); 
    9494  } 
     95   
     96  public LociDataBrowser(IFormatReader r, String name) { 
     97    virtual = true; 
     98    reader = r; 
     99    if (r instanceof FileStitcher) fStitch = (FileStitcher) r; 
     100    else fStitch = new FileStitcher(r); 
     101    id = name; 
     102    run(""); 
     103  } 
    95104 
    96105  // -- LociDataBrowser API methods -- 
    97106 
    98   /** Displays the given ImageJ image in a 4D browser window. */ 
    99   public void show(ImagePlus imp) { 
     107  /**  
     108  * Displays the given ImageJ image in a 4D browser window. 
     109  * NB: this method is needed only internally. Do not call. 
     110  */ 
     111  private void show(ImagePlus imp) { 
    100112    int stackSize = imp == null ? 0 : imp.getStackSize(); 
    101113 
     
    142154    try { 
    143155      numZ = fStitch.getSizeZ(id); 
    144       numC = fStitch.getSizeC(id); 
     156      numC = fStitch.getEffectiveSizeC(id); 
    145157      numT = fStitch.getSizeT(id); 
    146158      order = fStitch.getDimensionOrder(id); 
     
    203215    while (!done2) { 
    204216      try { 
    205         lociOpener.show(); 
    206         directory = lociOpener.getDirectory(); 
    207         name = lociOpener.getAbsolutePath(); 
    208         virtual = lociOpener.getVirtual(); 
    209         if (name == null || lociOpener.isCanceled()) return; 
    210         if (DEBUG) { 
    211           IJ.log("directory = " + directory); 
    212           IJ.log("name = " + name); 
    213           IJ.log("virtual = " + virtual); 
     217        if(id == null) { 
     218          lociOpener.show(); 
     219          directory = lociOpener.getDirectory(); 
     220          name = lociOpener.getAbsolutePath(); 
     221          virtual = lociOpener.getVirtual(); 
     222          if (name == null || lociOpener.isCanceled()) return; 
     223          if (DEBUG) { 
     224            IJ.log("directory = " + directory); 
     225            IJ.log("name = " + name); 
     226            IJ.log("virtual = " + virtual); 
     227          } 
     228         
     229          id = name; 
     230          if (DEBUG) System.err.println("id = " + id); 
    214231        } 
     232 
    215233        ImagePlusWrapper ipw = null; 
    216234 
    217235        // process input 
    218236        lengths = new int[3]; 
    219  
    220         id = name; 
    221         if (DEBUG) System.err.println("id = " + id); 
    222237 
    223238        if (virtual) { 
Note: See TracChangeset for help on using the changeset viewer.