Changeset 4121


Ignore:
Timestamp:
06/20/08 11:51:31 (11 years ago)
Author:
curtis
Message:

Chris's min/max store interface for use by OMERO.importer.

Location:
trunk/loci/formats
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/MinMaxCalculator.java

    r4048 r4121  
    2727import java.io.IOException; 
    2828import java.util.*; 
     29 
     30import loci.formats.meta.IMinMaxStore; 
    2931import loci.formats.meta.MetadataStore; 
    3032 
     
    5557  protected int[] minMaxDone; 
    5658 
     59  /** Consumer of channel global minima and maxima */ 
     60  protected IMinMaxStore minMaxStore; 
     61 
    5762  // -- Constructors -- 
    5863 
     
    6267  /** Constructs a MinMaxCalculator with the given reader. */ 
    6368  public MinMaxCalculator(IFormatReader r) { super(r); } 
     69 
     70  /** 
     71   * Sets the active min-max store for the calculator. Whenever a channel's 
     72   * global minimum and maximum calculation has been completed this store is 
     73   * notified. 
     74   * @param store See above. 
     75   */ 
     76  public void setMinMaxStore(IMinMaxStore store) { 
     77    minMaxStore = store; 
     78  } 
     79 
     80  /** 
     81   * Retrieves the current active min-max store for the calculator. 
     82   * @return See above. 
     83   */ 
     84  public IMinMaxStore getMinMaxStore() { 
     85    return minMaxStore; 
     86  } 
    6487 
    6588  // -- MinMaxCalculator API methods -- 
     
    306329 
    307330    if (minMaxDone[series] == getImageCount()) { 
    308       MetadataStore store = getMetadataStore(); 
    309331      for (int c=0; c<getSizeC(); c++) { 
    310         // CTR FIXME 
    311 //        store.setChannelGlobalMinMax(c, new Double(chanMin[series][c]), 
    312 //          new Double(chanMax[series][c]), new Integer(getSeries())); 
     332        minMaxStore.setChannelGlobalMinMax(c, chanMin[series][c], 
     333          chanMax[series][c], getSeries()); 
    313334      } 
    314335    } 
     
    387408      MetadataStore store = getMetadataStore(); 
    388409      for (int c=0; c<getSizeC(); c++) { 
    389         // CTR FIXME 
    390 //        store.setChannelGlobalMinMax(c, new Double(chanMin[getSeries()][c]), 
    391 //          new Double(chanMax[getSeries()][c]), new Integer(getSeries())); 
     410        minMaxStore.setChannelGlobalMinMax(c, chanMin[getSeries()][c], 
     411          chanMax[getSeries()][c], getSeries()); 
    392412      } 
    393413    } 
Note: See TracChangeset for help on using the changeset viewer.