Changeset 2548


Ignore:
Timestamp:
04/04/07 04:40:40 (13 years ago)
Author:
melissa
Message:

Add min/max values to MetadataStore once they have been computed.

File:
1 edited

Legend:

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

    r2538 r2548  
    3434  // -- Fields -- 
    3535 
    36   /** Minimum values for each channel. */ 
     36  /** Min values for each channel. */ 
    3737  protected double[][] chanMin; 
    3838 
    39   /** Maximum values for each channel. */ 
     39  /** Max values for each channel. */ 
    4040  protected double[][] chanMax; 
    4141 
    42   /** Minimum values for each plane. */ 
     42  /** Min values for each plane. */ 
    4343  protected double[][] planeMin; 
    4444 
    45   /** Maximum values for each plane. */ 
     45  /** Max values for each plane. */ 
    4646  protected double[][] planeMax; 
    4747 
     
    5151  // -- Constructors -- 
    5252 
    53   /** Constructs a MinMaxCalculator around a new image reader. */ 
    54   public MinMaxCalculator() { super(); } 
    55  
    56   /** Constructs a MinMaxCalculator with the given reader. */ 
    57   public MinMaxCalculator(IFormatReader r) { super(r); } 
    5853 
    5954  // -- IFormatReader API methods --  
     
    245240   
    246241    minMaxDone[getSeries(id)]++;  
     242   
     243    if (minMaxDone[getSeries(id)] == getImageCount(id)) { 
     244      MetadataStore store = getMetadataStore(id); 
     245      for (int c=0; c<getSizeC(id); c++) {  
     246        store.setChannelGlobalMinMax(c, new Double(chanMin[getSeries(id)][c]),  
     247          new Double(chanMax[getSeries(id)][c]), new Integer(getSeries(id))); 
     248      }  
     249    } 
    247250  } 
    248251   
     
    295298   
    296299    minMaxDone[getSeries(id)]++;  
     300   
     301    if (minMaxDone[getSeries(id)] == getImageCount(id)) { 
     302      MetadataStore store = getMetadataStore(id); 
     303      for (int c=0; c<getSizeC(id); c++) {  
     304        store.setChannelGlobalMinMax(c, new Double(chanMin[getSeries(id)][c]),  
     305          new Double(chanMax[getSeries(id)][c]), new Integer(getSeries(id))); 
     306      }  
     307    } 
    297308  } 
    298309 
Note: See TracChangeset for help on using the changeset viewer.