Changeset 2418


Ignore:
Timestamp:
03/08/07 11:15:15 (13 years ago)
Author:
curtis
Message:

Whitespace.

Location:
trunk/loci/formats
Files:
35 edited

Legend:

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

    r2416 r2418  
    271271  /* @see IFormatReader#getEffectiveSizeC(String) */ 
    272272  public int getEffectiveSizeC(String id) throws FormatException, IOException { 
    273     return getImageCount(id) / (getSizeZ(id) * getSizeT(id));  
     273    return getImageCount(id) / (getSizeZ(id) * getSizeT(id)); 
    274274  } 
    275275 
    276276  /* @see IFormatReader#getRGBChannelCount(String) */ 
    277277  public int getRGBChannelCount(String id) throws FormatException, IOException { 
    278     return getSizeC(id) / getEffectiveSizeC(id);  
     278    return getSizeC(id) / getEffectiveSizeC(id); 
    279279  } 
    280280 
     
    481481    int sno = getSeries(id); 
    482482    if (blankThumb[sno] == null) { 
    483       blankThumb[sno] = ImageTools.blankImage(getThumbSizeX(id),  
     483      blankThumb[sno] = ImageTools.blankImage(getThumbSizeX(id), 
    484484        getThumbSizeY(id), sizeC[sno], FormatReader.UINT8); 
    485485    } 
    486     return blankThumb[sno];  
     486    return blankThumb[sno]; 
    487487  } 
    488488 
     
    496496      return readers[fno].openThumbBytes(files[fno], ino); 
    497497    } 
    498     // return a blank image to cover for the fact that  
     498    // return a blank image to cover for the fact that 
    499499    // this file does not contain enough image planes 
    500500    int sno = getSeries(id); 
     
    559559 
    560560  /* @see IFormatReader#isColorTableIgnored() */ 
    561   public boolean isColorTableIgnored() {  
    562     return reader.isColorTableIgnored();  
     561  public boolean isColorTableIgnored() { 
     562    return reader.isColorTableIgnored(); 
    563563  } 
    564564 
    565565  /* @see IFormatReader#setNormalized(boolean) */ 
    566566  public void setNormalized(boolean normalize) { 
    567     if (readers != null) {  
     567    if (readers != null) { 
    568568      for (int i=0; i<readers.length; i++) { 
    569569        readers[i].setNormalized(normalize); 
     
    779779        readers[i] = (IFormatReader) r; 
    780780        readers[i].setChannelStatCalculationStatus( 
    781           reader.getChannelStatCalculationStatus());  
     781          reader.getChannelStatCalculationStatus()); 
    782782        readers[i].setColorTableIgnored(reader.isColorTableIgnored()); 
    783783        readers[i].setNormalized(reader.isNormalized()); 
  • trunk/loci/formats/FormatReader.java

    r2414 r2418  
    439439  /* @see IFormatReader#setChannelStatCalculationStatus(boolean) */ 
    440440  public void setChannelStatCalculationStatus(boolean on) { 
    441     if (currentId != null) {  
     441    if (currentId != null) { 
    442442      System.err.println( 
    443         "Warning: setChannelStatCalculation called with open file.");  
     443        "Warning: setChannelStatCalculation called with open file."); 
    444444    } 
    445445    enableChannelStatCalculation = on; 
     
    518518  /* @see IFormatReader#setColorTableIgnored(boolean) */ 
    519519  public void setColorTableIgnored(boolean ignore) { 
    520     if (currentId != null) {  
     520    if (currentId != null) { 
    521521      System.err.println( 
    522522        "Warning: setColorTableIgnored called with open file."); 
     
    534534  /* @see IFormatReader#setNormalized(boolean) */ 
    535535  public void setNormalized(boolean normalize) { 
    536     if (currentId != null) {  
    537       System.err.println("Warning: setNormalized called with open file.");  
     536    if (currentId != null) { 
     537      System.err.println("Warning: setNormalized called with open file."); 
    538538    } 
    539539    normalizeData = normalize; 
     
    621621  /* @see IFormatReader#setMetadataFiltered(boolean) */ 
    622622  public void setMetadataFiltered(boolean filter) { 
    623     if (currentId != null) {  
    624       System.err.println("Warning: setMetadataFiltered called with open file.");  
     623    if (currentId != null) { 
     624      System.err.println("Warning: setMetadataFiltered called with open file."); 
    625625    } 
    626626    filterMetadata = filter; 
     
    634634  /* @see IFormatReader#setMetadataStore(MetadataStore) */ 
    635635  public void setMetadataStore(MetadataStore store) { 
    636     if (currentId != null) {  
    637       System.err.println("Warning: setMetadataStore called with open file.");  
     636    if (currentId != null) { 
     637      System.err.println("Warning: setMetadataStore called with open file."); 
    638638    } 
    639639    metadataStore = store; 
     
    10171017 
    10181018      if (ms.getClass().getName().equals( 
    1019         "loci.formats.ome.OMEXMLMetadataStore"))  
     1019        "loci.formats.ome.OMEXMLMetadataStore")) 
    10201020      { 
    10211021        try { 
     
    11851185 
    11861186  /** Returns true if the given file name is in the used files list. */ 
    1187   public boolean isUsedFile(String id, String file)  
     1187  public boolean isUsedFile(String id, String file) 
    11881188    throws FormatException, IOException 
    11891189  { 
    11901190    String[] usedFiles = getUsedFiles(id); 
    11911191    for (int i=0; i<usedFiles.length; i++) { 
    1192       if (usedFiles[i].equals(file) ||  
    1193         usedFiles[i].equals(new Location(file).getAbsolutePath()))  
    1194       {   
     1192      if (usedFiles[i].equals(file) || 
     1193        usedFiles[i].equals(new Location(file).getAbsolutePath())) 
     1194      { 
    11951195        return true; 
    11961196      } 
    11971197    } 
    1198     return false;  
     1198    return false; 
    11991199  } 
    12001200 
  • trunk/loci/formats/TiffTools.java

    r2414 r2418  
    818818      samplesPerPixel = 3; 
    819819    } 
    820     int bpp = getBitsPerSample(ifd)[0] / 8;  
     820    int bpp = getBitsPerSample(ifd)[0] / 8; 
    821821    long width = getImageWidth(ifd); 
    822822    long length = getImageLength(ifd); 
    823823    byte[] b = new byte[(int) (width * length * samplesPerPixel * bpp)]; 
    824      
     824 
    825825    getSamples(ifd, in, ignore, b); 
    826826    byte[][] samples = new byte[samplesPerPixel][(int) (width * length * bpp)]; 
    827827    for (int i=0; i<samplesPerPixel; i++) { 
    828       System.arraycopy(b, (int) (i*width*length*bpp), samples[i], 0,  
     828      System.arraycopy(b, (int) (i*width*length*bpp), samples[i], 0, 
    829829        samples[i].length); 
    830     }  
     830    } 
    831831    b = null; 
    832832    return samples; 
    833833  } 
    834    
     834 
    835835  public static byte[] getSamples(Hashtable ifd, RandomAccessStream in, 
    836836    boolean ignore, byte[] buf) throws FormatException, IOException 
     
    988988            stripOffsets[i] -= imageWidth; 
    989989            in.seek((int) stripOffsets[i]); 
    990             in.read(buf, (int) (i*imageWidth), (int) imageWidth);  
     990            in.read(buf, (int) (i*imageWidth), (int) imageWidth); 
    991991            for (int j=0; j<imageWidth; j++) { 
    992992              if (buf[(int) (i*imageWidth + j)] != 0) { 
     
    13451345 
    13461346    if (bitsPerSample[0] == 16) { 
    1347       int pt = 0;  
     1347      int pt = 0; 
    13481348      for (int i = 0; i < samplesPerPixel; i++) { 
    13491349        for (int j = 0; j < numSamples; j++) { 
     
    13541354    } 
    13551355    else if (bitsPerSample[0] == 32) { 
    1356       int pt = 0;  
     1356      int pt = 0; 
    13571357      for (int i=0; i<samplesPerPixel; i++) { 
    13581358        for (int j=0; j<numSamples; j++) { 
    1359           buf[pt++] = (byte) ((samples[i][j] & 0xff000000) >> 24);  
    1360           buf[pt++] = (byte) ((samples[i][j] & 0xff0000) >> 16);  
    1361           buf[pt++] = (byte) ((samples[i][j] & 0xff00) >> 8);  
    1362           buf[pt++] = (byte) (samples[i][j] & 0xff);  
     1359          buf[pt++] = (byte) ((samples[i][j] & 0xff000000) >> 24); 
     1360          buf[pt++] = (byte) ((samples[i][j] & 0xff0000) >> 16); 
     1361          buf[pt++] = (byte) ((samples[i][j] & 0xff00) >> 8); 
     1362          buf[pt++] = (byte) (samples[i][j] & 0xff); 
    13631363        } 
    13641364      } 
     
    13721372    } 
    13731373 
    1374     return buf;  
     1374    return buf; 
    13751375  } 
    13761376 
     
    14571457    } 
    14581458    if (samplesPerPixel == 1) { 
    1459       return ImageTools.makeImage(samples[0], (int) imageWidth,  
     1459      return ImageTools.makeImage(samples[0], (int) imageWidth, 
    14601460        (int) imageLength, 1, false, validBits); 
    14611461    } 
    1462      
     1462 
    14631463    if (samples.length == 2) { 
    14641464      byte[][] s = new byte[3][samples[0].length]; 
  • trunk/loci/formats/in/AVIReader.java

    r2377 r2418  
    123123    throws FormatException, IOException 
    124124  { 
    125     if (!id.equals(currentId)) initFile(id);  
     125    if (!id.equals(currentId)) initFile(id); 
    126126    byte[] buf = new byte[bmpHeight * bmpScanLineSize * (bmpBitsPerPixel / 8)]; 
    127127    return openBytes(id, no, buf); 
  • trunk/loci/formats/in/AliconaReader.java

    r2377 r2418  
    9696    throws FormatException, IOException 
    9797  { 
    98     if (!id.equals(currentId)) initFile(id);  
     98    if (!id.equals(currentId)) initFile(id); 
    9999    byte[] buf = new byte[width * height * numBytes]; 
    100100    return openBytes(id, no, buf); 
     
    226226 
    227227    if (getMeta("Voltage") != null) { 
    228       store.setDetector(null, null, null, null, null,  
     228      store.setDetector(null, null, null, null, null, 
    229229        new Float((String) getMeta("Voltage")), null, null, null); 
    230230    } 
    231231    if (getMeta("Magnification") != null) { 
    232       store.setObjective(null, null, null, null,  
     232      store.setObjective(null, null, null, null, 
    233233        new Float((String) getMeta("Magnification")), null, null); 
    234234    } 
  • trunk/loci/formats/in/BMPReader.java

    r2377 r2418  
    122122      throw new FormatException("Invalid image number: " + no); 
    123123    } 
    124     
     124 
    125125    if (width % 2 == 1) width++; 
    126     
     126 
    127127    if (buf.length < width * height * (bpp / 8)) { 
    128128      throw new FormatException("Buffer too small."); 
     
    162162            buf[y*width + x + pixels] = (byte) in.read(); 
    163163            buf[y*width + x] = (byte) in.read(); 
    164             for (int j=0; j<(bpp - 24) / 8; j++) in.read();  
    165           }  
     164            for (int j=0; j<(bpp - 24) / 8; j++) in.read(); 
     165          } 
    166166        } 
    167167      } 
     
    176176  { 
    177177    if (!id.equals(currentId)) initFile(id); 
    178     if (width % 2 == 1) width++;  
     178    if (width % 2 == 1) width++; 
    179179    byte[] buf = new byte[width * height * (bpp / 8)]; 
    180180    return openBytes(id, no, buf); 
  • trunk/loci/formats/in/BaseTiffReader.java

    r2382 r2418  
    546546      } 
    547547 
    548       // format the creation date to ISO 8061  
     548      // format the creation date to ISO 8061 
    549549 
    550550      String creationDate = getImageCreationDate(); 
     
    556556      catch (Exception e) { 
    557557        if (debug) e.printStackTrace(); 
    558         creationDate = "";  
     558        creationDate = ""; 
    559559      } 
    560560 
    561561      // populate Image element 
    562        
     562 
    563563      store.setImage(getImageName(), 
    564564        creationDate, getImageDescription(), null); 
     
    579579      // set the X and Y pixel dimensions 
    580580 
    581       int resolutionUnit = TiffTools.getIFDIntValue(ifd,  
     581      int resolutionUnit = TiffTools.getIFDIntValue(ifd, 
    582582        TiffTools.RESOLUTION_UNIT); 
    583       TiffRational xResolution = TiffTools.getIFDRationalValue(ifd,  
     583      TiffRational xResolution = TiffTools.getIFDRationalValue(ifd, 
    584584        TiffTools.X_RESOLUTION, false); 
    585585      TiffRational yResolution = TiffTools.getIFDRationalValue(ifd, 
    586586        TiffTools.Y_RESOLUTION, false); 
    587       float pixX = xResolution == null ? 0f : xResolution.floatValue();  
    588       float pixY = yResolution == null ? 0f : yResolution.floatValue();  
     587      float pixX = xResolution == null ? 0f : xResolution.floatValue(); 
     588      float pixY = yResolution == null ? 0f : yResolution.floatValue(); 
    589589 
    590590      switch (resolutionUnit) { 
     
    596596        case 3: 
    597597          // resolution is expressed in pixels per centimeter 
    598           pixX /= 100;  
    599           pixY /= 100;  
     598          pixX /= 100; 
     599          pixY /= 100; 
    600600          break; 
    601601      } 
    602602 
    603       store.setDimensions(new Float(pixX), new Float(pixY), null,  
     603      store.setDimensions(new Float(pixX), new Float(pixY), null, 
    604604        null, null, null); 
    605605 
     
    717717    } 
    718718 
    719     TiffTools.getSamples(ifds[no], in, ignoreColorTable, buf);   
     719    TiffTools.getSamples(ifds[no], in, ignoreColorTable, buf); 
    720720    updateMinMax(buf, no); 
    721721    return swapIfRequired(buf); 
     
    733733 
    734734    int bytesPerPixel = FormatReader.getBytesPerPixel(getPixelType(id)); 
    735     byte[] buf = new byte[getSizeX(id) * getSizeY(id) * bytesPerPixel *  
     735    byte[] buf = new byte[getSizeX(id) * getSizeY(id) * bytesPerPixel * 
    736736      getRGBChannelCount(id)]; 
    737737    return openBytes(id, no, buf); 
  • trunk/loci/formats/in/BioRadReader.java

    r2377 r2418  
    139139    throws FormatException, IOException 
    140140  { 
    141     if (!id.equals(currentId)) initFile(id);  
     141    if (!id.equals(currentId)) initFile(id); 
    142142    byte[] buf = new byte[nx * ny * (byteFormat ? 1 : 2)]; 
    143143    return openBytes(id, no, buf); 
    144144  } 
    145    
     145 
    146146  public byte[] openBytes(String id, int no, byte[] buf) 
    147147    throws FormatException, IOException 
  • trunk/loci/formats/in/DeltavisionReader.java

    r2377 r2418  
    190190    throws FormatException, IOException 
    191191  { 
    192     if (!id.equals(currentId)) initFile(id);  
     192    if (!id.equals(currentId)) initFile(id); 
    193193    byte[] buf = new byte[width * height * bytesPerPixel]; 
    194194    return openBytes(id, no, buf); 
  • trunk/loci/formats/in/DicomReader.java

    r2377 r2418  
    158158      throw new FormatException("Buffer too small."); 
    159159    } 
    160      
     160 
    161161    in.seek(offsets + (width * height * (bitsPerPixel / 8) * no)); 
    162162    in.read(buf); 
  • trunk/loci/formats/in/EPSReader.java

    r2377 r2418  
    103103    throws FormatException, IOException 
    104104  { 
    105     if (!id.equals(currentId)) initFile(id);  
     105    if (!id.equals(currentId)) initFile(id); 
    106106    byte[] buf = new byte[width * height * channels * (bps / 8)]; 
    107107    return openBytes(id, no, buf); 
     
    118118      throw new FormatException("Buffer too small."); 
    119119    } 
    120   
     120 
    121121    RandomAccessStream ras = new RandomAccessStream(id); 
    122122    int line = 0; 
     
    149149    return buf; 
    150150  } 
    151  
    152151 
    153152  /** Obtains the specified image from the given EPS file. */ 
  • trunk/loci/formats/in/FluoviewReader.java

    r2382 r2418  
    5858  /** Pixel dimensions for this file. */ 
    5959  private float voxelX = 0f, voxelY = 0f, voxelZ = 0f, voxelC = 0f, voxelT = 0f; 
    60    
     60 
    6161  // -- Constructor -- 
    6262 
    6363  /** Constructs a new Fluoview TIFF reader. */ 
    6464  public FluoviewReader() { 
    65     super("Olympus Fluoview/Andor Bio-imaging TIFF",  
     65    super("Olympus Fluoview/Andor Bio-imaging TIFF", 
    6666      new String[] {"tif", "tiff"}); 
    6767  } 
     
    152152    // very similar, so it made more sense to merge the two formats into one 
    153153    // reader. 
    154    
     154 
    155155    byte[] buf = new byte[BLOCK_CHECK_LEN]; 
    156156    in.seek(0); 
     
    164164      if (mmheader[i] < 0) mmheader[i]++; 
    165165    } 
    166    
     166 
    167167    RandomAccessStream ras = new RandomAccessStream(mmheader); 
    168168    ras.order(isLittleEndian(currentId)); 
     
    170170    put("Header Flag", ras.readShort()); 
    171171    put("Image Type", (char) ras.read()); 
    172      
     172 
    173173    byte[] nameBytes = new byte[257]; 
    174174    ras.read(nameBytes); 
     
    180180    ras.skipBytes(4); // skip pointer to palette field 
    181181    ras.skipBytes(4); // skip pointer to other palette field 
    182      
     182 
    183183    put("Comment size", ras.readInt()); 
    184184    ras.skipBytes(4); // skip pointer to comment field 
     
    193193      double resolution = ras.readDouble(); 
    194194      ras.read(dimCalibrationUnits); 
    195      
     195 
    196196      put("Dimension " + (i+1) + " Name", new String(dimNameBytes)); 
    197197      put("Dimension " + (i+1) + " Size", size); 
     
    227227    put("Voice field", ras.readInt()); 
    228228    ras.skipBytes(4); // skip pointer to voice field 
    229    
     229 
    230230    // now we need to read the MMSTAMP data to determine dimension order 
    231      
     231 
    232232    double[][] stamps = new double[8][ifds.length]; 
    233233    for (int i=0; i<ifds.length; i++) { 
     
    242242      // each stamp is 8 doubles, representing the position on dimensions 3-10 
    243243      for (int j=0; j<8; j++) { 
    244         stamps[j][i] = ras.readDouble();  
     244        stamps[j][i] = ras.readDouble(); 
    245245      } 
    246246    } 
    247247 
    248248    // calculate the dimension order and axis sizes 
    249      
     249 
    250250    sizeZ[0] = sizeC[0] = sizeT[0] = 1; 
    251251    currentOrder[0] = "XY"; 
     
    254254      String name = (String) getMeta("Dimension " + (i+1) + " Name"); 
    255255      Integer size = (Integer) getMeta("Dimension " + (i+1) + " Size"); 
    256       Double voxel = (Double) getMeta("Dimension " + (i+1) + " Resolution");  
     256      Double voxel = (Double) getMeta("Dimension " + (i+1) + " Resolution"); 
    257257      if (name == null || size == null || size.intValue() == 0) continue; 
    258258      name = name.toLowerCase().trim(); 
    259       if (name.length() == 0) continue;  
     259      if (name.length() == 0) continue; 
    260260 
    261261      if (name.equals("x")) { 
    262262        sizeX[0] = size.intValue(); 
    263         if (voxel != null) voxelX = voxel.floatValue();  
    264       }  
     263        if (voxel != null) voxelX = voxel.floatValue(); 
     264      } 
    265265      else if (name.equals("y")) { 
    266266        sizeY[0] = size.intValue(); 
    267         if (voxel != null) voxelY = voxel.floatValue();  
    268       }  
     267        if (voxel != null) voxelY = voxel.floatValue(); 
     268      } 
    269269      else if (name.equals("z") || name.equals("event")) { 
    270270        sizeZ[0] *= size.intValue(); 
    271271        if (currentOrder[0].indexOf("Z") == -1) currentOrder[0] += "Z"; 
    272         if (voxel != null) voxelZ = voxel.floatValue();  
     272        if (voxel != null) voxelZ = voxel.floatValue(); 
    273273      } 
    274274      else if (name.equals("ch") || name.equals("wavelength")) { 
    275275        sizeC[0] *= size.intValue(); 
    276276        if (currentOrder[0].indexOf("C") == -1) currentOrder[0] += "C"; 
    277         if (voxel != null) voxelC = voxel.floatValue();  
     277        if (voxel != null) voxelC = voxel.floatValue(); 
    278278      } 
    279279      else { 
    280280        sizeT[0] *= size.intValue(); 
    281281        if (currentOrder[0].indexOf("T") == -1) currentOrder[0] += "T"; 
    282         if (voxel != null) voxelT = voxel.floatValue();  
     282        if (voxel != null) voxelT = voxel.floatValue(); 
    283283      } 
    284284    } 
     
    287287    if (currentOrder[0].indexOf("T") == -1) currentOrder[0] += "T"; 
    288288    if (currentOrder[0].indexOf("C") == -1) currentOrder[0] += "C"; 
    289      
     289 
    290290    numImages = ifds.length; 
    291    
    292     // cut up the comment, if necessary  
    293     String comment = (String) getMeta("Comment");  
    294      
     291 
     292    // cut up the comment, if necessary 
     293    String comment = (String) getMeta("Comment"); 
     294 
    295295    if (comment != null && comment.startsWith("[")) { 
    296296      int start = comment.indexOf("[Acquisition Parameters]"); 
     
    298298      if (start != -1 && end != -1 && end > start) { 
    299299        String parms = comment.substring(start + 24, end).trim(); 
    300          
     300 
    301301        // this is an INI-style comment, with one key/value pair per line 
    302302 
     
    308308            String key = token.substring(0, eq); 
    309309            String value = token.substring(eq + 1); 
    310             addMeta(key, value);  
     310            addMeta(key, value); 
    311311          } 
    312312        } 
    313313      } 
    314     
     314 
    315315      start = comment.indexOf("[Version Info]"); 
    316316      end = comment.indexOf("[Version Info End]"); 
     
    328328 
    329329  protected void initMetadataStore() { 
    330     super.initMetadataStore();  
     330    super.initMetadataStore(); 
    331331    try { 
    332332      MetadataStore store = getMetadataStore(currentId); 
    333       store.setDimensions(new Float(voxelX), new Float(voxelY),  
    334         new Float(voxelZ), new Float(voxelC), new Float(voxelT), null);  
    335        
     333      store.setDimensions(new Float(voxelX), new Float(voxelY), 
     334        new Float(voxelZ), new Float(voxelC), new Float(voxelT), null); 
     335 
    336336      Double gamma = (Double) getMeta("Gamma"); 
    337337      for (int i=0; i<sizeC[0]; i++) { 
    338         store.setDisplayChannel(new Integer(i), null, null,  
    339           gamma == null ? null : new Float(gamma.floatValue()), null);  
    340       
     338        store.setDisplayChannel(new Integer(i), null, null, 
     339          gamma == null ? null : new Float(gamma.floatValue()), null); 
     340 
    341341        String gain = (String) getMeta("Gain Ch" + (i+1)); 
    342342        String voltage = (String) getMeta("PMT Voltage Ch" + (i+1)); 
    343343        String offset = (String) getMeta("Offset Ch" + (i+1)); 
    344         
     344 
    345345        if (gain != null || voltage != null || offset != null) { 
    346346          store.setDetector((String) getMeta("System Configuration"), null, 
    347347            null, null, gain == null ? null : new Float(gain), 
    348348            voltage == null ? null : new Float(voltage), 
    349             offset == null ? null : new Float(offset), null, new Integer(i));  
     349            offset == null ? null : new Float(offset), null, new Integer(i)); 
    350350        } 
    351351      } 
    352     
     352 
    353353      String mag = (String) getMeta("Magnification"); 
    354354      if (mag != null && mag.toLowerCase().endsWith("x")) { 
     
    356356      } 
    357357      else if (mag == null) mag = "1"; 
    358       store.setObjective((String) getMeta("Objective Lens"), null, null, null,  
     358      store.setObjective((String) getMeta("Objective Lens"), null, null, null, 
    359359        new Float(mag), null, null); 
    360      
     360 
    361361    } 
    362362    catch (FormatException fe) { 
  • trunk/loci/formats/in/GIFReader.java

    r2377 r2418  
    171171  public byte[] openBytes(String id, int no) throws FormatException, IOException 
    172172  { 
    173     if (!id.equals(currentId)) initFile(id);  
     173    if (!id.equals(currentId)) initFile(id); 
    174174    byte[] buf = new byte[width * height * sizeC[0]]; 
    175175    return openBytes(id, no, buf); 
     
    190190 
    191191    if (ignoreColorTable) { 
    192       for (int i=0; i<buf.length; i++) buf[i] = (byte) ints[i];  
     192      for (int i=0; i<buf.length; i++) buf[i] = (byte) ints[i]; 
    193193    } 
    194194    else { 
     
    199199      } 
    200200    } 
    201     updateMinMax(buf, no);  
    202     return buf;  
     201    updateMinMax(buf, no); 
     202    return buf; 
    203203  } 
    204204 
  • trunk/loci/formats/in/GatanReader.java

    r2377 r2418  
    129129    throws FormatException, IOException 
    130130  { 
    131     if (!id.equals(currentId)) initFile(id);  
     131    if (!id.equals(currentId)) initFile(id); 
    132132    byte[] buf = new byte[dims[0] * dims[1] * dims[2]]; 
    133133    return openBytes(id, no, buf); 
     
    143143    if (buf.length < dims[0] * dims[1] * dims[2]) { 
    144144      throw new FormatException("Buffer too small."); 
    145     }  
    146   
     145    } 
     146 
    147147    in.seek(pixelOffset); 
    148148    in.read(buf); 
     
    177177    in = null; 
    178178    currentId = null; 
    179     pixelOffset = 0;  
     179    pixelOffset = 0; 
    180180  } 
    181181 
     
    296296    for (int i=0; i<sizeC[0]; i++) { 
    297297      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
    298       store.setDisplayChannel(new Integer(i), null, null,  
     298      store.setDisplayChannel(new Integer(i), null, null, 
    299299        gamma == null ? null : new Float(gamma), null); 
    300300    } 
    301301 
    302302    String mag = (String) getMeta("Indicated Magnification"); 
    303     store.setObjective(null, null, null, null,  
     303    store.setObjective(null, null, null, null, 
    304304      mag == null ? null : new Float(mag), null, null); 
    305305 
  • trunk/loci/formats/in/ICSReader.java

    r2386 r2418  
    4444  /** Metadata field categories. */ 
    4545  private String[] CATEGORIES = new String[] { 
    46     "ics_version", "filename", "source", "layout", "representation",  
     46    "ics_version", "filename", "source", "layout", "representation", 
    4747    "parameter", "sensor", "history", "end" 
    4848  }; 
     
    144144    throws FormatException, IOException 
    145145  { 
    146     if (!id.equals(currentId)) initFile(id);  
    147     byte[] buf = new byte[sizeX[0] * sizeY[0] * (dimensions[0] / 8) *  
     146    if (!id.equals(currentId)) initFile(id); 
     147    byte[] buf = new byte[sizeX[0] * sizeY[0] * (dimensions[0] / 8) * 
    148148      getRGBChannelCount(id)]; 
    149149    return openBytes(id, no, buf); 
     
    157157      throw new FormatException("Invalid image number: " + no); 
    158158    } 
    159     if (buf.length < sizeX[0] * sizeY[0] * (dimensions[0] / 8) *  
    160       getRGBChannelCount(id))  
     159    if (buf.length < sizeX[0] * sizeY[0] * (dimensions[0] / 8) * 
     160      getRGBChannelCount(id)) 
    161161    { 
    162162      throw new FormatException("Buffer too small."); 
    163163    } 
    164    
     164 
    165165    int bpp = dimensions[0] / 8; 
    166166 
     
    174174      } 
    175175    } 
    176     else System.arraycopy(data, offset, buf, 0, len);  
     176    else System.arraycopy(data, offset, buf, 0, len); 
    177177 
    178178    // if it's version two, we need to flip the plane upside down 
    179179    if (versionTwo) { 
    180       int scanline = sizeX[0] * bpp * sizeC[0];  
     180      int scanline = sizeX[0] * bpp * sizeC[0]; 
    181181      for (int y=0; y<sizeY[0]; y++) { 
    182182        for (int x=0; x<scanline; x++) { 
    183183          byte bottom = buf[y*scanline + x]; 
    184184          buf[y*scanline + x] = buf[(sizeY[0] - y - 1)*scanline + x]; 
    185           buf[(sizeY[0] - y - 1)*scanline + x] = bottom;  
     185          buf[(sizeY[0] - y - 1)*scanline + x] = bottom; 
    186186        } 
    187187      } 
     
    321321          if (token.equals(SUB_SUB_CATEGORIES[i])) foundValue = false; 
    322322        } 
    323        
     323 
    324324        if (foundValue) { 
    325325          StringBuffer value = new StringBuffer(); 
     
    336336        } 
    337337      } 
    338       if (st.hasMoreTokens()) line = st.nextToken();  
     338      if (st.hasMoreTokens()) line = st.nextToken(); 
    339339      else line = null; 
    340340    } 
     
    372372      else if(orderToken.equals("ch")) { 
    373373        dimensions[4] = Integer.parseInt(imageToken); 
    374         if (dimensions[4] > 4) rgb = false;  
     374        if (dimensions[4] > 4) rgb = false; 
    375375      } 
    376376      else { 
     
    392392      String firstByte = endianness.nextToken(); 
    393393      int first = Integer.parseInt(firstByte); 
    394       littleEndian =  
    395         ((String) getMeta("representation format")).equals("real") ?  
     394      littleEndian = 
     395        ((String) getMeta("representation format")).equals("real") ? 
    396396        first == 1 : first != 1; 
    397397    } 
     
    507507      StringTokenizer pixelSizeTokens = new StringTokenizer(pixelSizes); 
    508508      StringTokenizer axisTokens = new StringTokenizer(o); 
    509      
    510       Float pixX = null, pixY = null, pixZ = null, pixC = null, pixT = null;  
    511      
     509 
     510      Float pixX = null, pixY = null, pixZ = null, pixC = null, pixT = null; 
     511 
    512512      while (pixelSizeTokens.hasMoreTokens()) { 
    513513        String axis = axisTokens.nextToken().trim().toLowerCase(); 
    514514        String size = pixelSizeTokens.nextToken().trim(); 
    515         if (axis.equals("x")) pixX = new Float(size);  
    516         else if (axis.equals("y")) pixY = new Float(size);  
    517         else if (axis.equals("ch")) pixC = new Float(size);  
    518         else if (axis.equals("z")) pixZ = new Float(size);  
    519         else if (axis.equals("t")) pixT = new Float(size);  
     515        if (axis.equals("x")) pixX = new Float(size); 
     516        else if (axis.equals("y")) pixY = new Float(size); 
     517        else if (axis.equals("ch")) pixC = new Float(size); 
     518        else if (axis.equals("z")) pixZ = new Float(size); 
     519        else if (axis.equals("t")) pixT = new Float(size); 
    520520      } 
    521521      store.setDimensions(pixX, pixY, pixZ, pixC, pixT, null); 
     
    524524    String em = (String) getMeta("sensor s_params LambdaEm"); 
    525525    String ex = (String) getMeta("sensor s_params LambdaEx"); 
    526     int[] emWave = new int[sizeC[0]];  
    527     int[] exWave = new int[sizeC[0]];  
     526    int[] emWave = new int[sizeC[0]]; 
     527    int[] exWave = new int[sizeC[0]]; 
    528528    if (em != null) { 
    529529      StringTokenizer emTokens = new StringTokenizer(em); 
     
    540540 
    541541    for (int i=0; i<sizeC[0]; i++) { 
    542       store.setLogicalChannel(i, null, null, new Integer(emWave[i]),  
     542      store.setLogicalChannel(i, null, null, new Integer(emWave[i]), 
    543543        new Integer(exWave[i]), null, null, null); 
    544544    } 
  • trunk/loci/formats/in/IPLabReader.java

    r2377 r2418  
    137137    throws FormatException, IOException 
    138138  { 
    139     if (!id.equals(currentId)) initFile(id);  
     139    if (!id.equals(currentId)) initFile(id); 
    140140    byte[] buf = new byte[width * height * bps * c]; 
    141141    return openBytes(id, no, buf); 
     
    149149      throw new FormatException("Invalid image number: " + no); 
    150150    } 
    151      
     151 
    152152    int numPixels = width * height * c; 
    153153    if (buf.length < numPixels * bps) { 
    154154      throw new FormatException("Buffer too small."); 
    155     }  
     155    } 
    156156    in.seek(numPixels * bps * (no / c) + 44); 
    157157 
     
    401401          store.setChannelGlobalMinMax(i, new Double(min), 
    402402            new Double(max), null); 
    403          
     403 
    404404          store.setDisplayChannel(new Integer(c), new Double(black), 
    405405            new Double(white), new Float(gamma), null); 
  • trunk/loci/formats/in/IPWReader.java

    r2377 r2418  
    113113    int c = getRGBChannelCount(id); 
    114114    if (c == 2) c++; 
    115     byte[] buf = new byte[sizeX[0] * sizeY[0] * c *  
     115    byte[] buf = new byte[sizeX[0] * sizeY[0] * c * 
    116116      FormatReader.getBytesPerPixel(pixelType[0])]; 
    117117    return openBytes(id, no, buf); 
     
    125125      throw new FormatException("Invalid image number: " + no); 
    126126    } 
    127   
     127 
    128128    try { 
    129129      String directory = (String) pixels.get(new Integer(no)); 
     
    141141        r.setVar("entryName", name); 
    142142        r.exec("document = root.getEntry(entryName)"); 
    143       }  
    144      
     143      } 
     144 
    145145      r.exec("dis = new DocumentInputStream(document)"); 
    146146      r.exec("numBytes = dis.available()"); 
    147147      int numBytes = ((Integer) r.getVar("numBytes")).intValue(); 
    148       byte[] b = new byte[numBytes + 4];  
     148      byte[] b = new byte[numBytes + 4]; 
    149149      r.setVar("data", b); 
    150150      r.exec("dis.read(data)"); 
     
    158158      return buf; 
    159159    } 
    160     catch (ReflectException e) {  
     160    catch (ReflectException e) { 
    161161      noPOI = true; 
    162162      return null; 
  • trunk/loci/formats/in/ImarisReader.java

    r2377 r2418  
    203203    throws FormatException, IOException 
    204204  { 
    205     if (!id.equals(currentId)) initFile(id);  
     205    if (!id.equals(currentId)) initFile(id); 
    206206    byte[] buf = new byte[dims[0] * dims[1]]; 
    207207    return openBytes(id, no, buf); 
  • trunk/loci/formats/in/LIFReader.java

    r2389 r2418  
    9696    if (!id.equals(currentId)) initFile(id); 
    9797    numImages = dims[series][2] * dims[series][3]; 
    98     return numImages * (isRGB(id) ? 1 : dims[series][4]);  
     98    return numImages * (isRGB(id) ? 1 : dims[series][4]); 
    9999  } 
    100100 
     
    149149    throws FormatException, IOException 
    150150  { 
    151     if (!id.equals(currentId)) initFile(id);  
     151    if (!id.equals(currentId)) initFile(id); 
    152152    bpp = dims[series][5]; 
    153153    while (bpp % 8 != 0) bpp++; 
    154     byte[] buf = new byte[sizeX[series] * sizeY[series] *  
     154    byte[] buf = new byte[sizeX[series] * sizeY[series] * 
    155155      (bpp / 8) * sizeC[series]]; 
    156156    return openBytes(id, no, buf); 
     
    172172 
    173173    int offset = ((Long) offsets.get(series)).intValue(); 
    174     in.seek(offset + sizeX[series] * sizeY[series] * bytes * no * sizeC[series]); 
     174    in.seek(offset + 
     175      sizeX[series] * sizeY[series] * bytes * no * sizeC[series]); 
    175176    in.read(buf); 
    176177    updateMinMax(buf, no); 
     
    182183    throws FormatException, IOException 
    183184  { 
    184     BufferedImage b = ImageTools.makeImage(openBytes(id, no), sizeX[series],  
    185       sizeY[series], isRGB(id) ? sizeC[series] : 1, false, bpp / 8, littleEndian,  
    186       validBits[series]); 
     185    int c = isRGB(id) ? sizeC[series] : 1; 
     186    BufferedImage b = ImageTools.makeImage(openBytes(id, no), sizeX[series], 
     187      sizeY[series], c, false, bpp / 8, littleEndian, validBits[series]); 
    187188    updateMinMax(b, no); 
    188189    return b; 
  • trunk/loci/formats/in/LegacyZVIReader.java

    r2377 r2418  
    120120    if (!id.equals(currentId)) initFile(id); 
    121121    byte[] buf = new byte[((ZVIBlock) blockList.elementAt(no)).imageSize]; 
    122     return openBytes(id, no, buf);  
     122    return openBytes(id, no, buf); 
    123123  } 
    124124 
     
    130130      throw new FormatException("Invalid image number: " + no); 
    131131    } 
    132      
     132 
    133133    ZVIBlock zviBlock = (ZVIBlock) blockList.elementAt(no); 
    134134    zviBlock.readBytes(in, buf); 
     
    575575          "; fileSize=" + fileSize + "). " + WHINING); 
    576576      } 
    577       if (buf.length < imageSize) throw new FormatException("Buffer too small."); 
     577      if (buf.length < imageSize) throw new FormatException("Buffer too small"); 
    578578 
    579579      // read image 
    580580      raf.seek(imagePos); 
    581581      raf.readFully(buf); 
    582       return buf;  
     582      return buf; 
    583583    } 
    584584 
  • trunk/loci/formats/in/LeicaReader.java

    r2414 r2418  
    188188  } 
    189189  */ 
    190    
     190 
    191191  /** Obtains the specified image from the given Leica file. */ 
    192192  public BufferedImage openImage(String id, int no) 
     
    596596        for (int j=0; j<tiff[i].length; j++) { 
    597597          tiff[i][j] = new TiffReader(); 
    598           tiff[i][j].setColorTableIgnored(isColorTableIgnored());  
     598          tiff[i][j].setColorTableIgnored(isColorTableIgnored()); 
    599599        } 
    600600      } 
  • trunk/loci/formats/in/MRCReader.java

    r2377 r2418  
    7070  { 
    7171    if (!id.equals(currentId)) initFile(id); 
    72     return new Double((String) getMeta("Minimum pixel value"));  
     72    return new Double((String) getMeta("Minimum pixel value")); 
    7373  } 
    7474 
     
    8282 
    8383  /* @see IFormatReader#isMinMaxPopulated(String) */ 
    84   public boolean isMinMaxPopulated(String id)  
    85     throws FormatException, IOException  
     84  public boolean isMinMaxPopulated(String id) 
     85    throws FormatException, IOException 
    8686  { 
    8787    return true; 
     
    118118    throws FormatException, IOException 
    119119  { 
    120     if (!id.equals(currentId)) initFile(id);  
     120    if (!id.equals(currentId)) initFile(id); 
    121121    byte[] buf = new byte[sizeX[0] * sizeY[0] * bpp]; 
    122122    return openBytes(id, no, buf); 
  • trunk/loci/formats/in/MicromanagerReader.java

    r2384 r2418  
    4444 
    4545  /** Constructs a new Micromanager reader. */ 
    46   public MicromanagerReader() {  
     46  public MicromanagerReader() { 
    4747    super("Micro-Manager", new String[] {"tif", "tiff", "txt"}); 
    4848  } 
     
    7373 
    7474  /* @see IFormatReader#openBytes(String, int) */ 
    75   public byte[] openBytes(String id, int no)  
     75  public byte[] openBytes(String id, int no) 
    7676    throws FormatException, IOException 
    7777  { 
     
    110110  { 
    111111    if (!id.equals(currentId)) initFile(id); 
    112     String min = (String) getMeta("ChContrastMin");  
    113     if (min == null) return null;  
    114     if (sizeC[0] == 1) return new Double(min);  
     112    String min = (String) getMeta("ChContrastMin"); 
     113    if (min == null) return null; 
     114    if (sizeC[0] == 1) return new Double(min); 
    115115    StringTokenizer st = new StringTokenizer(min, ","); 
    116116    int pos = 0; 
     
    121121    min = st.nextToken(); 
    122122    min.replaceAll("[", "").replaceAll("]", "").trim(); 
    123     return new Double(min);  
     123    return new Double(min); 
    124124  } 
    125125 
     
    129129  { 
    130130    if (!id.equals(currentId)) initFile(id); 
    131     String max = (String) getMeta("ChContrastMax");  
    132     if (max == null) return null;  
    133     if (sizeC[0] == 1) return max == null ? null : new Double(max);  
     131    String max = (String) getMeta("ChContrastMax"); 
     132    if (max == null) return null; 
     133    if (sizeC[0] == 1) return max == null ? null : new Double(max); 
    134134    StringTokenizer st = new StringTokenizer(max, ","); 
    135135    int pos = 0; 
     
    144144 
    145145  /* @see IFormatReader#isMinMaxPopulated(String) */ 
    146   public boolean isMinMaxPopulated(String id)  
     146  public boolean isMinMaxPopulated(String id) 
    147147    throws FormatException, IOException 
    148148  { 
    149149    return getChannelGlobalMinimum(id, 0) != null && 
    150       getChannelGlobalMaximum(id, 0) != null;  
     150      getChannelGlobalMaximum(id, 0) != null; 
    151151  } 
    152152 
     
    158158    tiffs = null; 
    159159  } 
    160    
     160 
    161161  /* @see IFormatReader#close(boolean) */ 
    162162  public void close(boolean fileOnly) throws FormatException, IOException { 
     
    175175    RandomAccessStream ras = new RandomAccessStream( 
    176176      new Location(parent, "metadata.txt").getAbsolutePath()); 
    177    
     177 
    178178    // usually a small file, so we can afford to read it into memory 
    179179 
     
    191191      String name = s.substring(s.indexOf(":", pos), s.indexOf(",", pos)); 
    192192      tiffs.add(0, name.substring(3, name.length() - 1)); 
    193       pos++;  
     193      pos++; 
    194194    } 
    195195 
     
    201201      s = s.substring(s.indexOf("\n", start), end).trim(); 
    202202    } 
    203   
     203 
    204204    StringTokenizer st = new StringTokenizer(s, "\n"); 
    205205    while (st.hasMoreTokens()) { 
    206206      String token = st.nextToken(); 
    207207      boolean open = token.indexOf("[") != -1; 
    208       boolean closed = token.indexOf("]") != -1;  
     208      boolean closed = token.indexOf("]") != -1; 
    209209      if (open || (!open && !closed)) { 
    210210        int quote = token.indexOf("\"") + 1; 
    211         String key = token.substring(quote, token.indexOf("\"", quote));  
    212       
     211        String key = token.substring(quote, token.indexOf("\"", quote)); 
     212 
    213213        if (!open && !closed) { 
    214214          String value = token.substring(token.indexOf(":") + 1).trim(); 
     
    224224          String value = valueBuffer.toString(); 
    225225          value.replaceAll("\n", "").trim(); 
    226           addMeta(key, value.substring(0, value.length() - 1));  
     226          addMeta(key, value.substring(0, value.length() - 1)); 
    227227        } 
    228228        else { 
    229           String value =  
     229          String value = 
    230230            token.substring(token.indexOf("[") + 1, token.indexOf("]")).trim(); 
    231231          addMeta(key, value.substring(0, value.length() - 1)); 
     
    240240    currentOrder[0] = "XYCTZ"; 
    241241    pixelType[0] = tiffReader.getPixelType((String) tiffs.get(0)); 
    242    
     242 
    243243    MetadataStore store = getMetadataStore(id); 
    244244 
     
    268268    for (int i=0; i<list.length; i++) { 
    269269      if (list[i].endsWith("metadata.txt")) return super.isThisType(name, open); 
    270     }  
     270    } 
    271271    return false; 
    272272  } 
  • trunk/loci/formats/in/ND2Reader.java

    r2415 r2418  
    497497    // we calculate this directly (instead of calling getEffectiveSizeC) because 
    498498    // sizeZ and sizeT have not been accurately set yet 
    499     int effectiveC = (sizeC[0] / 3) + 1;  
     499    int effectiveC = (sizeC[0] / 3) + 1; 
    500500 
    501501    if (numImages < sizeZ[0] * sizeT[0]) { 
     
    584584      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
    585585    } 
    586    
     586 
    587587    String prefix = "MetadataSeq _SEQUENCE_INDEX=\"0\" "; 
    588588 
     
    591591    String mag = (String) getMeta(prefix + "dObjectiveMag value"); 
    592592    String na = (String) getMeta(prefix + "dObjectiveNA value"); 
    593    
    594     store.setDetector(null, null, null, null,  
    595       gain == null ? null : new Float(gain),  
     593 
     594    store.setDetector(null, null, null, null, 
     595      gain == null ? null : new Float(gain), 
    596596      voltage == null ? null : new Float(voltage), null, null, null); 
    597     store.setObjective(null, null, null, na == null ? null : new Float(na),   
     597    store.setObjective(null, null, null, na == null ? null : new Float(na), 
    598598      mag == null ? null : new Float(mag), null, null); 
    599599  } 
  • trunk/loci/formats/in/OIBReader.java

    r2415 r2418  
    194194  { 
    195195    if (!id.equals(currentId)) initFile(id); 
    196     byte[] buf = new byte[sizeX[series] * sizeY[series] *  
    197       getRGBChannelCount(id) *  
     196    byte[] buf = new byte[sizeX[series] * sizeY[series] * 
     197      getRGBChannelCount(id) * 
    198198      FormatReader.getBytesPerPixel(pixelType[series])]; 
    199199    return openBytes(id, no, buf); 
    200200  } 
    201    
     201 
    202202  public byte[] openBytes(String id, int no, byte[] buf) 
    203203    throws FormatException, IOException 
     
    207207      throw new FormatException("Invalid image number: " + no); 
    208208    } 
    209    
     209 
    210210    try { 
    211       Integer ii = new Integer(no);  
     211      Integer ii = new Integer(no); 
    212212      String directory = (String) ((Hashtable) pixels.get(series)).get(ii); 
    213213      String name = (String) ((Hashtable) names.get(series)).get(ii); 
     
    248248 
    249249    byte[] b = openBytes(id, no); 
    250     int bytes = b.length / (sizeX[series] * sizeY[series] *  
     250    int bytes = b.length / (sizeX[series] * sizeY[series] * 
    251251      getRGBChannelCount(id)); 
    252      
     252 
    253253    BufferedImage bi = ImageTools.makeImage(b, sizeX[series], sizeY[series], 
    254254      getRGBChannelCount(id), false, bytes, !littleEndian[series], 
     
    512512 
    513513      String acquisition = "[Acquisition Parameters Common] - "; 
    514       store.setImage(null, (String) getMeta(acquisition + "ImageCaputreDate"),  
     514      store.setImage(null, (String) getMeta(acquisition + "ImageCaputreDate"), 
    515515        null, null); 
    516516 
     
    535535        store.setLogicalChannel(j, null, null, null, null, null, 
    536536          null, new Integer(i)); 
    537        
     537 
    538538        String prefix = "[Channel " + (j + 1) + " Parameters] - "; 
    539539        String gain = (String) getMeta(prefix + "AnalogPMTGain"); 
     
    541541        String voltage = (String) getMeta(prefix + "AnalogPMTVoltage"); 
    542542 
    543         store.setDetector(null, null, null, null,  
    544           gain == null ? null : new Float(gain),  
    545           voltage == null ? null : new Float(voltage),  
    546           offset == null ? null : new Float(offset), null, new Integer(j));  
     543        store.setDetector(null, null, null, null, 
     544          gain == null ? null : new Float(gain), 
     545          voltage == null ? null : new Float(voltage), 
     546          offset == null ? null : new Float(offset), null, new Integer(j)); 
    547547      } 
    548548 
     
    551551 
    552552      for (int j=0; j<numLasers; j++) { 
    553         String wave =  
     553        String wave = 
    554554          (String) getMeta(acquisition + "LaserWavelength0" + (j + 1)); 
    555         if (wave == null) wave = "0";  
     555        if (wave == null) wave = "0"; 
    556556        store.setLaser(null, null, new Integer(wave), null, null, null, null, 
    557557          null, null, null, new Integer(j)); 
  • trunk/loci/formats/in/OIFReader.java

    r2414 r2418  
    162162      throw new FormatException("Invalid image number: " + no); 
    163163    } 
    164       
     164 
    165165    tiffReader[no].openBytes((String) tiffs.get(no), 0, buf); 
    166166    tiffReader[no].close(); 
     
    475475      String emWave = (String) getMeta(prefix + "EmissionWavelength"); 
    476476      String exWave = (String) getMeta(prefix + "ExcitationWavelength"); 
    477       store.setLogicalChannel(i, name, null, emWave == null ? null :  
    478         new Integer(emWave), exWave == null ? null : new Integer(exWave),  
     477      store.setLogicalChannel(i, name, null, emWave == null ? null : 
     478        new Integer(emWave), exWave == null ? null : new Integer(exWave), 
    479479        null, null, null); 
    480480    } 
     
    489489      if (voltage != null) voltage.replaceAll("\"", ""); 
    490490      if (offset != null) offset.replaceAll("\"", ""); 
    491     
     491 
    492492      if (gain != null || voltage != null || offset != null) { 
    493         store.setDetector(null, null, null, null, new Float(gain),  
     493        store.setDetector(null, null, null, null, new Float(gain), 
    494494          new Float(voltage), new Float(offset), null, new Integer(i)); 
    495495      } 
     
    501501    } 
    502502 
    503     String num =  
     503    String num = 
    504504      (String) getMeta("[Acquisition Parameters Common] - Number of use Laser"); 
    505505    if (num != null) { 
     
    507507      for (int i=0; i<numLasers; i++) { 
    508508        String wave = (String) getMeta("[Acquisition Parameters Common] - " + 
    509           "LaserWavelength0" + (i+1));  
     509          "LaserWavelength0" + (i+1)); 
    510510        if (wave != null) { 
    511           store.setLaser(null, null, new Integer(wave), null, null, null, null,  
     511          store.setLaser(null, null, new Integer(wave), null, null, null, null, 
    512512            null, null, null, new Integer(i)); 
    513513        } 
  • trunk/loci/formats/in/OpenlabRawReader.java

    r2377 r2418  
    103103    throws FormatException, IOException 
    104104  { 
    105     if (!id.equals(currentId)) initFile(id);  
     105    if (!id.equals(currentId)) initFile(id); 
    106106    byte[] buf = new byte[width * height * bytesPerPixel]; 
    107107    return openBytes(id, no, buf); 
     
    118118      throw new FormatException("Buffer too small."); 
    119119    } 
    120      
     120 
    121121    in.seek(offsets[no / channels] + 288); 
    122122    in.read(buf); 
  • trunk/loci/formats/in/PerkinElmerReader.java

    r2414 r2418  
    182182  /** Initializes the given PerkinElmer file. */ 
    183183  protected void initFile(String id) throws FormatException, IOException { 
    184     if (currentId != null &&  
    185       (id.equals(currentId) || isUsedFile(currentId, id)))  
    186     {   
     184    if (currentId != null && 
     185      (id.equals(currentId) || isUsedFile(currentId, id))) 
     186    { 
    187187      return; 
    188188    } 
     
    191191    // always init on the HTML file - this prevents complications with 
    192192    // initializing the image files 
    193     
     193 
    194194    if (!id.toLowerCase().endsWith(".htm")) { 
    195195      Location parent = new Location(id).getAbsoluteFile().getParentFile(); 
     
    199199          id = new Location(ls[i]).getAbsolutePath(); 
    200200          break; 
    201         }  
    202       } 
    203     } 
    204      
     201        } 
     202      } 
     203    } 
     204 
    205205    super.initFile(id); 
    206206 
  • trunk/loci/formats/in/PrairieReader.java

    r2415 r2418  
    187187    tiff.openBytes(files[no], 0, buf); 
    188188    updateMinMax(buf, no); 
    189     return buf;  
     189    return buf; 
    190190  } 
    191191 
     
    352352          store.setLogicalChannel(i, null, null, null, null, null, null, null); 
    353353        } 
    354        
     354 
    355355        String date = (String) getMeta(" PVScan date"); 
    356         
     356 
    357357        store.setImage(null, date, null, null); 
    358          
     358 
    359359        String laserPower = (String) getMeta("laserPower_0"); 
    360          
    361         store.setLaser(null, null, null, null, null, null,  
    362           laserPower == null ? null : new Float(laserPower),  
    363           null, null, null, null);  
    364          
     360 
     361        store.setLaser(null, null, null, null, null, null, 
     362          laserPower == null ? null : new Float(laserPower), 
     363          null, null, null, null); 
     364 
    365365        for (int i=0; i<4; i++) { 
    366366          String gain = (String) getMeta("pmtGain_" + i); 
    367367          String offset = (String) getMeta("pmtOffset_" + i); 
    368           store.setDetector(null, null, null, null,  
    369             gain == null ? null : new Float(gain), null,  
    370             offset == null ? null : new Float(offset), null, new Integer(i));  
    371         } 
    372     
     368          store.setDetector(null, null, null, null, 
     369            gain == null ? null : new Float(gain), null, 
     370            offset == null ? null : new Float(offset), null, new Integer(i)); 
     371        } 
     372 
    373373        String zoom = (String) getMeta("opticalZoom"); 
    374374        if (zoom != null) { 
  • trunk/loci/formats/in/SDTReader.java

    r2377 r2418  
    135135    throws FormatException, IOException 
    136136  { 
    137     if (!id.equals(currentId)) initFile(id);  
     137    if (!id.equals(currentId)) initFile(id); 
    138138    byte[] buf = new byte[2 * sizeX[series] * sizeY[series]]; 
    139139    return openBytes(id, no, buf); 
     
    150150      throw new FormatException("Buffer too small."); 
    151151    } 
    152      
     152 
    153153    if (intensity) { 
    154154      in.seek(off + 2 * sizeX[series] * sizeY[series] * timeBins * no); 
     
    156156        for (int x=0; x<sizeX[series]; x++) { 
    157157          // read all lifetime bins at this pixel for this channel 
    158            
     158 
    159159          // combine lifetime bins into intensity value 
    160160          short sum = 0; 
    161161          for (int t=0; t<timeBins; t++) { 
    162             sum += DataTools.read2SignedBytes(in, true);  
     162            sum += DataTools.read2SignedBytes(in, true); 
    163163          } 
    164164          int ndx = 2 * (sizeX[0] * y + x); 
  • trunk/loci/formats/in/SlidebookReader.java

    r2377 r2418  
    102102    throws FormatException, IOException 
    103103  { 
    104     if (!id.equals(currentId)) initFile(id);  
     104    if (!id.equals(currentId)) initFile(id); 
    105105    byte[] buf = new byte[width * height * 2]; 
    106106    return openBytes(id, no, buf); 
  • trunk/loci/formats/in/ZeissZVIReader.java

    r2410 r2418  
    233233    throws FormatException, IOException 
    234234  { 
    235     if (!id.equals(currentId)) initFile(id);  
     235    if (!id.equals(currentId)) initFile(id); 
    236236    byte[] buf = new byte[sizeX[0] * sizeY[0] * bpp]; 
    237237    return openBytes(id, no, buf); 
     
    261261      r.exec("numBytes = dis.available()"); 
    262262      int numBytes = ((Integer) r.getVar("numBytes")).intValue(); 
    263       r.setVar("skipBytes",  
     263      r.setVar("skipBytes", 
    264264        ((Integer) offsets.get(new Integer(no))).longValue()); 
    265265      r.exec("blah = dis.skip(skipBytes)"); 
     
    489489    String pixY = (String) getMeta("Scale Factor for Y"); 
    490490    String pixZ = (String) getMeta("Scale Factor for Z"); 
    491   
     491 
    492492    if (pixX == null && pixY != null) pixX = pixY; 
    493493    if (pixY == null && pixX != null) pixY = pixX; 
  • trunk/loci/formats/ome/OMEUploader.java

    r2327 r2418  
    692692    throws UploadException 
    693693  { 
    694     uploadMetadata(store, id, null);  
     694    uploadMetadata(store, id, null); 
    695695  } 
    696696 
     
    735735 
    736736    // set the Image information 
    737    
     737 
    738738    if (imageIDs == null) return; 
    739739 
     
    809809    image.setDefaultPixels(pixels); 
    810810    df.update(image); 
    811    
     811 
    812812    // link image to the appropriate dataset 
    813813    if (dataset != null) { 
  • trunk/loci/formats/out/QTWriter.java

    r2182 r2418  
    598598  } 
    599599 
    600  
    601600  // -- Helper method -- 
    602601 
  • trunk/loci/formats/test/ReaderTest.java

    r2387 r2418  
    563563  } 
    564564 
    565   /**  
    566    * Check that the used file list produced by each file in a set is the same.  
     565  /** 
     566   * Check that the used file list produced by each file in a set is the same. 
    567567   */ 
    568568  public void testSaneUsedFiles() { 
     
    578578        for (int j=0; j<comp.length; j++) { 
    579579          if (!comp[j].equals(base[j])) { 
    580             writeLog(id + " failed sane used files test (" + base[i] + ")");  
     580            writeLog(id + " failed sane used files test (" + base[i] + ")"); 
    581581            assertTrue(false); 
    582           }  
     582          } 
    583583        } 
    584584      } 
     
    589589    catch (Exception e) { 
    590590      if (FormatReader.debug) e.printStackTrace(); 
    591       writeLog(id + " failed sane used files test");  
    592     } 
    593     assertTrue(false);  
     591      writeLog(id + " failed sane used files test"); 
     592    } 
     593    assertTrue(false); 
    594594  } 
    595595 
     
    629629    if (!writeConfigFiles) { 
    630630      suite.addTest(new ReaderTest("testByteArrayDimensions", id)); 
    631       suite.addTest(new ReaderTest("testThumbnailImageDimensions", id));  
    632       suite.addTest(new ReaderTest("testThumbnailArrayDimensions", id));  
     631      suite.addTest(new ReaderTest("testThumbnailImageDimensions", id)); 
     632      suite.addTest(new ReaderTest("testThumbnailArrayDimensions", id)); 
    633633      suite.addTest(new ReaderTest("testImageCount", id)); 
    634634      suite.addTest(new ReaderTest("testOMEXML", id)); 
    635       suite.addTest(new ReaderTest("testSaneUsedFiles", id));  
     635      suite.addTest(new ReaderTest("testSaneUsedFiles", id)); 
    636636    } 
    637637    if (config.initialized(id) || writeConfigFiles) { 
Note: See TracChangeset for help on using the changeset viewer.