fmi-faim / faim-ipa

A collection of Image Processing and Analysis (IPA) functions used at the Facility for Advanced Imaging and Microscopy (FAIM)
BSD 3-Clause "New" or "Revised" License
9 stars 6 forks source link

CellVoyager: parse wavelength from 'Acquisition' instead of 'Target' #152

Closed imagejan closed 5 months ago

imagejan commented 5 months ago

The Target value in the measurement file (*.mes) of a CellVoyager acquisition can be set to any (string) value by the user, and defaults to "Microscope Image" when creating a new setting from scratch.

Instead of relying on the convention to name the channel target after the excitation wavelength, let's instead parse the Acquisition value that contains the name of the filter set used (e.g. BP525/50), where the first number represents the emission wavelength (which is also more accurate than the excitation wavelength to use for display purposes).

Note: the LightSourceName would point to an entry in LightSourceList that contains the excitation wavelength, but for simultaneous-acquisition datasets, a single Channel can contain multiple LightSourceName entries, therefore it is not a reliable parsing target.

Example entries:

    <bts:Channel bts:Ch="1" bts:Target="Microscope Image" bts:ObjectiveID="60004" bts:Objective="60x W" bts:Magnification="60" bts:MethodID="1" bts:Method="Confocal Fluorescence 405/488/561/640 nm" bts:FilterID="4" bts:Acquisition="BP676/29" bts:ExposureTime="30" bts:Binning="1" bts:Color="#FFFF1B00" bts:MinLevel="0" bts:MaxLevel="0.10367306004763682" bts:CSUID="2" bts:PinholeDiameter="50" bts:Kind="ConfocalFluorescence" bts:CameraType="DCAM" bts:InputLevel="10000" bts:Fluorophore="">
      <bts:LightSourceName>640nm</bts:LightSourceName>
    </bts:Channel>

    <bts:Channel bts:Ch="1" bts:Target="405" bts:ObjectiveID="20104" bts:Objective="20x W-Y1" bts:Magnification="20" bts:MethodID="1" bts:Method="Confocal Fluorescence 405/488/561/640 nm" bts:FilterID="1" bts:Acquisition="BP445/45" bts:ExposureTime="100" bts:Binning="1" bts:CSUID="2" bts:PinholeDiameter="50" bts:Color="#FF002FFF" bts:MinLevel="0.056412185031966919" bts:MaxLevel="0.45468221135765313" bts:Kind="ConfocalFluorescence" bts:CameraType="DCAM" bts:InputLevel="1000" bts:Fluorophore="">
      <bts:LightSourceName>405nm</bts:LightSourceName>
      <bts:LightSourceName>640nm</bts:LightSourceName>
    </bts:Channel>