libCZI
Reading CZI documents made easy
libCZI_Metadata2.h
1 //******************************************************************************
2 //
3 // libCZI is a reader for the CZI fileformat written in C++
4 // Copyright (C) 2017 Zeiss Microscopy GmbH
5 //
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 //
19 // To obtain a commercial version please contact Zeiss Microscopy GmbH.
20 //
21 //******************************************************************************
22 #pragma once
23 
24 #include <cstdint>
25 #include <string>
26 
27 #include "libCZI.h"
28 
29 namespace libCZI
30 {
32  enum class DimensionChannelChannelType : std::uint8_t
33  {
34  Heightmap,
35  PalHR,
36  PalWidefield,
37  SimHR,
38  SimWidefield,
39  SimDWF,
40  AiryScanSum,
42  AiryScanRaw,
43  AiryScanSr,
44  AiryScanVp,
45  AiryScanMb,
49  };
50 
52  enum class DimensionChannelAcquisitionMode : std::uint8_t
53  {
54  WideField,
67  PALM,
68  STORM,
69  STED,
70  TIRF,
71  FSM,
72  LCM,
73  SPIM,
74  SEM,
75  FIB,
76  FIB_SEM,
78  Other
79  };
80 
82  enum class DimensionChannelIlluminationType : std::uint8_t
83  {
84  Transmitted,
86  Oblique,
87  NonLinear,
88  Other
89  };
90 
92  enum class DimensionChannelContrastMethod : std::uint8_t
93  {
94  Brightfield,
95  Phase,
96  DIC,
100  Darkfield,
101  Fluorescence,
103  Other
104  };
105 
107  enum class DimensionChannelPinholeGeometry : std::uint8_t
108  {
109 
110  Circular,
111  Rectangular,
112  Other
113  };
114 
116  template <typename t>
118  {
121 
124 
126  t end;
127  };
128 
131  {
133  enum class InformationType
134  {
135  SinglePeak,
136  Ranges
137  };
138 
141 
143  double singlePeak;
144 
146  std::vector<RangeOrSingleValue<double>> ranges;
147  };
148 
151  {
152  public:
156  virtual bool TryGetAttributeId(std::wstring* id) = 0;
157  virtual ~IAttributeId() = default;
158  };
159 
162  {
163  public:
167  virtual bool TryGetAttributeName(std::wstring* name) = 0;
168  virtual ~IAttributeName() = default;
169  };
170 
181 
184  {
185  public:
186  virtual bool TryGetChannelType(DimensionChannelChannelType* type) = 0;
187  virtual bool TryGetChannelUnit(std::wstring* unit) = 0;
188  virtual bool TryGetPixelType(PixelType* pixelType) = 0;
189  virtual bool TryGetComponentBitCount(int* bitCount) = 0;
190  virtual bool TryGetAcquisitionMode(DimensionChannelAcquisitionMode* acquisitionMode) = 0;
191  virtual bool TryGetIlluminationType(DimensionChannelIlluminationType* illuminationType) = 0;
192  virtual bool TryGetContrastMethod(DimensionChannelContrastMethod* contrastMethod) = 0;
193  virtual bool TryGetIlluminationWavelength(SpectrumCharacteristics* illuminationwavelength) = 0;
194  virtual bool TryGetDetectionWavelength(SpectrumCharacteristics* detectionwavelength) = 0;
195  virtual bool TryGetExcitationWavelength(double* excitationwavelength) = 0;
196  virtual bool TryGetEmissionWavelength(double* emissionwavelength) = 0;
197  virtual bool TryGetEffectiveNA(double* na) = 0;
198  virtual bool TryGetDyeId(std::wstring* dyeid) = 0;
199  virtual bool TryGetDyeDatabaseId(std::wstring* dyedatabaseid) = 0;
200  virtual bool TryGetPinholeSize(double* pinholesize) = 0;
201  virtual bool TryGetPinholeSizeAiry(double* pinholesizeairy) = 0;
202  virtual bool TryGetPinholeGeometry(DimensionChannelPinholeGeometry* pinholegeometry) = 0;
203  virtual bool TryGetFluor(std::wstring* fluor) = 0;
204  virtual bool TryGetNDFilter(double* ndfilter) = 0;
205  virtual bool TryGetPockelCellSetting(int* pocketcellsetting) = 0;
206  virtual bool TryGetColor(libCZI::Rgb8Color* color) = 0;
207  virtual bool TryGetExposureTime(RangeOrSingleValue<std::uint64_t>* exposuretime) = 0;
208  virtual bool TryGetDepthOfFocus(double* depthoffocus) = 0;
209  virtual bool TryGetSectionThickness(double* sectionthickness) = 0;
210  virtual std::shared_ptr<IDimensionChannelDetectorSettings> GetDetectorSettings() = 0;
211  virtual std::shared_ptr<IDimensionChannelLightSourcesSettings> GetLightSourcesSettings() = 0;
212  virtual std::shared_ptr<IDimensionChannelLightPath> GetLightPath() = 0;
213  virtual std::shared_ptr<IDimensionChannelLaserScanInfo> GetLaserScanInfo() = 0;
214  virtual std::shared_ptr<IDimensionChannelSPIMIlluminationSettings> GetSPIMIlluminationSettings() = 0;
215  virtual std::shared_ptr<IDimensionChannelSPIMDetectionSettings> GetSPIMDetectionSettings() = 0;
216  virtual std::shared_ptr<IDimensionChannelSIMSettings> GetSIMSettings() = 0;
217  virtual std::shared_ptr<IDimensionChannelPolarizingSettings> GetPolarizingSettings() = 0;
218  virtual std::shared_ptr<IDimensionChannelAiryscanSettings> GetAiryscanSettings() = 0;
219  virtual bool TryGetReflector(std::wstring* reflector) = 0;
220  virtual bool TryGetCondenserContrast(std::wstring* condensorContrast) = 0;
221  virtual bool TryGetNACondenser(double* naCondensor) = 0;
222  virtual std::shared_ptr<IDimensionChannelRatio> GetRatio() = 0;
223 
224  virtual ~IDimensionChannelInfo() {}
225  };
226 
228  {
229  public:
230  virtual int GetChannelCount() const = 0;
231  virtual std::shared_ptr<IDimensionChannelInfo> GetChannel(int i) const = 0;
232 
233  virtual ~IDimensionsChannelsInfo() {}
234  };
235 
236  enum class ChannelDetectorSettingsBinning : std::uint8_t
237  {
238  _1x1,
239  _2x2,
240  _4x4,
241  _8x8,
242  Other
243  };
244 
245  enum class ChannelDetectorSettingsShutter : std::uint8_t
246  {
247  Rolling,
248  Global,
249  Other
250  };
251 
252  enum class ChannelDetectorCameraProcessingMode :std::uint8_t
253  {
254  None,
255  Widefield,
256  Sectioned,
257  RawDataMode
258  };
259 
261  {
262  public:
263  virtual bool TryGetDetectorRef(std::wstring* detectorRef) = 0;
264  virtual bool TryGetBinning(ChannelDetectorSettingsBinning* binning) = 0;
265  virtual bool TryGetShutter(ChannelDetectorSettingsShutter* shutter) = 0;
266  virtual bool TryGetPhotonConversionFactor(double* conversionFactor) = 0;
267  virtual bool TryGetGain(double* gain) = 0;
268  virtual bool TryGetDigitalGain(double* digitalgain) = 0;
269  virtual bool TryGetOffset(double* offset) = 0;
270  virtual bool TryGetEMGain(double* emgain) = 0;
271  virtual bool TryGetVoltage(double* voltage) = 0;
272  virtual bool TryGetReadOutRate(double* readoutrate) = 0;
273  virtual bool TryGetUseBrightnessContrastCorrection(bool* usebrightnesscontrastcorrection) = 0;
274  virtual bool TryGetPixelMaximum(double* pixelmaximum) = 0;
275  virtual bool TryGetPixelAccuracy(double* pixelaccuracy) = 0;
276  virtual bool TryGetPixelScaleFactor(double* pixelscalefactor) = 0;
277  virtual bool TryGetCameraProcessingMode(ChannelDetectorCameraProcessingMode* mode) = 0;
278 
280  };
281 
283  {
284  public:
286  {
287  bool stokesParameterValid[4];
288  double stokesParameter[4];
289  };
290  public:
291  virtual bool TryGetLightSourceRef(std::wstring* lightsourceref) = 0;
292  virtual bool TryGetWavelength(double* wavelength) = 0;
293  virtual bool TryGetAttenuation(double* attenuation) = 0;
294  virtual bool TryGetTransmission(double* transmission) = 0;
295  virtual bool TryGetIntensity(std::wstring* intensity) = 0;
296  virtual bool TryGetFlashDuration(double* flashduration) = 0;
297  virtual bool TryGetTIRFAngle(double* tirfangle) = 0;
298  virtual bool TryGetTIRFDepthOfPenetration(double* tirfdepthofpenetration) = 0;
299  virtual bool TryGetIsTIRFCalibrated(bool* isTIRFcalibrated) = 0;
300  virtual bool TryGetIsNlo(bool* isnlo) = 0;
301  virtual bool TryGetPolarization(Polarization* polarization) = 0;
302 
304  };
305 
307  {
308  public:
309  virtual int GetLightSourceSettingCount() const = 0;
310  virtual std::shared_ptr<IDimensionChannelLightSourcesSetting> GetLightSourceSetting(int i) const = 0;
311 
313  };
314 
316  {
317  public:
318  virtual bool TryGetExcitationFilterRef(std::wstring* excitationFilterRef) = 0;
319  virtual bool TryGetDichroicFilterRef(std::wstring* dichroicRef) = 0;
320  virtual bool TryGetEmissionFilterRef(std::wstring* emissionFilterRef) = 0;
321 
322  virtual ~IDimensionChannelLightPath() = default;
323  };
324 
325  enum class DimensionChannelLaserScanScanningMode : std::uint8_t
326  {
327  Frame,
328  FastFrame,
329  LineSequential,
330  Line,
331  Spot,
332  Other
333  };
334 
335  enum class DimensionChannelLaserScanScanDirection : std::uint8_t
336  {
337  Bidirectional,
338  Unidirectional
339  };
340 
341  enum class DimensionChannelLaserScanAveragingMethod : std::uint8_t
342  {
343  Mean,
344  Sum,
345  Other
346  };
347 
348  enum class DimensionChannelLaserScanAveragingMode : std::uint8_t
349  {
350  Frame,
351  Line,
352  Other
353  };
354 
355  enum class DimensionChannelLaserScanLaserAttenuatorState : std::uint8_t
356  {
357  On,
358  Off
359  };
360 
362  {
363  public:
364  virtual bool TryGetPixelTime(double* pixelTime) = 0;
365  virtual bool TryGetLineTime(double* lineTime) = 0;
366  virtual bool TryGetFrameTime(double* frameTime) = 0;
367  virtual bool TryGetAveraging(int* averaging) = 0;
368  virtual bool TryGetScanningMode(DimensionChannelLaserScanScanningMode* mode) = 0;
369  virtual bool TryGetSampleRotation(double* sampleRotation) = 0;
370  virtual bool TryGetSampleOffsetX(double* sampleOffsetX) = 0;
371  virtual bool TryGetSampleOffsetY(double* sampleOffsetY) = 0;
372  virtual bool TryGetScanDirection(DimensionChannelLaserScanScanDirection* scanDirection) = 0;
373  virtual bool TryGetZoomX(double* zoomX) = 0;
374  virtual bool TryGetZoomY(double* zoomY) = 0;
375  virtual bool TryGetZoomZ(double* zoomZ) = 0;
376  virtual bool TryGetCropOffset(double* cropOffset) = 0;
377  virtual bool TryGetLaserAttenuatorMeas(double* lastAttenuatorMeas) = 0;
378  virtual bool TryGetLaserBlanking(double* laserBlanking) = 0;
379  virtual bool TryGetLaserAttenuatorBleach(double* laserAttenuatorBleach) = 0;
380  virtual bool TryGetLineStep(std::uint32_t* lineStep) = 0;
381  virtual bool TryGetScanSpeed(int* scanSpeed) = 0;
382  virtual bool TryGetAveragingMethod(DimensionChannelLaserScanAveragingMethod* averagingMethod) = 0;
383  virtual bool TryGetAveragingMode(DimensionChannelLaserScanAveragingMode* averagingMode) = 0;
384  virtual bool TryGetLaserAttenuatorState(DimensionChannelLaserScanLaserAttenuatorState* attenuatorState) = 0;
385 
386  virtual ~IDimensionChannelLaserScanInfo() = default;
387  };
388 
389  enum class DimensionChannelSPIMIlluminationSettingsBeamType : std::uint8_t
390  {
391  Gauss,
392  Bessel,
393  Other
394  };
395 
399 
401  {
402  public:
403  virtual bool TryGetNALightSheet(double* naLightSheet) = 0;
404  virtual bool TryGetBeamType(DimensionChannelSPIMIlluminationSettingsBeamType* beamType) = 0;
405  virtual bool TryGetCylinderLensRef(std::wstring* cylinderLensRef) = 0;
406  virtual std::shared_ptr<IInstrumentObjectiveSettings> GetIlluminationObjectiveSettings() = 0;
407  virtual std::shared_ptr<ISPIMIlluminationResonanceScannerSettings> GetResonanceScannerSettings() = 0;
408  virtual std::shared_ptr<ISPIMIlluminationGalvoScannerSettings> GetGalvoScannerSettings() = 0;
409 
410  virtual ~IDimensionChannelSPIMIlluminationSettings() = default;
411  };
412 
414  {
415  public:
416  enum class Medium : std::uint8_t
417  {
418  Air,
419  Oil,
420  Water,
421  Glycerol,
422  Other
423  };
424  public:
425  virtual bool TryGetObjectiveRef(std::wstring* objectiveRef) = 0;
426  virtual bool TryGetMedium(Medium* medium) = 0;
427  virtual bool TryGetCorrectionCollar(double* correctioncollar) = 0;
428  virtual bool TryGetCorrectionCollar2(double* correctioncollar2) = 0;
429  virtual bool TryGetCorrectionControllerMode(std::wstring* correctioncontrollermode) = 0;
430  virtual bool TryGetCorrectionControllerBottomThickness(double* correctioncontrollerbottomthickness) = 0;
431  virtual bool TryGetCorrectionControllerImagingDepth(double* correctioncontrollerimagingdepth) = 0;
432  virtual bool TryGetRefractiveIndex(double* refractiveindex) = 0;
433 
434  virtual ~IInstrumentObjectiveSettings() = default;
435  };
436 
438  {
439  public:
440  virtual bool TryGetAmplitude(double* amplitude) = 0;
441 
442  virtual ~ISPIMIlluminationResonanceScannerSettings() = default;
443  };
444 
446  {
447  public:
448  virtual bool TryGetAmplitudeYScan(double* amplitudeYScan) = 0;
449  virtual bool TryGetFrequency(double* frequency) = 0;
450  virtual bool TryGetOffset1Left(double* offset1Left) = 0;
451  virtual bool TryGetOffset1Right(double* offset1Right) = 0;
452  virtual bool TryGetOffset2Left(double* offset2Left) = 0;
453  virtual bool TryGetOffset2Right(double* offset2Right) = 0;
454 
455  virtual ~ISPIMIlluminationGalvoScannerSettings() = default;
456  };
457 
459  {
460  public:
461  virtual bool TryGetNADetection(double* naDetection) = 0;
462 
463  virtual ~IDimensionChannelSPIMDetectionSettings() = default;
464  };
465 
467  {
468  public:
469  virtual bool TryGetSIMDeviceRef(std::wstring* simDeviceRef) = 0;
470  virtual bool TryGetGratingPeriod(double* gratingPeriod) = 0;
471  virtual bool TryGetGratingRotation(double* gratingRotation) = 0;
472  virtual bool TryGetGridDescription(std::wstring* gridDescription) = 0;
473  virtual bool TryGetReflector(std::wstring* reflector) = 0;
474  virtual bool TryGetFilterSetRef(std::wstring* filterSetRef) = 0;
475  virtual bool TryGetDiffractionEfficiency1(double* diffractionEfficiency1) = 0;
476  virtual bool TryGetDiffractionEfficiency2(double* diffractionEfficiency2) = 0;
477  virtual bool TryGetDiffractionEfficiency3(double* diffractionEfficiency3) = 0;
478 
479  virtual ~IDimensionChannelSIMSettings() = default;
480  };
481 
483  {
484  public:
485  virtual bool TryGetPolarizerAngle(double* polarizerAngle) = 0;
486  virtual bool TryGetAnalyzerAngle(double* analyzerAngle) = 0;
487 
488  virtual ~IDimensionChannelPolarizingSettings() = default;
489  };
490 
492  {
493  public:
494  struct Vector
495  {
496  double x, y;
497  };
498  public:
499  virtual bool TryGetIlluminationLinePixels(Vector* illuminationLinePixels) = 0;
500  virtual bool TryGetIlluminationLine(Vector* illuminationLine) = 0;
501  virtual bool TryGetFiberMapping(std::vector<int>* mapping) = 0;
502  virtual bool TryGetEffectiveNAinX(double* effectiveNAinX) = 0;
503  virtual bool TryGetEffectiveNAinY(double* effectiveNAinY) = 0;
504 
505  virtual ~IFastAiryScanSettings() = default;
506  };
507 
509  {
510  public:
511  enum class Mode :std::uint8_t
512  {
513  SuperResolution,
514  VirtualPinhole,
515  MultiBeam,
516  Off
517  };
518  public:
519  virtual bool TryGetMode(Mode* mode) = 0;
520  virtual std::shared_ptr<IFastAiryScanSettings> GetFastAiryScanSettings() = 0;
521  virtual bool TryGetVirtualPinholeSize(double* virtualPinholeSize) = 0;
522  virtual bool TryGetMagnification(double* magnification) = 0;
523  virtual bool TryGetTransformationXX(double* transformationXX) = 0;
524  virtual bool TryGetTransformationXY(double* transformationXY) = 0;
525  virtual bool TryGetTransformationYX(double* transformationYX) = 0;
526  virtual bool TryGetTransformationYY(double* transformationYY) = 0;
527 
528  virtual ~IDimensionChannelAiryscanSettings() = default;
529  };
530 
532  {
533  public:
555  enum class Type : std::uint8_t
556  {
557  NoOnlineCalculation,
558  OnlineRatio,
559  OnlineSubtraction,
560  OnlineSubtractionRatio,
561  OnlineHillFunction,
562  OnlineReferenceRatio,
563  OnlineLinearUnmixing
564  };
565  public:
566  virtual bool TryGetType(Type* type) = 0;
567  virtual bool TryGetConst1(double* c1) = 0;
568  virtual bool TryGetConst2(double* c2) = 0;
569  virtual bool TryGetConst3(double* c3) = 0;
570  virtual bool TryGetConst4(double* c4) = 0;
571  virtual bool TryGetConst5(double* c5) = 0;
572  virtual bool TryGetConst6(double* c6) = 0;
573 
578  virtual bool TryGetSource1(std::vector<std::wstring>* source1) = 0;
579 
584  virtual bool TryGetSource2(std::vector<std::wstring>* source2) = 0;
585 
586  virtual ~IDimensionChannelRatio() = default;
587  };
588 }
Definition: libCZI_Metadata2.h:466
The channel contains images from stochastic optical reconstruction microscopy.
PixelType
An enum representing a pixel-type.
Definition: libCZI_Pixels.h:127
This channel represents a heightmap. Note that additional restrictions apply when declaring a channel...
This channel contains the (processed) super-resolution image.
Definition: libCZI_Metadata2.h:508
This channel contains the Sheppard-sum created from 4 fiber-rings.
InformationType
Values that represent the "type of information given".
Definition: libCZI_Metadata2.h:133
The channel contains images from total internal reflection fluorescence (TIRFM).
The channel contains images from selective-plane-illumination microscopy.
Definition: libCZI_Metadata2.h:437
The channel contains images from stimulated emission depletion microscopy.
Bright filed micrsocopy was used.
The channel contains images from photo-activation localization microscopy.
Definition: libCZI_Metadata2.h:458
Definition: libCZI_Metadata2.h:445
Definition: libCZI_Metadata2.h:260
DimensionChannelContrastMethod
Values that represent a contrast method, a technique used to achieve contrast, for the images in a ch...
Definition: libCZI_Metadata2.h:92
Differential Interference Contrast was used.
The channel contains images an image from a multi-photon-microscopy system.
Some other type of image formation.
Definition: libCZI_Metadata2.h:361
Definition: libCZI_Metadata2.h:531
t end
The end of the range (only valid if singleValue is false).
Definition: libCZI_Metadata2.h:126
Definition: libCZI_Metadata2.h:306
Structure used to describe the spectral characteristic of light.
Definition: libCZI_Metadata2.h:130
Definition: libCZI_Metadata2.h:315
A structure representing an R-G-B-color triple (as bytes).
Definition: libCZI_Pixels.h:111
The channel contains images from scanning electron microscopy.
The channel contains images from laser-scanning-confocal microscopy.
The channel contains image from aperture correlation (a specific application of Structured Illuminati...
double singlePeak
The single peak (only valid if "type" is "InformationType::SinglePeak").
Definition: libCZI_Metadata2.h:143
t startOrSingleValue
The start value of a range (in the case that singleValue is false) or the single value (if singleValu...
Definition: libCZI_Metadata2.h:123
The channel contains images from a TIRF microscopy system.
Type
Definition: libCZI_Metadata2.h:555
The channel contains images from Fluorescence speckle microscopy.
The channel contains images from focus ion beam microscopy.
The channel contains images from structured-illumination microscopy system.
Objective was used to bring light to the specimen.
This struct represents either a single value or a range.
Definition: libCZI_Metadata2.h:117
This channel contains the result of an online unmixing acquisition with a laser-scanning microscope...
This channel contains the (processed) "virtual pinhole" image.
bool singleValue
True if this struct represents a single value. In this case, the property end is invalid.
Definition: libCZI_Metadata2.h:120
InformationType type
The type of information given.
Definition: libCZI_Metadata2.h:140
Hoffman Modulation Contrast (HMC) was used.
The channel contains images from Second harmonic imaging microscopy (SHIM).
This channel contains the images of all sensors in the Airy-Scan-sensor-array.
Definition: libCZI_Metadata2.h:400
This interface is used for all elements that contain a &#39;name&#39; (as XML-attribute). ...
Definition: libCZI_Metadata2.h:161
DimensionChannelIlluminationType
Values that represent the method of illumination used to capture the channel.
Definition: libCZI_Metadata2.h:82
An enum constant representing a circular pinhole.
This channel contains a processed (combined) super-resolution from an Airy-scan-acquisition in draft ...
This channel contains the images of all sensors in the Airy-Scan-sensor-array.
The channel contains images from wide field microscopy.
External interfaces, classes, functions and structs are found in the namespace "libCZI".
Definition: libCZI.h:45
The channel contains images from laser capture micro dissection.
This channel contains the (processed) "multi-beam" image.
Definition: libCZI_Metadata2.h:494
Definition: libCZI_Metadata2.h:491
DimensionChannelChannelType
Values that represent the type of a channel.
Definition: libCZI_Metadata2.h:32
DimensionChannelAcquisitionMode
Values that represent the acquisition mode of a channel.
Definition: libCZI_Metadata2.h:52
The channel contains images from a confocal spinning-disk system.
An enum constant representing a rectangular pinhole.
Definition: libCZI_Metadata2.h:482
Definition: libCZI_Metadata2.h:227
This interface is used for all elements that contain an &#39;id&#39; (as XML-attribute).
Definition: libCZI_Metadata2.h:150
The channel contains images from focus ion beam and scanning electron microscopy. ...
Information about a channel.
Definition: libCZI_Metadata2.h:183
std::vector< RangeOrSingleValue< double > > ranges
The set of ranges (only valid if "type" is "InformationType::Ranges").
Definition: libCZI_Metadata2.h:146
Definition: libCZI_Metadata2.h:413
Definition: libCZI_Metadata2.h:282
DimensionChannelPinholeGeometry
Values that represent the pinhole geometry (of the images in a channel).
Definition: libCZI_Metadata2.h:107