How to get the magnification/pixel resolution value of image from metadata

Discuss questions and projects related to processing of imaging data here
Post Reply
user-6422
Posts: 5
Joined: Thu Jan 01, 1970 1:00 am

How to get the magnification/pixel resolution value of image from metadata

Post by user-6422 »

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?
user-9
Posts: 82
Joined: Thu Jan 01, 1970 1:00 am

Post by user-9 »

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
user-6422
Posts: 5
Joined: Thu Jan 01, 1970 1:00 am

Post by user-6422 »

Thanks..

What is image here in your code.

Is it possible to access magnification/pixel value using ImageDocument.Metadata as i am using it or using ImageAccessor .
user-4
Posts: 398
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4 »

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.
Post Reply