Changeset 7433


Ignore:
Timestamp:
12/17/10 12:16:14 (9 years ago)
Author:
melissa
Message:

Make sure that channel names are populated for screen data.

Location:
trunk/components/bio-formats/src/loci/formats/in
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/in/OpenlabReader.java

    r7389 r7433  
    597597      String detectorID = MetadataTools.createLSID("Detector", 0, 0); 
    598598      store.setDetectorID(detectorID, 0, 0); 
    599       store.setDetectorSettingsID(detectorID, 0, 0); 
    600599 
    601600      store.setDetectorType(getDetectorType("Other"), 0, 0); 
     601 
     602      for (int c=0; c<getEffectiveSizeC(); c++) { 
     603        PlaneInfo plane = getPlane(new int[] {0, c, 0}); 
     604        store.setChannelName(plane.channelName, 0, c); 
     605        store.setDetectorSettingsID(detectorID, 0, c); 
     606      } 
    602607 
    603608      Double stageX = xPos == null ? null : new Double(xPos); 
  • trunk/components/bio-formats/src/loci/formats/in/ScreenReader.java

    r7384 r7433  
    3232import loci.common.Location; 
    3333import loci.common.RandomAccessInputStream; 
     34import loci.common.services.DependencyException; 
     35import loci.common.services.ServiceException; 
     36import loci.common.services.ServiceFactory; 
    3437import loci.formats.ClassList; 
    3538import loci.formats.CoreMetadata; 
     
    4043import loci.formats.ImageReader; 
    4144import loci.formats.MetadataTools; 
     45import loci.formats.MissingLibraryException; 
    4246import loci.formats.meta.MetadataStore; 
    43  
     47import loci.formats.ome.OMEXMLMetadata; 
     48import loci.formats.ome.OMEXMLMetadataImpl; 
     49import loci.formats.services.OMEXMLService; 
     50import loci.formats.services.OMEXMLServiceImpl; 
     51 
     52import ome.xml.model.Image; 
     53import ome.xml.model.OME; 
    4454import ome.xml.model.enums.NamingConvention; 
    4555import ome.xml.model.primitives.NonNegativeInteger; 
     
    250260    // initialize each of the well files 
    251261 
     262    OMEXMLMetadata omexmlMeta; 
     263    OMEXMLService service; 
     264    try { 
     265      ServiceFactory factory = new ServiceFactory(); 
     266      service = factory.getInstance(OMEXMLService.class); 
     267      omexmlMeta = service.createOMEXMLMetadata(); 
     268    } 
     269    catch (DependencyException de) { 
     270      throw new MissingLibraryException(OMEXMLServiceImpl.NO_OME_XML_MSG, de); 
     271    } 
     272    catch (ServiceException se) { 
     273      throw new FormatException(se); 
     274    } 
     275 
    252276    core = new CoreMetadata[coreLength]; 
    253277    int nextCore = 0; 
     
    255279      for (int well=0; well<files[plate].length; well++) { 
    256280        readers[plate][well] = new ImageReader(validReaders); 
     281        readers[plate][well].setMetadataStore(omexmlMeta); 
    257282        readers[plate][well].setId(files[plate][well]); 
    258283        core[nextCore++] = readers[plate][well].getCoreMetadata()[0]; 
     
    267292    } 
    268293 
     294    OME root = (OME) omexmlMeta.getRoot(); 
     295    Image img = root.getImage(0); 
     296    for (int i=1; i<core.length; i++) { 
     297      root.addImage(img); 
     298    } 
     299    ((OMEXMLMetadataImpl) omexmlMeta).resolveReferences(); 
     300    omexmlMeta.setRoot(root); 
     301 
    269302    // populate HCS metadata 
    270303 
    271304    MetadataStore store = makeFilterMetadata(); 
     305    service.convertMetadata(omexmlMeta, store); 
    272306    MetadataTools.populatePixels(store, this); 
    273307 
Note: See TracChangeset for help on using the changeset viewer.