Page 2 of 2

Re: C++ Header compiler error of ome-bioformat in Qt5.7-VC12

PostPosted: Wed Jul 20, 2016 11:55 am
by Polaris
I have another question about the image metadata extraction.

If I use ImageJ with bio-formats plugin, many useful metadata information can be retrieved, like the setting of microscope device and microscope objective. An example shown below,

Code: Select all
...
Microscope Aperture Max Mode #1   0
Microscope Autoexposure enabled #1   0
Microscope Autoexposure metering mode #1   1
Microscope Binning (X) #1   1
Microscope Binning (Y) #1   1
Microscope Blue channel gain #1   1.0
Microscope Brightness #1   0
Microscope Camera Actual Bit Depth #1   8
Microscope Camera Gain Unit #1   10^0x^1
Microscope Camera Maximum Frame Size #1   (1800, 1800)
Microscope Camera Saturation #1   0.0
Microscope Camera White Balance Mode #1   4
Microscope Camera gain #1   1.0
Microscope Clipping #1   (0, 0, 1800, 1800)
Microscope Clipping state #1   0
Microscope Contrast #1   1.0
Microscope Device Configuration Index #01   0
...


But when I use the function provided in C++ library, getGlobalMetadata and getSeriesMetadata. Only a few information can be retrieved. The same example
Code: Select all
Metadata for Image 0:
Artist = AdminOlympus
BitsPerSample = 8
Compression = 1
Date Time = 0─,
ImageLength = 512
ImageWidth = 474
Instrument Make = Olympus Soft Imaging Solutions
Instrument Model = VC50
Make = Olympus Soft Imaging Solutions
Model = VC50
NumberOfChannels = 3
Orientation = 1
PhotometricInterpretation = 2
Planar Configuration = 1
ResolutionUnit = 2
SamplesPerPixel = 3
XResolution = 72
YResolution = 72


It is more useful for me to get the metadata about microscopy instead of picture. Do you provide the API to get more metadata information, especially about microscopy? How can I obtain all the metadata information, just like the key/value shown by your plugin in ImageJ?

Re: C++ Header compiler error of ome-bioformat in Qt5.7-VC12

PostPosted: Thu Jul 21, 2016 3:23 pm
by rleigh
When you read in an OME-TIFF, any OriginalMetadata annotations in the OME-XML are converted into original metadata accessible via the FormatReader API (or via the metadatastore or model APIs if you want it directly from the OME-XML objects).

In the OME-XML:

Code: Select all
<XMLAnnotation ID="Annotation:5" Namespace="openmicroscopy.org/OriginalMetadata">
  <Value><OriginalMetadata xmlns="">
    <Key xmlns="">vessels DetectionChannel Spectral Scan Channels #1</Key>
    <Value xmlns="">32</Value>
  </OriginalMetadata></Value>
</XMLAnnotation>
<XMLAnnotation ID="Annotation:6" Namespace="openmicroscopy.org/OriginalMetadata">
  <Value><OriginalMetadata xmlns="">
    <Key xmlns="">vessels DetectionChannel Amplifier Gain B/C 2 #2</Key>
    <Value xmlns="">1.0</Value>
  </OriginalMetadata></Value>
</XMLAnnotation>


This results in the following output (running "ome-files info --orig vessels.ome.tiff"). I chopped out the several hundred other keys, but it illustrates how this is preserved.

Code: Select all
Image: /home/rleigh/images/vessels.ome.tiff
Using reader: OME-TIFF (Open Microscopy Environment TIFF)
SA
Reader setup took 00:00:00.725874

Filename = "/home/rleigh/images/vessels.ome.tiff"
Used files = ["/home/rleigh/images/vessels.ome.tiff"]

Reading core metadata
Series count = 1

Series #0:
   Image count = 288
   RGB = [false, false] ([1, 1])
   Interleaved = false
   Indexed = true
   Width = 1024
   Height = 1024
   SizeZ = 144 (effectively 144)
   SizeT = 1 (effectively 1)
   SizeC = 2 (effectively 2)
   Thumbnail size = 128 × 128
   Endianness = little
   DimensionOrder = XYCZT (certain)
   PixelType = uint16
   Bits per Pixel = 12
   MetadataComplete = true
   ThumbnailSeries = false

Global metadata:
[...]
   vessels DetectionChannel Acquire #1: 1
   vessels DetectionChannel Acquire #2: 1
   vessels DetectionChannel Amplifier Gain #1: 1.0
   vessels DetectionChannel Amplifier Gain #2: 1.0
   vessels DetectionChannel Amplifier Gain B/C 1 #1: 1.0
   vessels DetectionChannel Amplifier Gain B/C 1 #2: 1.0
   vessels DetectionChannel Amplifier Gain B/C 2 #1: 1.0
   vessels DetectionChannel Amplifier Gain B/C 2 #2: 1.0
   vessels DetectionChannel Amplifier Name #1: Amplifier1
   vessels DetectionChannel Amplifier Name #2: Amplifier1
   vessels DetectionChannel Amplifier Offset #1: 0.06999999999999998
   vessels DetectionChannel Amplifier Offset #2: 0.09
   vessels DetectionChannel Amplifier Offset B/C 1 #1: 0.06999999999999998
   vessels DetectionChannel Amplifier Offset B/C 1 #2: 0.09
   vessels DetectionChannel Amplifier Offset B/C 2 #1: 0.06999999999999998
   vessels DetectionChannel Amplifier Offset B/C 2 #2: 0.09
   vessels DetectionChannel Detection Channel Name #1: Ch2
   vessels DetectionChannel Detection Channel Name #2: Ch3
   vessels DetectionChannel Detector Gain #1: 724.0
   vessels DetectionChannel Detector Gain #2: 746.0
   vessels DetectionChannel Detector Gain B/C 1 #1: 724.0
   vessels DetectionChannel Detector Gain B/C 1 #2: 746.0
   vessels DetectionChannel Detector Gain B/C 2 #1: 724.0
   vessels DetectionChannel Detector Gain B/C 2 #2: 746.0
   vessels DetectionChannel Detector Name #1: Pmt2
   vessels DetectionChannel Detector Name #2: Pmt3
   vessels DetectionChannel Filter Name #1: BP 500-550 IR
   vessels DetectionChannel Filter Name #2: LP 575
   vessels DetectionChannel Filter Set Name #1: EF2
   vessels DetectionChannel Filter Set Name #2: EF3
   vessels DetectionChannel Integrator Name #1: Integrator2
   vessels DetectionChannel Integrator Name #2: Integrator3
   vessels DetectionChannel Pinhole Diameter #1: 54.0
   vessels DetectionChannel Pinhole Diameter #2: 59.99999999999999
   vessels DetectionChannel Pinhole Name #1: PH2
   vessels DetectionChannel Pinhole Name #2: PH3
   vessels DetectionChannel SPI Wavelength End #1: 735.0
   vessels DetectionChannel SPI Wavelength End #2: 735.0
   vessels DetectionChannel SPI Wavelength Start #1: 415.0
   vessels DetectionChannel SPI Wavelength Start #2: 415.0
   vessels DetectionChannel Spectral Scan Channels #1: 32
   vessels DetectionChannel Spectral Scan Channels #2: 32
[...]


I would suggest looking at the tutorial for using metadata: http://downloads.openmicroscopy.org/ome ... orial.html

This is the function which iterates over and displays the metadata: https://github.com/ome/ome-files-cpp/bl ... o.cpp#L262
This is the function which extracts the original metadata from OME-XML: https://github.com/ome/ome-files-cpp/bl ... s.cpp#L930

In all cases, it requires that the OME-XML contain appropriate OriginalMetadata XML annotations. In this case, these were generated by the Java Bio-Formats bfconvert of the original Zeiss LSM metadata, which is preserved in the OME-XML on conversion. Any files you read in must already contain such annotations.

I hope this makes sense. Please do follow up if you have any further questions or need anything explaining in more detail.


Regards,
Roger