TestCenter Reference
HelperFunctions.py File Reference

Go to the source code of this file.

Namespaces

namespace  TestSupport
 A package of python modules helping to build tests.
 
namespace  TestSupport.HelperFunctions
 

Functions

 TestSupport.HelperFunctions.generateTestDictionary (function, testDictionaries)
 Concatenates test dictionaries and sets a function that needs to be tested in the final dictionary.
 
 TestSupport.HelperFunctions.initModuleFromTemplate (targetModuleName, templateModuleName=None, fieldValueOverrides=None, alsoInitNonEditableFields=False)
 Copies all values from a reference module's editable parameter fields to the target ('test') module.
 
 TestSupport.HelperFunctions.getMinMax (fv1, fv2=None)
 Determines max/min value of given fill value(s).
 
 TestSupport.HelperFunctions.getNumComponentsFromImage (imageField)
 Returns the number of components of an ML-image data type.
 
 TestSupport.HelperFunctions.getNumComponentsFromString (dataType)
 Returns the number of components of a data type given as string.
 
 TestSupport.HelperFunctions.getNumpyTypeFromImage (imageField, context=None)
 Returns the NumPy data type of an ML-Image.
 
 TestSupport.HelperFunctions.getNumpyTypeFromString (dataType)
 Returns the NumPy data type appropriate to a data type given as string.
 
 TestSupport.HelperFunctions.castToNumpy (value, numpyType)
 Casts a value to a NumPy type.
 
 TestSupport.HelperFunctions.convertVoxelType (voxel, oldType, newType)
 Converts a voxel to a new data type.
 
 TestSupport.HelperFunctions.getImage3D (imageField, imageStart=(0, 0, 0), imageSize=None, context=None)
 Returns ML image output of given module in 3 dimensions.
 
 TestSupport.HelperFunctions.getImage6D (imageField, imageStart=(0, 0, 0, 0, 0, 0), imageSize=None, context=None)
 Returns ML image output of given module in 6 dimensions.
 
 TestSupport.HelperFunctions.compareImages3D (resultImage, expectedImage)
 Compares voxels of a result image with an expected image in 3 dimensions.
 
 TestSupport.HelperFunctions.compareImages6D (resultImage, expectedImage)
 Compares voxels of a result image with an expected image in 6 dimensions.
 

Variables

bool TestSupport.HelperFunctions.LOGVOXEL = False
 
bool TestSupport.HelperFunctions.LOGONSUCCESS = False
 
float TestSupport.HelperFunctions.EPSILON = 0.0001
 
dict TestSupport.HelperFunctions.INTTYPES