TestCenter Reference
|
Support functions regarding image handling. More...
Functions | |
calculateHashFromImage (fileName, hashMethod='SHA256', encoder='Hex') | |
Calculate the hash of the given image. | |
getVoxelValue (outFieldName, position, coordinateType="Voxel", useStoredValue=False) | |
Get the voxel value of the given field at the given position. | |
compareImages (outFieldA, outFieldB) | |
Compare the two given images (excluding the extention properties). | |
compareImagesProperties (outFieldA, outFieldB) | |
Compare just the properties of the two given images (excluding page extent, the extension properties, and of course the image data). | |
compareImagesData (outFieldA, outFieldB) | |
Compare the two given images (only verifying data). | |
compareImagesAllProps (outFieldA, outFieldB) | |
Compare the two given images. | |
getTrueMinMaxValues (outFieldName) | |
Returns the true min/max range of the image data, which is therefore scanned entirely using a MinMaxScan module. | |
verifyMinMaxPropertyValues (outFieldName, expectedMin=None, expectedMax=None, requireExactMin=False, requireExactMax=False, logOnSuccess=True) | |
Verifies the min/max image property values. | |
Support functions regarding image handling.
TestSupport.Image.calculateHashFromImage | ( | fileName, | |
hashMethod = 'SHA256', | |||
encoder = 'Hex' ) |
Calculate the hash of the given image.
The method will use the ImageHash module to get the hash of the images content. For supported hash methods and encodings see ImageHash module.
fileName | The name of the input file. |
hashMethod | The hash to be computed. |
encoder | The encoder to be used. |
TestSupport.Image.compareImages | ( | outFieldA, | |
outFieldB ) |
TestSupport.Image.compareImagesAllProps | ( | outFieldA, | |
outFieldB ) |
TestSupport.Image.compareImagesData | ( | outFieldA, | |
outFieldB ) |
TestSupport.Image.compareImagesProperties | ( | outFieldA, | |
outFieldB ) |
TestSupport.Image.getTrueMinMaxValues | ( | outFieldName | ) |
Returns the true min/max range of the image data, which is therefore scanned entirely using a MinMaxScan module.
outFieldName | String: Name of the output image field |
Definition at line 138 of file Image.py.
Referenced by TestSupport.Image.verifyMinMaxPropertyValues().
TestSupport.Image.getVoxelValue | ( | outFieldName, | |
position, | |||
coordinateType = "Voxel", | |||
useStoredValue = False ) |
Get the voxel value of the given field at the given position.
The coordinate type is either "Voxel" or "World". The return value is a tuple with the string and scalar representation of the voxel value.
outFieldName | Name of the output field. |
position | The position as a string. |
coordinateType | Type of coordinate system. |
useStoredValue | Use the stored value instead of the output value. |
TestSupport.Image.verifyMinMaxPropertyValues | ( | outFieldName, | |
expectedMin = None, | |||
expectedMax = None, | |||
requireExactMin = False, | |||
requireExactMax = False, | |||
logOnSuccess = True ) |
Verifies the min/max image property values.
By default (none of the optional arguments provided) the functions just checks if the min/max range specified by the image properties include the actual min/max range of the image data, which is therefore scanned. Note that this check is always done, since ML images always need to fulfill the condition. In addition, it is possible to check against expected values, or to require exact matches of the range boundaries (using the expected values, if provided, and the actual values otherwise). Logs an error if the output image is valid and any of the checks fail. @outFieldName String: Name of the output image field to perform the check on.
expectedMin | Number: If given, the minimum value image property is compared against expectedMin |
expectedMax | Number: If given, the maximum value image property is compared against expectedMax |
requireExactMin | Bool: If given, the minimum value image property must be identical to expectedMin (if given) or the actual image minimum (otherwise) |
requireExactMax | Bool: If given, the maximum value image property must be identical to expectedMax (if given) or the actual image maximum (otherwise) |
logOnSuccess | Bool: If enabled, provide success message |
Definition at line 159 of file Image.py.
References TestSupport.Image.getTrueMinMaxValues().