Changeset 7463


Ignore:
Timestamp:
12/27/10 09:49:30 (9 years ago)
Author:
melissa
Message:

Preserve user name and emission wavelengths. Closes #632.

File:
1 edited

Legend:

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

    r7446 r7463  
    115115  private static final int CHANNEL_NAME = 0x70000014; 
    116116 
     117  private static final int ILLUM_CHANNEL_NAME = 0x90000001; 
    117118  private static final int ILLUM_CHANNEL_ATTENUATION = 0x90000002; 
    118119  private static final int ILLUM_CHANNEL_WAVELENGTH = 0x90000003; 
     
    170171  private int dimensionM, dimensionP; 
    171172  private Hashtable<String, Integer> seriesCounts; 
     173  private String userName; 
    172174 
    173175  private double originX, originY, originZ; 
     
    227229      seriesCounts = null; 
    228230      originX = originY = originZ = 0d; 
     231      userName = null; 
    229232    } 
    230233  } 
     
    782785    long eventListOffset = 0; 
    783786    long scanInformationOffset = 0; 
     787    long channelWavelengthOffset = 0; 
    784788 
    785789    if (getMetadataOptions().getMetadataLevel() != MetadataLevel.MINIMUM) { 
     
    844848      addSeriesMeta("ToolbarFlags", ras.readInt()); 
    845849 
    846       int wavelengthOffset = ras.readInt(); 
     850      channelWavelengthOffset = ras.readInt(); 
    847851      ras.skipBytes(64); 
    848852    } 
     
    11091113 
    11101114    if (getMetadataOptions().getMetadataLevel() != MetadataLevel.MINIMUM) { 
     1115      if (userName != null) { 
     1116        String experimenterID = MetadataTools.createLSID("Experimenter", 0); 
     1117        store.setExperimenterID(experimenterID, 0); 
     1118        store.setExperimenterUserName(userName, 0); 
     1119        store.setExperimenterDisplayName(userName, 0); 
     1120      } 
     1121 
    11111122      Double pixX = new Double(pixelSizeX); 
    11121123      Double pixY = new Double(pixelSizeY); 
     
    12891300        } 
    12901301        nextDichroicChannel++; 
     1302      } 
     1303    } 
     1304    else if (block instanceof IlluminationChannel) { 
     1305      IlluminationChannel channel = (IlluminationChannel) block; 
     1306      if (channel.acquire && channel.wavelength != null) { 
     1307        store.setChannelEmissionWavelength( 
     1308          new PositiveInteger(channel.wavelength), series, nextIllumChannel++); 
    12911309      } 
    12921310    } 
     
    19341952              Integer.parseInt(blockData.get(key).toString()); 
    19351953          } 
     1954          else if (metadataKeys.get(key).equals("User")) { 
     1955            userName = blockData.get(key).toString(); 
     1956          } 
    19361957        } 
    19371958      } 
     
    20752096    public Integer wavelength; 
    20762097    public Double attenuation; 
     2098    public String name; 
    20772099 
    20782100    protected void read() throws IOException { 
     
    20812103      attenuation = new Double(getDoubleValue(ILLUM_CHANNEL_ATTENUATION)); 
    20822104      acquire = getIntValue(ILLUM_CHANNEL_ACQUIRE) != 0; 
     2105 
     2106      name = getStringValue(ILLUM_CHANNEL_NAME); 
     2107      try { 
     2108        wavelength = new Integer(name); 
     2109      } 
     2110      catch (NumberFormatException e) { } 
    20832111    } 
    20842112  } 
Note: See TracChangeset for help on using the changeset viewer.