Show spatial calibration not working after update to version 10.0.1
After updating Image-Pro from version 10.0 to 10.0.1 a procedure does not work anymore. I use this sub to get the applied spatial calibration from a very large image set (Zeiss czi). A czi image is opened and a calibration is set automatically. If I call this sub an error appears "ActiveX Automation: Object var is 'Nothing'". But imset.Name is working well.
Public Sub ShowSpatialCalibration()
MsgBox ThisApplication.ActiveDocument.DisplayName 'working
Dim imset As McImageSet = ThisApplication.ActiveDocument.Data
Dim calib As MediaCy.IQL.Calibrations.McSpatialCalib
calib = imset.SpatialCalibration
MsgBox imset.Name 'working
MsgBox calib.Name 'not working anymore
End Sub
MsgBox ThisApplication.ActiveDocument.DisplayName 'working
Dim imset As McImageSet = ThisApplication.ActiveDocument.Data
Dim calib As MediaCy.IQL.Calibrations.McSpatialCalib
calib = imset.SpatialCalibration
MsgBox imset.Name 'working
MsgBox calib.Name 'not working anymore
End Sub
How can I fix this?
Thanks in advance
fsup
0
Comments
If the image doesn't have calibration, calib is Nothing.
Yuri
Yuri
Yuri
Yuri
Dim imset As McImageSet = ThisApplication.ActiveDocument.Data
If imset Is Nothing Then Exit Sub
MsgBox( "Image Set Name: " + imset.Name)
Dim dX As Double = imset.XPhysicalExtent '<<<< Add this line
Dim calib As MediaCy.IQL.Calibrations.McSpatialCalib
calib = imset.SpatialCalibration
If calib Is Nothing Then
MsgBox("Calib is Nothing.")
Exit Sub
Else
MsgBox( "Calibration Name: " + calib.Name)
End If
End Sub 'ShowSpatialCalibration
Thank you for supporting me.