Changeset 7238 for trunk


Ignore:
Timestamp:
11/23/10 17:37:22 (10 years ago)
Author:
melissa
Message:
  • Added macro functions for retrieving physical size and version information.
  • Fixed FileStitcher.setGroupFiles(boolean) so that it actually controls whether or not files are stitched.
Location:
trunk/components
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/FileStitcher.java

    r7127 r7238  
    8080 
    8181  private boolean noStitch; 
     82  private boolean group = true; 
    8283 
    8384  private MetadataStore store; 
     
    506507  /* @see IFormatReader#setGroupFiles(boolean) */ 
    507508  public void setGroupFiles(boolean group) { 
    508     reader.setGroupFiles(group); 
    509     if (externals != null) { 
    510       for (ExternalSeries s : externals) { 
    511         for (DimensionSwapper r : s.getReaders()) { 
    512           r.setGroupFiles(group); 
    513         } 
    514       } 
    515     } 
     509    this.group = group; 
     510  } 
     511 
     512  /* @see IFormatReader#isGroupFiles(boolean) */ 
     513  public boolean isGroupFiles() { 
     514    return group; 
    516515  } 
    517516 
     
    721720    } 
    722721 
    723     if (mustGroup) { 
     722    if (mustGroup || !group) { 
    724723      // reader subclass is handling file grouping 
    725724      noStitch = true; 
  • trunk/components/loci-plugins/src/loci/plugins/macro/LociFunctions.java

    r6881 r7238  
    8787  } 
    8888 
     89  // -- LociFunctions API methods - version numbers -- 
     90 
     91  public void getRevision(String[] revision) { 
     92    revision[0] = FormatTools.SVN_REVISION; 
     93  } 
     94 
     95  public void getBuildDate(String[] date) { 
     96    date[0] = FormatTools.DATE; 
     97  } 
     98 
     99  public void getVersionNumber(String[] version) { 
     100    version[0] = FormatTools.VERSION; 
     101  } 
     102 
    89103  // -- LociFunctions API methods - loci.formats.IFormatReader -- 
    90104 
     
    183197      x.intValue(), y.intValue(), w.intValue(), h.intValue()); 
    184198    final ImagePlus imp = ImagePlusReader.createImage(title, Arrays.asList(ip)); 
    185     imp.show();     
     199    imp.show(); 
    186200  } 
    187201 
     
    350364    exposureTime[0] = val == null ? new Double(Double.NaN) : val; 
    351365  } 
     366 
     367  public void getPixelsPhysicalSizeX(Double[] sizeX) { 
     368    int imageIndex = r.getSeries(); 
     369    MetadataRetrieve retrieve = (MetadataRetrieve) r.getMetadataStore(); 
     370    sizeX[0] = retrieve.getPixelsPhysicalSizeX(imageIndex); 
     371    if (sizeX[0] == null) sizeX[0] = new Double(Double.NaN); 
     372  } 
     373 
     374  public void getPixelsPhysicalSizeY(Double[] sizeY) { 
     375    int imageIndex = r.getSeries(); 
     376    MetadataRetrieve retrieve = (MetadataRetrieve) r.getMetadataStore(); 
     377    sizeY[0] = retrieve.getPixelsPhysicalSizeY(imageIndex); 
     378    if (sizeY[0] == null) sizeY[0] = new Double(Double.NaN); 
     379  } 
     380 
     381  public void getPixelsPhysicalSizeZ(Double[] sizeZ) { 
     382    int imageIndex = r.getSeries(); 
     383    MetadataRetrieve retrieve = (MetadataRetrieve) r.getMetadataStore(); 
     384    sizeZ[0] = retrieve.getPixelsPhysicalSizeZ(imageIndex); 
     385    if (sizeZ[0] == null) sizeZ[0] = new Double(Double.NaN); 
     386  } 
     387 
     388  public void getPixelsTimeIncrement(Double[] sizeT) { 
     389    int imageIndex = r.getSeries(); 
     390    MetadataRetrieve retrieve = (MetadataRetrieve) r.getMetadataStore(); 
     391    sizeT[0] = retrieve.getPixelsTimeIncrement(imageIndex); 
     392    if (sizeT[0] == null) sizeT[0] = new Double(Double.NaN); 
     393  } 
     394 
    352395 
    353396  // -- PlugIn API methods -- 
     
    393436      IJ.log("-- for the current dataset. Possible values are:"); 
    394437      IJ.log("--   must, can, cannot, unknown"); 
     438      IJ.log("Ext.getVersionNumber(version)"); 
     439      IJ.log("-- Returns the version number of the currently installed"); 
     440      IJ.log("-- version of Bio-Formats."); 
     441      IJ.log("Ext.getRevision(revision)"); 
     442      IJ.log("-- Returns the SVN revision number of the currently"); 
     443      IJ.log("-- installed version of Bio-Formats."); 
     444      IJ.log("Ext.getBuildDate(date)"); 
     445      IJ.log("-- Returns the build date of the currently installed"); 
     446      IJ.log("-- version of Bio-Formats."); 
    395447      IJ.log(""); 
    396448      IJ.log("-= Usable before initializing a file =-"); 
     
    525577      IJ.log("-- Obtains the exposure time (in seconds) for the no'th"); 
    526578      IJ.log("-- plane, or NaN if none."); 
     579      IJ.log("Ext.getPixelsPhysicalSizeX(sizeX)"); 
     580      IJ.log("-- Obtains the width of a pixel in microns, or NaN if the"); 
     581      IJ.log("-- the width is not stored in the original file."); 
     582      IJ.log("Ext.getPixelsPhysicalSizeY(sizeY)"); 
     583      IJ.log("-- Obtains the height of a pixel in microns, or NaN if the"); 
     584      IJ.log("-- the height is not stored in the original file."); 
     585      IJ.log("Ext.getPixelsPhysicalSizeZ(sizeZ)"); 
     586      IJ.log("-- Obtains the spacing between Z sections in microns, or NaN"); 
     587      IJ.log("-- if the spacing is not stored in the original file."); 
     588      IJ.log("Ext.getPixelsTimeIncrement(sizeT)"); 
     589      IJ.log("-- Obtains the spacing between time points in seconds, or"); 
     590      IJ.log("-- NaN if the spacing is not stored in the original file."); 
    527591      IJ.log(""); 
    528592      IJ.log("For more information, see the online Javadocs"); 
Note: See TracChangeset for help on using the changeset viewer.