Changeset 2313


Ignore:
Timestamp:
02/22/07 10:13:03 (13 years ago)
Author:
melissa
Message:

All readers now minimally populate the LogicalChannel ST.

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

Legend:

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

    r2291 r2313  
    520520    sizeC[0] = isRGB(id) ? 3 : 1; 
    521521    sizeT[0] = numImages; 
    522     pixelType[0] = FormatReader.UINT8; 
    523522    currentOrder[0] = sizeC[0] == 3 ? "XYCTZ" : "XYTCZ"; 
    524523 
    525     initOMEMetadata(); 
    526   } 
    527  
    528   // -- AVIReader API methods -- 
    529  
    530   /** Initialize the OME-XML tree. */ 
    531   public void initOMEMetadata() throws FormatException, IOException { 
    532524    int bitsPerPixel = ((Integer) getMeta("Bits per pixel")).intValue(); 
    533525    int bytesPerPixel = bitsPerPixel / 8; 
     
    541533          "Unknown matching for pixel bit width of: " + bitsPerPixel); 
    542534 
    543     String order = "XY"; 
    544     if (bytesPerPixel == 3) order += "CTZ"; 
    545     else order += "TCZ"; 
    546  
    547     getMetadataStore(currentId).setPixels( 
    548       (Integer) getMeta("Frame width"), // SizeX 
    549       (Integer) getMeta("Frame height"), // SizeY 
     535    MetadataStore store = getMetadataStore(currentId); 
     536    store.setPixels(new Integer(sizeX[0]), new Integer(sizeY[0]), 
    550537      new Integer(1), // SizeZ 
    551       new Integer(bytesPerPixel), // SizeC 
     538      new Integer(sizeC[0]), // SizeC 
    552539      new Integer(numImages), // SizeT 
    553540      new Integer(pixelType[0]), // PixelType 
    554541      new Boolean(!little), // BigEndian 
    555       order, // DimensionOrder 
     542      currentOrder[0], // DimensionOrder 
    556543      null, // Use image index 0 
    557544      null); // Use pixels index 0 
    558   } 
     545   
     546    for (int i=0; i<sizeC[0]; i++) { 
     547      store.setLogicalChannel(i, null, null, null, null,  
     548        sizeC[0] == 1 ? "monochrome" : "RGB", null, null); 
     549    } 
     550  } 
     551 
     552  // -- AVIReader API methods -- 
    559553 
    560554  /** Reads a 4-byte String. */ 
  • trunk/loci/formats/in/AliconaReader.java

    r2291 r2313  
    239239      new Float(((String) getMeta("PlanePntY")).trim()), 
    240240      new Float(((String) getMeta("PlanePntZ")).trim()), null, null, null); 
    241    
     241  
     242    for (int i=0; i<sizeC[0]; i++) { 
     243      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     244    } 
    242245  } 
    243246 
  • trunk/loci/formats/in/AndorReader.java

    r2219 r2313  
    361361      store.setDimensions(new Float(pixelSizeX), new Float(pixelSizeY), 
    362362        new Float(pixelSizeZ), null, null, null); 
     363      for (int i=0; i<sizeC[0]; i++) { 
     364        store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     365      } 
    363366    } 
    364367    catch (FormatException e) { 
  • trunk/loci/formats/in/BMPReader.java

    r2291 r2313  
    376376    store.setDimensions(new Float(correctedX), new Float(correctedY), null, 
    377377      null, null, null); 
    378    
     378  
     379    for (int i=0; i<sizeC[0]; i++) { 
     380      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     381    } 
    379382  } 
    380383 
  • trunk/loci/formats/in/BioRadReader.java

    r2307 r2313  
    698698   
    699699    for (int i=0; i<sizeC[0]; i++) { 
    700       //setLogicalChannel 
     700      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
    701701      String black = (String) getMeta("PMT " + i + " Black level"); 
    702702      store.setDisplayChannel(new Integer(i), black == null ? null :  
  • trunk/loci/formats/in/DicomReader.java

    r2291 r2313  
    404404    switch (bitsPerPixel) { 
    405405      case 8: 
    406         pixelType[0] = FormatReader.INT8; 
     406        pixelType[0] = FormatReader.UINT8; 
    407407        break; 
    408408      case 16: 
    409         pixelType[0] = FormatReader.INT16; 
     409        pixelType[0] = FormatReader.UINT16; 
    410410        break; 
    411411      case 32: 
    412         pixelType[0] = FormatReader.INT32; 
     412        pixelType[0] = FormatReader.UINT32; 
    413413        break; 
    414414    } 
     
    438438      (String) getMeta("Manufacturer's Model Name"), 
    439439      null, null, null); 
     440 
     441    for (int i=0; i<sizeC[0]; i++) { 
     442      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     443    } 
    440444  } 
    441445 
  • trunk/loci/formats/in/FluoviewReader.java

    r2291 r2313  
    257257        new Float(stageZ), null); 
    258258 
     259      for (int i=0; i<sizeC[0]; i++) { 
     260        store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     261      } 
     262 
    259263      String descr = (String) getMeta("Comment"); 
    260264      metadata.remove("Comment"); 
  • trunk/loci/formats/in/GatanReader.java

    r2291 r2313  
    284284 
    285285    store.setDimensions(pixX, pixY, pixZ, null, null, null); 
    286    
     286  
     287    for (int i=0; i<sizeC[0]; i++) { 
     288      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     289    } 
     290 
    287291  } 
    288292 
  • trunk/loci/formats/in/ICSReader.java

    r2297 r2313  
    457457      null, // Use image index 0 
    458458      null); // Use pixels index 0 
     459   
     460    for (int i=0; i<sizeC[0]; i++) { 
     461      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     462    } 
    459463  } 
    460464 
  • trunk/loci/formats/in/IPLabReader.java

    r2291 r2313  
    275275      null); // Use pixels index 0 
    276276 
     277    for (int i=0; i<sizeC[0]; i++) { 
     278      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     279    } 
     280 
    277281    in.read(fourBytes); 
    278282    String tag = new String(fourBytes); 
  • trunk/loci/formats/in/IPWReader.java

    r2292 r2313  
    403403      new Boolean(!isLittleEndian(id)), getDimensionOrder(id), null, null); 
    404404    store.setImage(null, null, (String) getMeta("Version"), null); 
     405    for (int i=0; i<sizeC[0]; i++) { 
     406      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     407    } 
    405408  } 
    406409 
  • trunk/loci/formats/in/ImarisReader.java

    r2291 r2313  
    162162      new Float(1), 
    163163      null); 
     164   
     165    for (int i=0; i<sizeC[0]; i++) { 
     166      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     167    } 
    164168  } 
    165169 
  • trunk/loci/formats/in/LIFReader.java

    r2292 r2313  
    579579 
    580580      store.setDimensions(xf, yf, zf, null, null, ii); 
     581      for (int j=0; j<sizeC[0]; j++) { 
     582        store.setLogicalChannel(j, null, null, null, null, null, null, ii); 
     583      } 
    581584    } 
    582585  } 
  • trunk/loci/formats/in/LegacyPictReader.java

    r2291 r2313  
    5959  /** Checks if the images in the file are RGB. */ 
    6060  public boolean isRGB(String id) throws FormatException, IOException { 
    61     return true; 
     61    if (!id.equals(currentId)) initFile(id); 
     62    return sizeC[0] > 1; 
    6263  } 
    6364 
     
    112113    if (debug) debug("LegacyPictReader.initFile(" + id + ")"); 
    113114    super.initFile(id); 
    114     sizeX[0] = openImage(id, 0).getWidth(); 
    115     sizeY[0] = openImage(id, 0).getHeight(); 
     115    BufferedImage img = openImage(id, 0); 
     116    sizeX[0] = img.getWidth(); 
     117    sizeY[0] = img.getHeight(); 
    116118    sizeZ[0] = 1; 
    117     sizeC[0] = 3; 
     119    sizeC[0] = img.getRaster().getNumBands(); 
    118120    sizeT[0] = 1; 
    119121    pixelType[0] = FormatReader.INT8; 
    120122    currentOrder[0] = "XYCZT"; 
     123   
     124    MetadataStore store = getMetadataStore(id); 
     125    store.setPixels(new Integer(sizeX[0]), new Integer(sizeY[0]), 
     126      new Integer(1), new Integer(sizeC[0]), new Integer(1), 
     127      new Integer(pixelType[0]), Boolean.TRUE, currentOrder[0], null, null);  
     128     
     129    for (int i=0; i<sizeC[0]; i++) { 
     130      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     131    } 
    121132  } 
    122133 
  • trunk/loci/formats/in/LegacyQTReader.java

    r2291 r2313  
    233233      } 
    234234 
    235       sizeX[0] = ImageTools.makeBuffered(image).getWidth(); 
    236       sizeY[0] = ImageTools.makeBuffered(image).getHeight(); 
     235      BufferedImage img = ImageTools.makeBuffered(image); 
     236 
     237      sizeX[0] = img.getWidth(); 
     238      sizeY[0] = img.getHeight(); 
    237239      sizeZ[0] = 1; 
    238       sizeC[0] = 3; 
     240      sizeC[0] = img.getRaster().getNumBands(); 
    239241      sizeT[0] = numImages; 
    240       pixelType[0] = FormatReader.INT8; 
     242      pixelType[0] = ImageTools.getPixelType(img); 
    241243      currentOrder[0] = "XYCTZ"; 
     244     
     245      MetadataStore store = getMetadataStore(id); 
     246      store.setPixels(new Integer(sizeX[0]), new Integer(sizeY[0]), 
     247        new Integer(1), new Integer(sizeC[0]), new Integer(sizeT[0]), 
     248        new Integer(pixelType[0]), Boolean.TRUE, currentOrder[0], null, null); 
     249     
     250      for (int i=0; i<sizeC[0]; i++) { 
     251        store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     252      } 
    242253    } 
    243254    catch (Exception e) { 
  • trunk/loci/formats/in/LegacyZVIReader.java

    r2291 r2313  
    435435        null, // Use image index 0 
    436436        null); // Use pixels index 0 
     437     
     438      for (int i=0; i<sizeC[0]; i++) { 
     439        store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     440      } 
    437441    } 
    438442 
  • trunk/loci/formats/in/LeicaReader.java

    r2292 r2313  
    11061106      store.setImage(null, timestamp == null ? null : timestamp.substring(3), 
    11071107        description, new Integer(i)); 
     1108     
     1109     
     1110      for (int j=0; j<sizeC[0]; j++) { 
     1111        store.setLogicalChannel(j, null, null, null, null, null,  
     1112          null, new Integer(i)); 
     1113      } 
    11081114    } 
    11091115  } 
  • trunk/loci/formats/in/MRCReader.java

    r2291 r2313  
    344344    store.setDimensions(new Float(xlen / mx), new Float(ylen / my), 
    345345      new Float(zlen / mz), null, null, null); 
     346    for (int i=0; i<sizeC[0]; i++) { 
     347      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     348    } 
    346349  } 
    347350 
  • trunk/loci/formats/in/ND2Reader.java

    r2291 r2313  
    107107      noJ2k = true; 
    108108    } 
    109     return r; 
     109    return ru; 
    110110  } 
    111111 
     
    579579    store.setDimensions(new Float(pixSizeX), new Float(pixSizeX), 
    580580      new Float(pixSizeZ), null, null, null); 
     581    for (int i=0; i<sizeC[0]; i++) { 
     582      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     583    } 
    581584  } 
    582585 
  • trunk/loci/formats/in/OIBReader.java

    r2292 r2313  
    528528        "[Reference Image Parameter] - HeightConvertValue").toString()); 
    529529      store.setDimensions(pixX, pixY, null, null, null, new Integer(i)); 
     530      for (int j=0; j<sizeC[0]; j++) { 
     531        store.setLogicalChannel(j, null, null, null, null, null,  
     532          null, new Integer(i)); 
     533      } 
    530534    } 
    531535  } 
  • trunk/loci/formats/in/OIFReader.java

    r2291 r2313  
    454454 
    455455    store.setDimensions(pixX, pixY, null, null, null, null); 
     456    for (int i=0; i<sizeC[0]; i++) { 
     457      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     458    } 
    456459  } 
    457460 
  • trunk/loci/formats/in/OMEReader.java

    r2291 r2313  
    301301      null, 
    302302      null); 
     303    for (int i=0; i<sizeC[0]; i++) { 
     304      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     305    } 
    303306  } 
    304307   
  • trunk/loci/formats/in/OMEXMLReader.java

    r2307 r2313  
    484484    Arrays.fill(minMaxFinished, false); 
    485485 
     486    for (int i=0; i<sizeC.length; i++) { 
     487      for (int j=0; j<sizeC[i]; j++) { 
     488        store.setLogicalChannel(j, null, null, null, null, null,  
     489          null, new Integer(i)); 
     490      } 
     491    } 
     492 
    486493    try { 
    487494      ome = new OMENode((String) null); 
  • trunk/loci/formats/in/OpenlabRawReader.java

    r2291 r2313  
    231231      null, 
    232232      null); 
     233    for (int i=0; i<sizeC[0]; i++) { 
     234      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     235    } 
    233236  } 
    234237 
  • trunk/loci/formats/in/OpenlabReader.java

    r2303 r2313  
    754754      store.setDimensions(new Float(xCal), new Float(yCal), new Float(zCal), 
    755755        null, null, new Integer(i)); 
     756      for (int j=0; j<sizeC[0]; j++) { 
     757        store.setLogicalChannel(j, null, null, null, null, null,  
     758          null, new Integer(i)); 
     759      } 
    756760    } 
    757761  } 
  • trunk/loci/formats/in/PerkinElmerReader.java

    r2291 r2313  
    603603      if (debug) e.printStackTrace(); 
    604604    } 
     605 
     606    for (int i=0; i<sizeC[0]; i++) { 
     607      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     608    } 
    605609  } 
    606610 
  • trunk/loci/formats/in/PrairieReader.java

    r2291 r2313  
    337337        store.setDimensions(new Float(pixSizeX), new Float(pixSizeY), null, 
    338338          null, null, null); 
     339        for (int i=0; i<sizeC[0]; i++) { 
     340          store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     341        } 
    339342      } 
    340343 
  • trunk/loci/formats/in/QTReader.java

    r2291 r2313  
    617617      null, 
    618618      null); 
     619    for (int i=0; i<sizeC[0]; i++) { 
     620      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     621    } 
    619622 
    620623    // this handles the case where the data and resource forks have been 
  • trunk/loci/formats/in/SDTReader.java

    r2291 r2313  
    234234      new Integer(getSizeT(id)), new Integer(pixelType[0]), 
    235235      new Boolean(!isLittleEndian(id)), getDimensionOrder(id), null, null); 
     236    for (int i=0; i<sizeC[0]; i++) { 
     237      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     238    } 
    236239  } 
    237240 
  • trunk/loci/formats/in/SlidebookReader.java

    r2291 r2313  
    278278      new Integer(pixelType[0]), new Boolean(!little), currentOrder[0],  
    279279      null, null);  
     280    for (int i=0; i<sizeC[0]; i++) { 
     281      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     282    } 
    280283  } 
    281284 
  • trunk/loci/formats/in/ZeissLSMReader.java

    r2291 r2313  
    385385        null, // Image index 
    386386        null); // Pixels index 
     387      for (int i=0; i<sizeC[0]; i++) { 
     388        store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     389      } 
    387390 
    388391      int spectralScan = DataTools.read2UnsignedBytes(ras, little); 
  • trunk/loci/formats/in/ZeissZVIReader.java

    r2292 r2313  
    500500      pixZ == null ? null : new Float(pixZ), 
    501501      null, null, null); 
     502     
     503    for (int i=0; i<sizeC[0]; i++) { 
     504      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     505    } 
    502506  } 
    503507 
Note: See TracChangeset for help on using the changeset viewer.