Hi Team,
I was trying to get the magnification/pixel resolution value from czi image metadata but didn't.
How will i get the value?
How to get the magnification/pixel resolution value of image from metadata
Access to scaling metadata works as follows:
Code: Select all
## get scaling values in microns
scaleMic = image.Metadata.ScalingMicron
scX = scaleMic.X
scY = scaleMic.Y
scZ = scaleMic.Z
## get scaling factor and scaling unit (as shown in Info view)
scaleInfo = image.Metadata.ScalingUnitInfo
unitX = scaleInfo.X.Unit
unitY = scaleInfo.Y.Unit
unitZ = scaleInfo.Z.Unit
factX = scaleInfo.X.Factor
factY = scaleInfo.Y.Factor
factZ = scaleInfo.Z.Factor
If you are using ZeissImageLib, and not OAD, the following ist relevant for you:
The metadata itself is ‘straight forward’ XML and can be handled with any suitable XML class like the XDocument or XmlDocument in .Net. Accessing the XML Metadata is very easy.
string xml = imageDocument.Metadata.Xml;
An alternative to the general access via XDocument or XmlDocument is possible via
referenceChannelId = image.Core.Metadata.Storage.OpenPath("Experiment/ExperimentBlocks/AcquisitionBlock/SubDimensionSetups/RegionsSetup/SampleHolder/OnlineStitchingParameter/ReferenceChannelId").Value;
or addressing certain parts of the Metadata, e.g. Experiment,
referenceChannelId = image.Core.Metadata.ExperimentStorage.OpenPath("ExperimentBlocks/AcquisitionBlock/SubDimensionSetups/RegionsSetup/SampleHolder/OnlineStitchingParameter/ReferenceChannelId").Value;
To get the path to the values in a simple way Export the Image with XML and investigate the XML-File.
The metadata itself is ‘straight forward’ XML and can be handled with any suitable XML class like the XDocument or XmlDocument in .Net. Accessing the XML Metadata is very easy.
string xml = imageDocument.Metadata.Xml;
An alternative to the general access via XDocument or XmlDocument is possible via
referenceChannelId = image.Core.Metadata.Storage.OpenPath("Experiment/ExperimentBlocks/AcquisitionBlock/SubDimensionSetups/RegionsSetup/SampleHolder/OnlineStitchingParameter/ReferenceChannelId").Value;
or addressing certain parts of the Metadata, e.g. Experiment,
referenceChannelId = image.Core.Metadata.ExperimentStorage.OpenPath("ExperimentBlocks/AcquisitionBlock/SubDimensionSetups/RegionsSetup/SampleHolder/OnlineStitchingParameter/ReferenceChannelId").Value;
To get the path to the values in a simple way Export the Image with XML and investigate the XML-File.