Changeset 6710


Ignore:
Timestamp:
07/19/10 21:21:25 (9 years ago)
Author:
melissa
Message:
  • Fixed how ICS files with > 4 channels are read.
  • Fixed Channel population when exporting from ImageJ.
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/bio-formats/src/loci/formats/in/ICSReader.java

    r6663 r6710  
    142142  private int prevImage; 
    143143  private boolean hasInstrumentData = false; 
     144  private boolean storedRGB = false; 
    144145 
    145146  // -- Constructor -- 
     
    225226    int sizeC = lifetime ? 1 : getSizeC(); 
    226227 
    227     if (!isRGB() && sizeC > 4 && channelLengths.size() == 1) { 
     228    if (!isRGB() && sizeC > 4 && channelLengths.size() == 1 && storedRGB) { 
    228229      // channels are stored interleaved, but because there are more than we 
    229230      // can display as RGB, we need to separate them 
     
    301302      prevImage = 0; 
    302303      hasInstrumentData = false; 
     304      storedRGB = false; 
    303305    } 
    304306  } 
     
    652654        else core[0].sizeC *= axisLengths[i]; 
    653655        channelLengths.add(new Integer(axisLengths[i])); 
     656        storedRGB = getSizeX() == 0; 
    654657        core[0].rgb = getSizeX() == 0 && getSizeC() <= 4 && getSizeC() > 1; 
    655658        if (getDimensionOrder().indexOf("C") == -1) { 
  • branches/4.2/components/loci-plugins/src/loci/plugins/out/Exporter.java

    r6707 r6710  
    320320        catch (EnumerationException e) { } 
    321321      } 
    322       if (store.getChannelCount(0) == 0 || 
    323         store.getChannelSamplesPerPixel(0, 0) == null) 
    324       { 
     322 
     323      for (int c=0; c<imp.getNChannels(); c++) { 
     324        if (c >= store.getChannelCount(0) || store.getChannelID(0, c) == null) { 
     325          String lsid = MetadataTools.createLSID("Channel", 0, c); 
     326          store.setChannelID(lsid, 0, c); 
     327        } 
    325328        store.setChannelSamplesPerPixel(new PositiveInteger(channels), 0, 0); 
    326       } 
    327       for (int channel=0; channel<store.getChannelCount(0); channel++) { 
    328         if (store.getChannelID(0, channel) == null) { 
    329           String lsid = MetadataTools.createLSID("Channel", 0, channel); 
    330           store.setChannelID(lsid, 0, channel); 
    331         } 
    332329      } 
    333330 
  • trunk/components/bio-formats/src/loci/formats/in/ICSReader.java

    r6655 r6710  
    142142  private int prevImage; 
    143143  private boolean hasInstrumentData = false; 
     144  private boolean storedRGB = false; 
    144145 
    145146  // -- Constructor -- 
     
    225226    int sizeC = lifetime ? 1 : getSizeC(); 
    226227 
    227     if (!isRGB() && sizeC > 4 && channelLengths.size() == 1) { 
     228    if (!isRGB() && sizeC > 4 && channelLengths.size() == 1 && storedRGB) { 
    228229      // channels are stored interleaved, but because there are more than we 
    229230      // can display as RGB, we need to separate them 
     
    301302      prevImage = 0; 
    302303      hasInstrumentData = false; 
     304      storedRGB = false; 
    303305    } 
    304306  } 
     
    652654        else core[0].sizeC *= axisLengths[i]; 
    653655        channelLengths.add(new Integer(axisLengths[i])); 
     656        storedRGB = getSizeX() == 0; 
    654657        core[0].rgb = getSizeX() == 0 && getSizeC() <= 4 && getSizeC() > 1; 
    655658        if (getDimensionOrder().indexOf("C") == -1) { 
  • trunk/components/loci-plugins/src/loci/plugins/out/Exporter.java

    r6707 r6710  
    320320        catch (EnumerationException e) { } 
    321321      } 
    322       if (store.getChannelCount(0) == 0 || 
    323         store.getChannelSamplesPerPixel(0, 0) == null) 
    324       { 
     322 
     323      for (int c=0; c<imp.getNChannels(); c++) { 
     324        if (c >= store.getChannelCount(0) || store.getChannelID(0, c) == null) { 
     325          String lsid = MetadataTools.createLSID("Channel", 0, c); 
     326          store.setChannelID(lsid, 0, c); 
     327        } 
    325328        store.setChannelSamplesPerPixel(new PositiveInteger(channels), 0, 0); 
    326       } 
    327       for (int channel=0; channel<store.getChannelCount(0); channel++) { 
    328         if (store.getChannelID(0, channel) == null) { 
    329           String lsid = MetadataTools.createLSID("Channel", 0, channel); 
    330           store.setChannelID(lsid, 0, channel); 
    331         } 
    332329      } 
    333330 
Note: See TracChangeset for help on using the changeset viewer.