Changeset 2003


Ignore:
Timestamp:
01/03/07 12:42:48 (13 years ago)
Author:
chris
Message:

Clean up getEffectiveSizeC implementations.

Location:
trunk/loci/formats
Files:
5 edited

Legend:

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

    r1903 r2003  
    5959  public boolean isRGB(String id) throws FormatException, IOException { 
    6060    return canMerge(id) || reader.isRGB(id); 
    61   } 
    62  
    63   /* @see IFormatReader#getEffectiveSizeC(String) */ 
    64   public int getEffectiveSizeC(String id) throws FormatException, IOException { 
    65     return isRGB(id) ? (getSizeC(id) + 2) / 3 : getSizeC(id); 
    6661  } 
    6762 
  • trunk/loci/formats/ChannelSeparator.java

    r1903 r2003  
    6767  public boolean isRGB(String id) { 
    6868    return false; 
    69   } 
    70  
    71   /* @see IFormatReader#getEffectiveSizeC(String) */ 
    72   public int getEffectiveSizeC(String id) throws FormatException, IOException { 
    73     return getSizeC(id); 
    7469  } 
    7570 
  • trunk/loci/formats/FileStitcher.java

    r1989 r2003  
    261261  /* @see IFormatReader#getEffectiveSizeC(String) */ 
    262262  public int getEffectiveSizeC(String id) throws FormatException, IOException { 
    263     if (!id.equals(currentId)) initFile(id); 
    264     return isRGB(id) ? 1 : getSizeC(id); 
     263    return FormatReader.getEffectiveSizeC(isRGB(id), getSizeC(id)); 
    265264  } 
    266265 
  • trunk/loci/formats/FormatReader.java

    r1988 r2003  
    174174    String prefix = "loci.formats.in."; 
    175175    if (name.startsWith(prefix)) name = name.substring(prefix.length()); 
    176     System.out.println(System.currentTimeMillis() + ": " + name + ": " + s); 
     176    String msg = System.currentTimeMillis() + ": " + name + ": " + s; 
     177    System.out.println(msg); 
    177178  } 
    178179 
     
    228229  /* @see IFormatReader#getEffectiveSizeC(String) */ 
    229230  public int getEffectiveSizeC(String id) throws FormatException, IOException { 
    230     if (!id.equals(currentId)) initFile(id); 
    231     return isRGB(id) ? (getSizeC(id) + 2) / 3 : getSizeC(id); 
     231    return getEffectiveSizeC(isRGB(id), getSizeC(id)); 
    232232  } 
    233233 
     
    630630      int sizeZ = reader.getSizeZ(id); 
    631631      int sizeC = reader.getSizeC(id); 
     632      int effSizeC = reader.getEffectiveSizeC(id); 
    632633      int sizeT = reader.getSizeT(id); 
    633634      int thumbSizeX = reader.getThumbSizeX(id); 
     
    649650      System.out.println("\tHeight = " + sizeY); 
    650651      System.out.println("\tSizeZ = " + sizeZ); 
    651       System.out.println("\tSizeC = " + sizeC); 
     652      System.out.println("\tSizeC = " + sizeC + 
     653        " (effectively " + effSizeC + ")"); 
    652654      System.out.println("\tSizeT = " + sizeT); 
    653655      if (imageCount != sizeZ * sizeC * sizeT / 
     
    949951 
    950952  /** 
     953   * Gets the effective size of the C dimension. 
     954   * @see IFormatReader#getEffectiveSizeC(String) 
     955   */ 
     956  public static int getEffectiveSizeC(boolean rgb, int sizeC) { 
     957    return rgb ? (sizeC + 2) / 3 : sizeC; 
     958  } 
     959 
     960  /** 
    951961   * Takes a string value and maps it to one of the pixel type enumerations. 
    952962   * @param pixelTypeAsString the pixel type as a string. 
  • trunk/loci/formats/IFormatReader.java

    r1988 r2003  
    6767 
    6868  /** 
    69    * Get the effective size of the C dimension.  If isRGB(String) returns 
    70    * true, this will return 1; otherwise, it returns the value of getSizeC. 
     69   * Gets the effective size of the C dimension, guaranteeing that 
     70   * getEffectiveSizeC(id) * getSizeZ(id) * getSizeT(id) == getImageCount(id) 
     71   * regardless of the result of isRGB(id). 
    7172   */ 
    7273  int getEffectiveSizeC(String id) throws FormatException, IOException; 
Note: See TracChangeset for help on using the changeset viewer.