Changeset 1200


Ignore:
Timestamp:
07/28/06 12:07:41 (14 years ago)
Author:
melissa
Message:

fixed most javac warnings

Location:
trunk/loci/formats
Files:
34 edited

Legend:

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

    r1198 r1200  
    289289    int maxX = 0; 
    290290    int maxY = 0; 
    291     int maxXIndex = 0; 
    292     int maxYIndex = 0; 
    293291 
    294292    for (int i=0; i<dims.length; i++) { 
    295293      if (dims[i][0] > maxX) { 
    296294        maxX = dims[i][0]; 
    297         maxXIndex = i; 
    298295      } 
    299296      if (dims[i][1] > maxY) { 
    300297        maxY = dims[i][1]; 
    301         maxYIndex = i; 
    302298      } 
    303299    } 
  • trunk/loci/formats/FormatReader.java

    r1198 r1200  
    205205  /** 
    206206   * Sets the default metadata store for this reader. 
    207    *  
     207   * 
    208208   * @param store a metadata store implementation. 
    209209   */ 
  • trunk/loci/formats/ImageViewer.java

    r1195 r1200  
    204204    slider.setVisible(images.length > 1); 
    205205    slider.addChangeListener(this); 
    206     Dimension dim = ImageTools.getSize(images[0]); 
    207206    updateLabel(-1, -1); 
    208207    sb.setLength(0); 
  • trunk/loci/formats/in/BaseTiffReader.java

    r1198 r1200  
    367367   */ 
    368368  protected void initMetadataStore() { 
    369     final String unknown = "unknown"; 
    370369    Hashtable ifd = ifds[0]; 
    371370    try { 
  • trunk/loci/formats/in/BioRadReader.java

    r1198 r1200  
    4848  private static final boolean LITTLE_ENDIAN = true; 
    4949 
    50   // Merge types 
    51  
    52   /** Image is not merged. */ 
    53   private static final int MERGE_OFF = 0; 
    54  
    55   /** All pixels merged, 16 color (4-bit). */ 
    56   private static final int MERGE_16 = 1; 
    57  
    58   /** Alternate pixels merged, 128 color (7-bit). */ 
    59   private static final int MERGE_ALTERNATE = 2; 
    60  
    61   /** Alternate columns merged. */ 
    62   private static final int MERGE_COLUMN = 3; 
    63  
    64   /** Alternate rows merged. */ 
    65   private static final int MERGE_ROW = 4; 
    66  
    67   /** Maximum pixels merged. */ 
    68   private static final int MERGE_MAXIMUM = 5; 
    69  
    70   /** 64-color (12-bit) optimized 2-image merge. */ 
    71   private static final int MERGE_OPT12 = 6; 
    72  
    73   /** 
    74    * As above except convert look up table saved after the notes in file, 
    75    * as opposed to at the end of each image data. 
    76    */ 
    77   private static final int MERGE_OPT12_V2 = 7; 
    78  
    7950  /** List of merge types. */ 
    8051  private static final String[] MERGE_NAMES = { 
    8152    "MERGE_OFF", "MERGE_16", "MERGE_ALTERNATE", "MERGE_COLUMN", "MERGE_ROW", 
    8253    "MERGE_MAXIMUM", "MERGE_OPT12", "MERGE_OPT12_V2" 
    83   }; 
    84  
    85   // Look-up table constants 
    86  
    87   /** A red pane appears on the screen. */ 
    88   private static final int RED_LUT = 0x01; 
    89  
    90   /** A green pane appears on the screen. */ 
    91   private static final int GREEN_LUT = 0x02; 
    92  
    93   /** A blue pane appears on the screen. */ 
    94   private static final int BLUE_LUT = 0x04; 
    95  
    96   /** List of allowed variable names for NOTE_TYPE_VARIABLE notes. */ 
    97   private static final String[] NOTE_VAR_NAMES = { 
    98     "SCALE_FACTOR", "LENS_MAGNIFICATION", "RAMP_GAMMA1", "RAMP_GAMMA2", 
    99     "RAMP_GAMMA3", "RAMP1_MIN", "RAMP2_MIN", "RAMP3_MIN", "RAMP1_MAX", 
    100     "RAMP2_MAX", "RAMP3_MAX", "PIC_FF_VERSION", "Z_CORRECT_FACTOR" 
    10154  }; 
    10255 
  • trunk/loci/formats/in/CBZip2InputStream.java

    r1124 r1200  
    3939        System.out.println("CRC Error"); 
    4040        //throw new CCoruptionError(); 
    41     } 
    42  
    43     private static void badBGLengths() { 
    44         cadvise(); 
    45     } 
    46  
    47     private static void bitStreamEOF() { 
    48         cadvise(); 
    4941    } 
    5042 
  • trunk/loci/formats/in/DeltavisionReader.java

    r1198 r1200  
    385385    metadata.put("Z origin (in um)", new Float(Float.intBitsToFloat( 
    386386      DataTools.bytesToInt(header, 216, 4, little)))); 
    387     int numTitles = DataTools.bytesToInt(header, 220, 4, little); 
    388387 
    389388    order = dimOrder; 
  • trunk/loci/formats/in/DicomReader.java

    r1198 r1200  
    5656  private static final int RESCALE_INTERCEPT = 0x00281052; 
    5757  private static final int RESCALE_SLOPE = 0x00281053; 
    58   private static final int RED_PALETTE = 0x00281201; 
    59   private static final int GREEN_PALETTE = 0x00281202; 
    60   private static final int BLUE_PALETTE = 0x00281203; 
    6158  private static final int ICON_IMAGE_SEQUENCE = 0x00880200; 
    6259  private static final int ITEM = 0xFFFEE000; 
     
    9996  private int elementLength; 
    10097  private int vr; 
    101   private int previousGroup; 
    102   private String previousInfo; 
    10398  private boolean oddLocations; 
    10499  private boolean inSequence; 
     
    303298 
    304299    boolean decodingTags = true; 
    305     boolean signed = false; 
    306300 
    307301    while (decodingTags) { 
     
    380374        case PIXEL_REPRESENTATION: 
    381375          int pixelRepresentation = in.readShort(); 
    382           signed = pixelRepresentation == 1; 
    383376          addInfo(tag, pixelRepresentation); 
    384377          break; 
     
    449442    if (inSequence && info != null && vr != SQ) info = ">" + info; 
    450443    if (info != null && tag != ITEM) { 
    451       int group = tag >>> 16; 
    452       previousGroup = group; 
    453       previousInfo = info; 
    454  
    455444      String key = (String) TYPES.get(new Integer(tag)); 
    456445      if (key == null) key = "" + tag; 
  • trunk/loci/formats/in/FluoviewReader.java

    r1198 r1200  
    5050  /** Fluoview TIFF private tags */ 
    5151  private static final int MMHEADER = 34361; 
    52   private static final int MMSTAMP = 34362; 
    53   private static final int MMUSERBLOCK = 34386; 
    5452 
    5553  // -- Fields -- 
     
    231229      // -- Parse OME-XML metadata -- 
    232230 
    233       Object off; 
    234       String data; 
    235       long newNum = 0; 
    236       Object obj = new Object(); 
     231      Object off = (Object) ifd.get(new Integer(MMHEADER)); 
    237232      float origin = 0; 
    238  
    239       // set file to the right place 
    240       off = (Object) ifd.get(new Integer(MMHEADER)); 
    241233 
    242234      float stageX = 0; 
     
    256248          } 
    257249 
    258           newNum = in.readInt(); 
     250          in.skipBytes(4); 
    259251          origin = (float) in.readDouble(); 
    260252          if (j == 1) stageX = origin; 
  • trunk/loci/formats/in/GatanReader.java

    r1198 r1200  
    158158    int channels = 1; 
    159159 
    160     int numSamples = width * height; 
    161  
    162160    return ImageTools.makeImage(pixelData, width, height, channels, 
    163161      false, dims[2], littleEndian); 
     
    185183    } 
    186184 
    187     in.read(temp); 
    188     int numBytes = DataTools.bytesToInt(temp, littleEndian); 
     185    in.skipBytes(4); 
    189186    in.read(temp); 
    190187    if (DataTools.bytesToInt(temp, littleEndian) == 1) littleEndian = true; 
  • trunk/loci/formats/in/GelReader.java

    r1134 r1200  
    4141  private static final int MD_FILETAG = 33445; 
    4242  private static final int MD_SCALE_PIXEL = 33446; 
    43   private static final int MD_COLOR_TABLE = 33447; 
    4443  private static final int MD_LAB_NAME = 33448; 
    4544  private static final int MD_SAMPLE_INFO = 33449; 
     
    7776 
    7877    numImages--; 
    79     //super.initMetadata(); 
    80     boolean little = true; 
    81     try { 
    82       little = TiffTools.isLittleEndian(ifds[0]); 
    83     } 
    84     catch (FormatException e) { } 
    8578 
    8679    try { 
  • trunk/loci/formats/in/ICSReader.java

    r1198 r1200  
    158158    int width = dimensions[1]; 
    159159    int height = dimensions[2]; 
    160     int numSamples = width * height; 
    161     int channels = 1; 
    162160 
    163161    int offset = width * height * (dimensions[0] / 8) * no; 
     
    190188    int width = dimensions[1]; 
    191189    int height = dimensions[2]; 
    192     int numSamples = width * height; 
    193190    int channels = 1; 
    194191 
  • trunk/loci/formats/in/IPLabReader.java

    r1198 r1200  
    290290          in.readInt(); 
    291291          int type = in.readInt(); 
    292           String clutType; 
     292 
     293          String clutType = "unknown"; 
    293294          switch ((int) type) { 
    294295            case 0: clutType = "monochrome"; break; 
     
    305306            case 11: clutType = "saturated pixels"; break; 
    306307          } 
     308          metadata.put("LUT type", clutType); 
    307309        } 
    308310        else { 
     
    367369        // read in ROI information 
    368370 
    369         int size = in.readInt(); 
    370         int roiType = in.readInt(); 
     371        in.skipBytes(8); 
    371372        int roiLeft = in.readInt(); 
    372373        int roiTop = in.readInt(); 
     
    382383          x0, y0, null, x1, y1, null, null, null, null, null); 
    383384 
    384         for (int i=0; i<numRoiPts; i++) { 
    385           int ptX = in.readInt(); 
    386           int ptY = in.readInt(); 
    387         } 
     385        in.skipBytes(8 * numRoiPts); 
    388386      } 
    389387      else if (tag.equals("mask")) { 
  • trunk/loci/formats/in/ImageJReader.java

    r1134 r1200  
    162162      r.exec("image = opener.openImage(dir, name)"); 
    163163      r.exec("size = image.getStackSize()"); 
    164       int size = ((Integer) r.getVar("size")).intValue(); 
    165164      Image img = (Image) r.exec("image.getImage()"); 
    166165 
  • trunk/loci/formats/in/ImarisReader.java

    r1198 r1200  
    209209    float dy = in.readFloat(); 
    210210    float dz = in.readFloat(); 
    211     short mag = in.readShort(); 
     211    in.readShort(); 
    212212 
    213213    byte[] com = new byte[128]; 
  • trunk/loci/formats/in/LIFReader.java

    r1198 r1200  
    4141 
    4242  /** Current file. */ 
    43   protected RandomAccessStream in; 
     43  protected RandomAccessFile in; 
    4444 
    4545  /** Flag indicating whether current file is little endian. */ 
     
    243243  protected void initFile(String id) throws FormatException, IOException { 
    244244    super.initFile(id); 
    245     in = new RandomAccessStream(id); 
     245    in = new RandomAccessFile(id, "r"); 
    246246    offsets = new Vector(); 
    247247 
    248248    littleEndian = true; 
    249     in.order(littleEndian); 
    250249 
    251250    // read the header 
     
    258257    } 
    259258 
    260     int chunkLength = in.readInt(); 
     259    in.skipBytes(4); 
    261260 
    262261    // read and parse the XML description 
     
    268267    // number of Unicode characters in the XML block 
    269268 
    270     int nc = in.readInt(); 
     269    int nc = DataTools.read4SignedBytes(in, littleEndian); 
    271270    byte[] s = new byte[nc * 2]; 
    272271    in.read(s); 
     
    274273 
    275274    while (in.getFilePointer() < in.length()) { 
    276       if (in.readInt() != 0x70) { 
     275      if (DataTools.read4SignedBytes(in, littleEndian) != 0x70) { 
    277276        throw new FormatException("Invalid Memory Block"); 
    278277      } 
    279278 
    280       int memLength = in.readInt(); 
     279      in.skipBytes(4); 
    281280      if (in.read() != 0x2a) { 
    282281        throw new FormatException("Invalid Memory Description"); 
    283282      } 
    284283 
    285       int blockLength = in.readInt(); 
     284      int blockLength = DataTools.read4SignedBytes(in, littleEndian); 
    286285      if (in.read() != 0x2a) { 
    287286        throw new FormatException("Invalid Memory Description"); 
    288287      } 
    289288 
    290       int descrLength = in.readInt(); 
     289      int descrLength = DataTools.read4SignedBytes(in, littleEndian); 
    291290      byte[] memDescr = new byte[2*descrLength]; 
    292291      in.read(memDescr); 
    293       String descr = DataTools.stripString(new String(memDescr)); 
    294292 
    295293      if (blockLength > 0) { 
     
    330328    int ndx = 1; 
    331329    numImages = 0; 
    332     int dimCounter = 0; 
    333     int lutCounter = 0; 
    334330 
    335331    // the image data we need starts with the token "ElementName='blah'" and 
  • trunk/loci/formats/in/LeicaReader.java

    r1198 r1200  
    207207      throw new FormatException("Invalid image number: " + no); 
    208208    } 
     209 
    209210    return tiff.openImage(files[no], 0); 
    210211  } 
     
    241242 
    242243      if (ifds == null) throw new FormatException("No IFDs found"); 
     244 
     245      /* debug */ 
     246      int[] thumb = (int[]) TiffTools.getIFDValue(ifds[0], LEICA_MAGIC_TAG); 
     247      byte[] thumb2 = new byte[thumb.length]; 
     248      for (int i=0; i<thumb.length; i++) { 
     249        thumb2[i] = (byte) thumb[i]; 
     250      } 
     251      RandomAccessFile writer = new RandomAccessFile("thumb", "rw"); 
     252      writer.write(thumb2); 
     253      writer.close(); 
     254      /* end debug*/ 
    243255 
    244256      String descr = (String) metadata.get("Comment"); 
     
    318330        v.add(ifd); 
    319331 
    320         in.seek(addr); 
    321  
    322         int numEntries = in.readInt(); 
     332        in.seek(addr + 4); 
     333 
    323334        int tag = in.readInt(); 
    324335 
    325         int numIFDs = 0; 
    326336        while (tag != 0) { 
    327337          // create the IFD structure 
  • trunk/loci/formats/in/MetamorphReader.java

    r1198 r1200  
    4343  // IFD tag numbers of important fields 
    4444  private static final int METAMORPH_ID = 33629; 
    45   private static final int UIC1TAG = 33628; 
    4645  private static final int UIC2TAG = 33629; 
    47   private static final int UIC3TAG = 33630; 
    4846  private static final int UIC4TAG = 33631; 
    4947 
    5048  // -- Fields -- 
    51   private int numPlanes; 
    5249 
    5350  /** The TIFF's name */ 
     
    117114    long[] uic2 = TiffTools.getIFDLongArray(ifds[0], UIC2TAG, true); 
    118115    numImages = uic2.length; 
    119     numPlanes = numImages; 
    120116 
    121117    // copy ifds into a new array of Hashtables that will accomodate the 
     
    199195      super.initStandardMetadata(); 
    200196 
    201       Integer obj = new Integer(0); 
    202  
    203197      int offset; 
    204198 
     
    227221 
    228222      int planes = v[1].intValue(); 
    229       boolean little = TiffTools.isLittleEndian(ifd); 
    230223 
    231224      while ((currentcode < 66) && ((in.length() - in.getFilePointer()) > 2)) { 
  • trunk/loci/formats/in/NikonReader.java

    r1195 r1200  
    205205          Enumeration e = exifIFD.keys(); 
    206206          Integer key; 
    207           String id; 
    208207          while (e.hasMoreElements()) { 
    209208            key = (Integer) e.nextElement(); 
     
    224223        Enumeration e = makerNote.keys(); 
    225224        Integer key; 
    226         String id; 
    227225        while (e.hasMoreElements()) { 
    228226          key = (Integer) e.nextElement(); 
  • trunk/loci/formats/in/OLEParser.java

    r1195 r1200  
    8585  private HashSet read; 
    8686 
    87   /** Last property array index parsed. */ 
    88   private int last; 
    89  
    9087  /** Whether or not we've parsed all of the property array entries. */ 
    9188  private boolean parsedAll = false; 
     
    133130    } 
    134131 
    135     in.skipBytes(16); 
    136  
    137     short revision = DataTools.read2SignedBytes(in, true); 
    138     short version = DataTools.read2SignedBytes(in, true); 
    139  
    140     in.skipBytes(2); 
     132    in.skipBytes(18); 
    141133 
    142134    bigBlock = (int) Math.pow(2, DataTools.read2SignedBytes(in, true)); 
     
    152144    int sbatIndex = DataTools.read4SignedBytes(in, true); 
    153145    int numSbatBlocks = DataTools.read4SignedBytes(in, true); 
    154     int xbatIndex = DataTools.read4SignedBytes(in, true); 
     146    //int xbatIndex = DataTools.read4SignedBytes(in, true); 
    155147    int numXbatBlocks = DataTools.read4SignedBytes(in, true); 
    156148 
     
    312304        System.arraycopy(propertyArray, ndx*128, table, 0, table.length); 
    313305 
    314         last = ndx; 
    315  
    316306        indices.add(new Integer(ndx)); 
    317307 
     
    334324        } 
    335325 
    336         short numNameChars = DataTools.bytesToShort(table, 64, 2, true); 
    337326        byte propType = table[66]; // 1 = dir, 2 = file, 5 = root 
    338327        byte nodeColor = table[67]; // 0 = red, 1 = black 
     
    340329        int nextIndex = DataTools.bytesToInt(table, 72, 4, true); 
    341330        int firstChildIndex = DataTools.bytesToInt(table, 76, 4, true); 
    342         int createdSeconds = DataTools.bytesToInt(table, 100, 4, true); 
    343         int createdDays = DataTools.bytesToInt(table, 104, 4, true); 
    344         int modifiedSeconds = DataTools.bytesToInt(table, 108, 4, true); 
    345         int modifiedDays = DataTools.bytesToInt(table, 112, 4, true); 
    346331        int firstBlock = DataTools.bytesToInt(table, 116, 4, true); 
    347332        int fileSize = DataTools.bytesToInt(table, 120, 4, true); 
  • trunk/loci/formats/in/OMEXMLReader.java

    r1198 r1200  
    225225        decompressor.setInput(pixels, 0, pixels.length); 
    226226        pixels = new byte[width * height * bpp]; 
    227         int resultLength = decompressor.inflate(pixels); 
     227        decompressor.inflate(pixels); 
    228228        decompressor.end(); 
    229229      } 
  • trunk/loci/formats/in/OpenlabReader.java

    r1198 r1200  
    209209 
    210210    int length = b.length; 
    211     int num, size, blockEnd; 
     211    int num, size; 
    212212    int totalBlocks = -1; // set to allow loop to start. 
    213213    int expectedBlock = 0; 
     
    217217    short[] flatSamples = new short[imageSize]; 
    218218    byte[] temp; 
    219     boolean skipflag; 
    220219 
    221220    sizeX = new Integer(dim.width); 
     
    230229    // check whether or not there is deep gray data 
    231230    while (expectedBlock != totalBlocks) { 
    232       skipflag = false; 
    233231 
    234232      while (pos + 7 < length && 
     
    287285      size = batoi(temp); 
    288286      pos += 8; 
    289       blockEnd = pos + size; 
    290287 
    291288      // copy into our data array. 
     
    335332    long order = in.readInt(); 
    336333    little = order == 0x0000ffff; 
    337     //in.order(little); 
    338334 
    339335    Vector v = new Vector(); // a temp vector containing offsets. 
     
    581577    byte[] toRead = new byte[blockSize]; 
    582578    in.read(toRead); 
    583     byte[] pixelData = new byte[blockSize]; 
    584     int pixPos = 0; 
    585579 
    586580    Dimension dim; 
     
    589583 
    590584    int length = toRead.length; 
    591     int num, size, blockEnd; 
    592585    int totalBlocks = -1; // set to allow loop to start. 
    593586    int expectedBlock = 0; 
    594587    int pos = 0; 
    595     int imagePos = 0; 
    596     int imageSize = dim.width * dim.height; 
    597     short[] flatSamples = new short[imageSize]; 
    598     byte[] temp; 
    599     boolean skipflag; 
    600588 
    601589    sizeX = new Integer(dim.width); 
     
    603591 
    604592    if (expectedBlock != totalBlocks) { 
    605       skipflag = false; 
    606593 
    607594      while (pos + 7 < length && 
  • trunk/loci/formats/in/PerkinElmerReader.java

    r1198 r1200  
    285285      int pt = 0; 
    286286      while (t.hasMoreTokens()) { 
    287         if (tNum < 7) { String temp = t.nextToken(); } 
     287        if (tNum < 7) { t.nextToken(); } 
    288288        else if ((tNum > 7 && tNum < 12) || (tNum > 12 && tNum < 18) || 
    289289          (tNum > 18 && tNum < 22)) { 
    290           String temp = t.nextToken(); 
     290          t.nextToken(); 
    291291        } 
    292292        else if (pt < hashKeys.length) { 
     
    342342      } 
    343343 
    344       int slice = 0; 
    345344      for (int j=0; j<tokens.length-1; j+=2) { 
    346345        if (tokens[j].indexOf("Wavelength") != -1) { 
     
    362361    t = new StringTokenizer(details); 
    363362    int tokenNum = 0; 
    364     String timePoints = "1"; 
    365363    String wavelengths = "1"; 
    366364    int numTokens = t.countTokens(); 
     
    369367        wavelengths = (String) t.nextToken(); 
    370368      } 
    371       else if (tokenNum == numTokens - 4) { 
    372         timePoints = (String) t.nextToken(); 
    373       } 
    374369      else { 
    375         String temp = t.nextToken(); 
     370        t.nextToken(); 
    376371      } 
    377372      tokenNum++; 
  • trunk/loci/formats/in/PictReader.java

    r1198 r1200  
    4848  private static final int PICT_PACKBITSRGN = 0x99; 
    4949  private static final int PICT_9A = 0x9a; 
    50   private static final int PICT_HEADER = 0xc00; 
    5150  private static final int PICT_END = 0xff; 
    5251  private static final int PICT_LONGCOMMENT = 0xa1; 
     
    405404  private boolean driveDecoder() throws FormatException { 
    406405    if (DEBUG) System.out.println("PictReader.driveDecoder"); 
    407     int opcode, version; 
     406    int opcode; 
    408407 
    409408    switch (pictState) { 
    410409      case INITIAL: 
    411         int ret; 
    412         int fileSize = DataTools.bytesToInt(bytes, pt, 2, little); 
    413410        pt += 2; 
    414411        // skip over frame 
     
    422419        else if (verOpcode == 0x00 && verNumber == 0x11) { 
    423420          versionOne = false; 
    424           int verOpcode2 = 0x0011; 
    425421          int verNumber2 = DataTools.bytesToInt(bytes, pt, 2, little); 
    426422          pt += 2; 
     
    461457  private boolean drivePictDecoder(int opcode) throws FormatException { 
    462458    if (DEBUG) System.out.println("PictReader.drivePictDecoder"); 
    463     short size, kind; 
    464459 
    465460    switch (opcode) { 
     
    525520 
    526521    // skip next two rectangles 
    527     pt += 16; 
    528     int mode = DataTools.bytesToInt(bytes, pt, 2, little); 
    529     pt += 2; 
     522    pt += 18; 
    530523 
    531524    width = brX - tlX; 
     
    596589      pt += 4; // skip fake length and fake EOF 
    597590 
    598       int version = DataTools.bytesToInt(bytes, pt, 2, little); 
    599591      pt += 2; 
    600592 
     
    611603      pt += 2; // undocumented extra short in the data structure 
    612604 
    613       int packType = DataTools.bytesToInt(bytes, pt, 2, little); 
    614       pt += 2; 
    615       int packSize = DataTools.bytesToInt(bytes, pt, 4, little); 
    616       pt += 4; 
    617       int hRes = DataTools.bytesToInt(bytes, pt, 4, little); 
    618       pt += 4; 
    619       int vRes = DataTools.bytesToInt(bytes, pt, 4, little); 
    620       pt += 4; 
    621  
    622       int pixelType = DataTools.bytesToInt(bytes, pt, 2, little); 
    623       pt += 2; 
     605      pt += 16; 
     606 
    624607      pixelSize = DataTools.bytesToInt(bytes, pt, 2, little); 
    625608      pt += 2; 
    626609      compCount = DataTools.bytesToInt(bytes, pt, 2, little); 
    627       pt += 2; 
    628       int compSize = DataTools.bytesToInt(bytes, pt, 2, little); 
    629       pt += 2; 
    630  
    631       int planeBytes = DataTools.bytesToInt(bytes, pt, 4, little); 
    632       pt += 4; 
    633       int pmTable = DataTools.bytesToInt(bytes, pt, 4, little); 
    634       pt += 4; 
    635  
    636       pt += 4; // reserved 
     610      pt += 16; // reserved 
    637611 
    638612      width = brX - tlX; 
     
    676650      // read the lookup table 
    677651 
    678       pt += 2; 
    679       int id = DataTools.bytesToInt(bytes, pt, 2, little); 
    680       pt += 2; 
     652      pt += 4; 
    681653      int flags = DataTools.bytesToInt(bytes, pt, 2, little); 
    682654      pt += 2; 
     
    704676 
    705677    // skip over two rectangles 
    706     pt += 16; 
    707  
    708     int mode = DataTools.bytesToInt(bytes, pt, 2, little); 
    709     pt += 2; 
     678    pt += 18; 
    710679 
    711680    if (opcode == PICT_BITSRGN || opcode == PICT_PACKBITSRGN) { 
    712       int x = DataTools.bytesToInt(bytes, pt, 2, little); 
    713681      pt += 2; 
    714682    } 
  • trunk/loci/formats/in/QTReader.java

    r1198 r1200  
    346346      int temp = offset; 
    347347      offset = nextOffset; 
    348       nextOffset = offset; 
     348      nextOffset = temp; 
    349349    } 
    350350 
     
    462462      int temp = offset; 
    463463      offset = nextOffset; 
    464       nextOffset = offset; 
     464      nextOffset = temp; 
    465465    } 
    466466 
     
    505505    super.initFile(id); 
    506506    in = new RandomAccessFile(id, "r"); 
    507     //in.order(little); 
    508507 
    509508    spork = true; 
     
    832831 
    833832      // number of compressed bytes (minus padding) 
    834       int size = DataTools.bytesToInt(input, pt, 4, little); 
    835833      pt += 4; 
    836834 
    837835      // number of compressed bytes (including padding) 
    838       int padSize = DataTools.bytesToInt(input, pt, 4, little); 
    839836      pt += 4; 
    840837 
     
    955952 
    956953    ByteVector b = new ByteVector(); 
    957     int tempPt = 0; 
    958954    for (int i=0; i<raw.length; i++) { 
    959955      b.add((byte) raw[i]); 
     
    965961    if (raw2 == null) raw2 = new byte[0]; 
    966962    ByteVector b2 = new ByteVector(); 
    967     tempPt = 0; 
    968963    for (int i=0; i<raw2.length; i++) { 
    969964      b2.add((byte) raw2[i]); 
     
    11561151 
    11571152    // read the 4 byte chunk length; this should equal input.length 
    1158  
    1159     int length = DataTools.bytesToInt(input, 0, 4, little); 
    11601153 
    11611154    // now read the header 
  • trunk/loci/formats/in/RedBlackTree.java

    r1124 r1200  
    3636  // -- Constants -- 
    3737 
    38   private static final int RED = 0, BLACK = 1; 
    39   private static final int ROOT = 5, FILE = 2, DIRECTORY = 1; 
     38  private static final int ROOT = 5, FILE = 2; 
    4039 
    4140  // -- Fields -- 
     
    7978    // search for the parent 
    8079 
    81     boolean found = false; 
    82     Vector toSearch = root.children; 
    8380    RedBlackTreeNode parentNode = bfs(parent); 
    8481 
  • trunk/loci/formats/in/RedBlackTreeNode.java

    r1124 r1200  
    4646  public int depth; 
    4747 
    48   /** Color of the node. */ 
    49   private int color; 
    50  
    5148  /** Node type. */ 
    5249  private int type; 
     
    6966    int firstDataBlock, int fileSize) 
    7067  { 
    71     this.color = color; 
    7268    this.type = type; 
    7369    this.block = block; 
  • trunk/loci/formats/in/SEQReader.java

    r1195 r1200  
    5252  /** Frame rate. */ 
    5353  private static final int IMAGE_PRO_TAG_2 = 40105; 
    54  
    55   /** Guessing this is thumbnail pixel data. */ 
    56   private static final int IMAGE_PRO_TAG_3 = 40106; 
    5754 
    5855 
  • trunk/loci/formats/in/ZeissLSMReader.java

    r1198 r1200  
    174174    int idata = 0; 
    175175    double ddata = 0; 
    176     short sdata = 0; 
     176    //short sdata = 0; 
    177177 
    178178    try { 
     
    273273 
    274274      short[] omeData = TiffTools.getIFDShortArray(ifd, ZEISS_ID, true); 
    275       int magicNum = DataTools.bytesToInt(omeData, 0, little); 
    276  
    277 //      int photoInterp2 = TiffTools.getIFDIntValue(ifd, 
    278 //        TiffTools.PHOTOMETRIC_INTERPRETATION, true, 0); 
    279 //      String photo2; 
    280 //      switch (photoInterp2) { 
    281 //        case 0: photo2 = "monochrome"; break; 
    282 //        case 1: photo2 = "monochrome"; break; 
    283 //        case 2: photo2 = "RGB"; break; 
    284 //        case 3: photo2 = "monochrome"; break; 
    285 //        case 4: photo2 = "RGB"; break; 
    286 //        default: photo2 = "monochrome"; 
    287 //      } 
    288 //      OMETools.setAttribute(ome, 
    289 //        "ChannelInfo", "PhotometricInterpretation", photo2); 
    290275 
    291276      int imageWidth = DataTools.bytesToInt(omeData, 8, little); 
     
    363348        pos = in.getFilePointer(); 
    364349 
    365         in.seek(data); 
    366  
    367         int blockSize = in.readInt(); 
     350        in.seek(data + 4); 
     351 
    368352        int numColors = in.readInt(); 
    369353        int numNames = in.readInt(); 
    370354        idata = in.readInt(); 
    371         long offset = data + idata; // will seek to this later 
    372355        idata = in.readInt(); 
    373356        long offsetNames = data + idata; // will seek to this 
  • trunk/loci/formats/in/ZeissZVIReader.java

    r1198 r1200  
    5050 
    5151  // -- Fields used by parseDir -- 
    52   private int counter = 0;  // the number of the Image entry 
    5352  private int imageWidth = 0; 
    5453  private int imageHeight = 0; 
     
    6160  private int bitsPerSample; 
    6261  private int dataLength; 
    63   private int len; 
    6462  private int shuffle; 
    65   private int previousCut; 
    6663 
    6764  private String typeAsString; 
     
    7067  private int tSize; 
    7168  private int cSize; 
    72   private int oldBpp; 
    7369 
    7470  // -- Constructor -- 
     
    181177        pointer += 4 + 2; 
    182178 
    183         int depth = DataTools.bytesToInt(imageHead, pointer, 4, true); 
    184179        pointer += 4 + 2; 
    185180 
     
    195190 
    196191        pointer = 0; 
    197         int numSamples = width*height; 
    198192        bitsPerSample = validBPP; 
    199  
    200         /* 
    201         switch (pixelFormat) { 
    202           case 1: channels = 3; break; 
    203           case 2: channels = 4; break; 
    204           case 3: channels = 1; break; 
    205           case 4: channels = 1; break; 
    206           case 6: channels = 1; break; 
    207           case 8: channels = 3; break; 
    208           default: channels = 1; 
    209         } 
    210         */ 
    211193 
    212194        if ((width > imageWidth) && (imageWidth > 0)) { 
     
    310292      } 
    311293 
    312       //bitsPerSample = tbitsPerSample; 
    313       //bytesPerPixel = tbytesPerPixel; 
    314  
    315294      if (!isRGB(id) || !separated) { 
    316295        return tempPx; 
     
    335314    if (bpp == 0) bpp = bytesPerPixel; 
    336315    if (bpp > 4) bpp /= 3; 
    337     //if (bpp == 0) bpp = oldBpp; 
    338    // else oldBpp = bpp; 
    339316    return ImageTools.makeImage(data, width, height, 
    340317      (!isRGB(id) || separated) ? 1 : 3, true, bpp, false); 
     
    439416                imageNum = Integer.parseInt(s); 
    440417                num = num.substring(0, num.lastIndexOf("Item")); 
    441  
    442                 /* 
    443                 String s = num.substring(num.lastIndexOf("Item") + 5, 
    444                   num.lastIndexOf(")")); 
    445                 imageNum = Integer.parseInt(s); 
    446                 num = num.substring(0, num.lastIndexOf("Item")); 
    447                 */ 
    448418              } 
    449419            } 
     
    580550            } 
    581551          } 
    582           //else break; 
    583552          else { 
    584553            if (legacy.getImageCount(id) == 1) break; 
     
    623592 
    624593      header = (byte[]) files[1].get(largestIndex); 
    625       String pathName = (String) files[0].get(largestIndex); 
    626  
    627       int imageNum = 0; 
    628       if (pathName.indexOf("Item") != -1) { 
    629         String num = pathName.substring(pathName.indexOf("Item") + 5, 
    630           pathName.indexOf(")")); 
    631         imageNum = Integer.parseInt(num); 
    632       } 
    633594 
    634595      int byteCount = 166; 
     
    757718    for (int k=0; k<tags.size(); k++) { 
    758719      byte[] tag = (byte[]) tags.get(k); 
    759       pt = 16; 
    760  
    761       int w = DataTools.bytesToInt(tag, pt, 2, true); 
    762       pt += 2; 
    763  
    764       int majorVersion = DataTools.bytesToInt(tag, pt, 2, true); 
    765       pt += 2; 
    766       int minorVersion = DataTools.bytesToInt(tag, pt, 2, true); 
    767       pt += 2; 
    768  
    769       w = DataTools.bytesToInt(tag, pt, 2, true); 
    770       pt += 2; 
     720      pt = 24; 
    771721 
    772722      int numTags = DataTools.bytesToInt(tag, pt, 4, true); 
     
    14541404 
    14551405    // Default values 
    1456     Integer sizeX = (Integer) metadata.get("ImageWidth"); 
    1457     Integer sizeY = (Integer) metadata.get("ImageHeight"); 
    14581406    Integer sizeZ = new Integer(1); 
    14591407    Integer sizeC = new Integer(1); 
     
    14691417 
    14701418    dimensionOrder = "XYZCT"; 
    1471  
    1472     // If we have a legacy datafile the attribute names are different. 
    1473     if (needLegacy) { 
    1474       sizeX = (Integer) metadata.get("Width"); 
    1475       sizeY = (Integer) metadata.get("Height"); 
    1476     } 
    14771419 
    14781420    Object mce = metadata.get("MultiChannelEnabled"); 
  • trunk/loci/formats/out/AVIWriter.java

    r1124 r1200  
    5151  private int xDim, yDim, zDim, tDim, xPad; 
    5252  private int microSecPerFrame; 
    53   private int[] dcLength; 
    5453 
    5554  // location of file size in bytes not counting first 8 bytes 
     
    5958  // bytes with LIST and size. JUNK follows the end of this CHUNK 
    6059  private long saveLIST1Size; 
    61  
    62   private int[] extents; 
    6360 
    6461  // location of length of CHUNK with second LIST - not including first 8 
     
    7269  private long savestrfSize; 
    7370 
    74   private int resXUnit = 0; 
    75   private int resYUnit = 0; 
    76   private float xResol = 0.0f; // in distance per pixel 
    77   private float yResol = 0.0f; // in distance per pixel 
    78   private long biXPelsPerMeter = 0L; 
    79   private long biYPelsPerMeter = 0L; 
    80   private byte[] strnSignature; 
    8171  private byte[] text; 
    8272  private long savestrnPos; 
     
    8575  private long saveLIST2Size; 
    8676  private byte[] dataSignature; 
    87   private byte[] idx1Signature; 
    8877  private Vector savedbLength; 
    89   private long savedcLength[]; 
    9078  private long idx1Pos; 
    9179  private long endPos; 
    9280  private long saveidx1Length; 
    93   private int t,z; 
     81  private int z; 
    9482  private long savemovi; 
    9583  private int xMod; 
     
    428416      DataTools.writeString(raFile, "movi"); // Write CHUNK type 'movi' 
    429417      savedbLength = new Vector(); 
    430       savedcLength = new long[tDim * zDim]; 
    431       dcLength = new int[tDim * zDim]; 
    432418 
    433419      dataSignature = new byte[4]; 
  • trunk/loci/formats/out/LegacyQTWriter.java

    r1124 r1200  
    4444  /** Time scale. */ 
    4545  private static final int TIME_SCALE = 600; 
    46   private static final int KEY_FRAME_RATE = 30; 
    4746 
    4847  // -- Fields -- 
  • trunk/loci/formats/out/QTWriter.java

    r1124 r1200  
    189189    byte[][] temp = byteData; 
    190190    byteData = new byte[temp.length][temp[0].length + height*pad]; 
    191  
    192     int newScanline = height - 1; 
    193191 
    194192    for (int oldScanline=0; oldScanline<height; oldScanline++) { 
  • trunk/loci/formats/out/TiffWriter.java

    r1124 r1200  
    3535 
    3636  // -- Fields -- 
    37  
    38   /** The current IFD, containing metadata for the plane(s) to be written. */ 
    39   private Hashtable currentIFD; 
    4037 
    4138  /** The last offset written to. */ 
Note: See TracChangeset for help on using the changeset viewer.