Hi,
I just wonder if there is an easy way to get those two parameters from czi image? I extract them in case of jpg and tif from the xml-file. I guess I can temporarily save czi image as tif/jpg and extract the parameters from the generated xml file but maybe there is an easier way. It would have been nice to have specially the aperture in the metadata (common for all file formats) since this is a parameter that, at least for us, quite often is changed by the user when adjusting the micrscope settings. However, the field setting is quite static from user to user in our case.
Best regards
Fredrik Olsson
Extract aperture and field parameters from czi metadata
Hello Fredrik,
it is a good idea to export an image with XML first.
In the XML you can see the path to the data required.
In the next step get the data according to the example shown below:
it is a good idea to export an image with XML first.
In the XML you can see the path to the data required.
In the next step get the data according to the example shown below:
Code: Select all
## Remove all open documents
Zen.Application.Documents.RemoveAll()
##
## Load an image interactively with Open dialog (File menu)
## Display the image
image = Zen.Application.LoadImage()
Zen.Application.Documents.Add(image)
##
## get metadata
cCol = image.Metadata.GetMetadataWithPath('Metadata/DisplaySetting/Channels[current]/Color')
cScene = image.Metadata.GetMetadataStringWithPath('Metadata/Information/Image/Dimensions/S/Scenes[current]/Name')
zoom = image.Metadata.GetMetadataStringWithPath('Metadata/Information/Image/MicroscopeSettings/ZoomSettings/Magnification')
## show values
print 'Current color: ',cCol
print 'Current scene: ',cScene
print 'Zoom factor of Axio Zoom: ',zoom
Zen.Application.Pause('Current color: ' + cCol +'\n' + 'Current scene: ' + cScene +'\n' + 'Zoom factor: ' + zoom)