Changeset 1225


Ignore:
Timestamp:
08/04/06 08:28:47 (14 years ago)
Author:
melissa
Message:

TIFF-variant readers now override setSeparated(boolean)

Location:
trunk/loci/formats/in
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/in/AndorReader.java

    r1195 r1225  
    9999    // Andor and regular TIFF; open the file and check more thoroughly 
    100100    return checkBytes(name, BLOCK_CHECK_LEN); 
     101  } 
     102 
     103  /** 
     104   * Allows the client to specify whether or not to separate channels. 
     105   * By default, channels are left unseparated; thus if we encounter an RGB 
     106   * image plane, it will be left as RGB and not split into 3 separate planes. 
     107   */ 
     108  public void setSeparated(boolean separate) { 
     109    separated = separate; 
     110    super.setSeparated(separate); 
    101111  } 
    102112 
  • trunk/loci/formats/in/FluoviewReader.java

    r1200 r1225  
    9494    // Fluoview and regular TIFF; open the file and check more thoroughly 
    9595    return checkBytes(name, BLOCK_CHECK_LEN); 
     96  } 
     97 
     98  /** 
     99   * Allows the client to specify whether or not to separate channels. 
     100   * By default, channels are left unseparated; thus if we encounter an RGB 
     101   * image plane, it will be left as RGB and not split into 3 separate planes. 
     102   */ 
     103  public void setSeparated(boolean separate) { 
     104    separated = separate; 
     105    super.setSeparated(separate); 
    96106  } 
    97107 
  • trunk/loci/formats/in/GelReader.java

    r1200 r1225  
    6161  public boolean isThisType(byte[] block) { return false; } 
    6262 
     63  /** 
     64   * Allows the client to specify whether or not to separate channels. 
     65   * By default, channels are left unseparated; thus if we encounter an RGB 
     66   * image plane, it will be left as RGB and not split into 3 separate planes. 
     67   */ 
     68  public void setSeparated(boolean separate) { 
     69    separated = separate; 
     70    super.setSeparated(separate); 
     71  } 
     72 
    6373  /** Get the size of the T dimension. */ 
    6474  public int getSizeT(String id) throws FormatException, IOException { 
  • trunk/loci/formats/in/IPWReader.java

    r1198 r1225  
    8989    return (block[0] == 0xd0 && block[1] == 0xcf && 
    9090      block[2] == 0x11 && block[3] == 0xe0); 
     91  } 
     92 
     93  /** 
     94   * Allows the client to specify whether or not to separate channels. 
     95   * By default, channels are left unseparated; thus if we encounter an RGB 
     96   * image plane, it will be left as RGB and not split into 3 separate planes. 
     97   */ 
     98  public void setSeparated(boolean separate) { 
     99    separated = separate; 
     100    super.setSeparated(separate); 
    91101  } 
    92102 
  • trunk/loci/formats/in/LeicaReader.java

    r1202 r1225  
    125125  } 
    126126 
     127  /** 
     128   * Allows the client to specify whether or not to separate channels. 
     129   * By default, channels are left unseparated; thus if we encounter an RGB 
     130   * image plane, it will be left as RGB and not split into 3 separate planes. 
     131   */ 
     132  public void setSeparated(boolean separate) { 
     133    separated = separate; 
     134    if (tiff != null) tiff.setSeparated(separate); 
     135    super.setSeparated(separate); 
     136  } 
     137 
    127138  /** Checks if the images in the file are RGB. */ 
    128139  public boolean isRGB(String id) throws FormatException, IOException { 
     
    193204      initFile(id); 
    194205    } 
    195     return tiff.openBytes(files[no], no); 
     206 
     207    if (no < 0 || no >= getImageCount(id)) { 
     208      throw new FormatException("Invalid image number: " + no); 
     209    } 
     210    if (isRGB(id) && separated) { 
     211      return tiff.openBytes(files[no / 3], no % 3); 
     212    } 
     213    return tiff.openBytes(files[no], 0); 
    196214  } 
    197215 
     
    208226    } 
    209227 
     228    if (isRGB(id) && separated) { 
     229      return tiff.openImage(files[no / 3], no % 3); 
     230    } 
    210231    return tiff.openImage(files[no], 0); 
    211232  } 
  • trunk/loci/formats/in/MetamorphReader.java

    r1200 r1225  
    9494      return false; // we went through the IFD; the ID wasn't found. 
    9595    } 
     96  } 
     97 
     98  /** 
     99   * Allows the client to specify whether or not to separate channels. 
     100   * By default, channels are left unseparated; thus if we encounter an RGB 
     101   * image plane, it will be left as RGB and not split into 3 separate planes. 
     102   */ 
     103  public void setSeparated(boolean separate) { 
     104    separated = separate; 
     105    super.setSeparated(separate); 
    96106  } 
    97107 
  • trunk/loci/formats/in/NikonReader.java

    r1219 r1225  
    169169  } 
    170170 
     171  /** 
     172   * Allows the client to specify whether or not to separate channels. 
     173   * By default, channels are left unseparated; thus if we encounter an RGB 
     174   * image plane, it will be left as RGB and not split into 3 separate planes. 
     175   */ 
     176  public void setSeparated(boolean separate) { 
     177    separated = separate; 
     178    super.setSeparated(separate); 
     179  } 
    171180 
    172181  // -- Internal BaseTiffReader API methods -- 
  • trunk/loci/formats/in/SEQReader.java

    r1200 r1225  
    6060 
    6161  // -- FormatReader API methods -- 
     62 
     63  /** 
     64   * Allows the client to specify whether or not to separate channels. 
     65   * By default, channels are left unseparated; thus if we encounter an RGB 
     66   * image plane, it will be left as RGB and not split into 3 separate planes. 
     67   */ 
     68  public void setSeparated(boolean separate) { 
     69    separated = separate; 
     70    super.setSeparated(separate); 
     71  } 
    6272 
    6373  /** Get the size of the Z dimension. */ 
  • trunk/loci/formats/in/TiffReader.java

    r1198 r1225  
    4949 
    5050  // -- FormatReader API methods -- 
     51 
     52  /** 
     53   * Allows the client to specify whether or not to separate channels. 
     54   * By default, channels are left unseparated; thus if we encounter an RGB 
     55   * image plane, it will be left as RGB and not split into 3 separate planes. 
     56   */ 
     57  public void setSeparated(boolean separate) { 
     58    separated = separate; 
     59    super.setSeparated(separate); 
     60  } 
    5161 
    5262  /** Get the size of the Z dimension. */ 
     
    107117      xmlStore.createRoot(comment); 
    108118    } 
     119    else super.initMetadataStore(); 
    109120  } 
    110121 
  • trunk/loci/formats/in/ZeissLSMReader.java

    r1200 r1225  
    9191  } 
    9292 
     93  /** 
     94   * Allows the client to specify whether or not to separate channels. 
     95   * By default, channels are left unseparated; thus if we encounter an RGB 
     96   * image plane, it will be left as RGB and not split into 3 separate planes. 
     97   */ 
     98  public void setSeparated(boolean separate) { 
     99    separated = separate; 
     100    super.setSeparated(separate); 
     101  } 
     102 
    93103  /** Get the size of the Z dimension. */ 
    94104  public int getSizeZ(String id) throws FormatException, IOException { 
Note: See TracChangeset for help on using the changeset viewer.