Top  Previous  Next

getSpaceCal ( integer Image, string& Unit, floating& Xscale, floating& Yscale [, integer& Ox,
integer& Oy, integer& Invert ] )  

Use this function to retrieve parameters of a current spatial calibration scale of an image.
An integer between 1 and 116 specifying the frame number of the image for which the calibration scale is to be retrieved. Values in the range of 100-116 correspond to hidden frames.  
A string that returns the name of the current spatial calibration unit.  
Xscale, Yscale  
Floating variables or constants that return the number of spatial calibration units per pixel in the horizontal and vertical direction respectively.  
Ox, Oy  
Optional integers that return the position of the origin of the image coordinate system relative to the top left corner of the image, in pixels. Both positive and negative values are allowed. A negative Ox value indicates that the origin is located to the left of the left edge of the image, while the negative Oy value indicates that the origin is located above the top line of the image.  
Optional boolean integer that returns the direction of the vertical axis. Can be one of the following values:  
FALSE=0 – indicates a default downward direction for the Y-axis.  
TRUE=1 – indicates an inverted upward direction for the Y-axis.  
Error flags

The flag set if successful.  
The flag set if failed.  


This set of statements retrieves parameters of the calibration scale of a sample image and prints them in the terminal window:  
setCurDir ("samples")  
loadIm (1,"sample8.iwd")  
print "unit = ",unit  
print "Xscale=",xscale  
print "Yscale=",yscale   
print "XOrigin=",ox  
print "YOrigin=",oy  
if invert = TRUE then print("Downward direction for Y-axis")  
else print ("Upward direction for Y-axis")