Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Classes | Functions
vtkMRMLCoreTestingUtilities Namespace Reference

Classes

class  vtkMRMLNodeCallback
 

Functions

VTK_MRML_EXPORT bool CheckNodeIdAndName (int line, vtkMRMLNode *node, const char *expectedID, const char *expectedName)
 
VTK_MRML_EXPORT bool CheckNodeInSceneByID (int line, vtkMRMLScene *scene, const char *nodeID, vtkMRMLNode *expected)
 
VTK_MRML_EXPORT int ExerciseAllBasicMRMLMethods (vtkMRMLNode *object)
 
VTK_MRML_EXPORT int ExerciseBasicDisplayableMRMLMethods (vtkMRMLDisplayableNode *node)
 
VTK_MRML_EXPORT int ExerciseBasicDisplayMRMLMethods (vtkMRMLDisplayNode *node)
 
VTK_MRML_EXPORT int ExerciseBasicMRMLMethods (vtkMRMLNode *node)
 Slicer Libs/MRML/vtkMRMLNode exercises. More...
 
VTK_MRML_EXPORT int ExerciseBasicObjectMethods (vtkObject *object)
 Test basic VTK object methods (print, superclass, etc.) More...
 
VTK_MRML_EXPORT int ExerciseBasicStorableMRMLMethods (vtkMRMLStorableNode *node)
 
VTK_MRML_EXPORT int ExerciseBasicStorageMRMLMethods (vtkMRMLStorageNode *node)
 
VTK_MRML_EXPORT int ExerciseBasicTransformableMRMLMethods (vtkMRMLTransformableNode *node)
 
VTK_MRML_EXPORT int ExerciseBasicTransformMRMLMethods (vtkMRMLTransformNode *node)
 
VTK_MRML_EXPORT int ExerciseSceneLoadingMethods (const char *sceneFilePath, vtkMRMLScene *inputScene=nullptr)
 
VTK_MRML_EXPORT int GetExpectedNodeAddedClassNames (const char *sceneFilePath, std::vector< std::string > &expectedNodeAddedClassNames)
 Return list of node that should be added to the scene. More...
 
template<typename Type >
std::string ToString (Type value)
 

Detailed Description

This module provides functions to facilitate writing tests.

Usually these test methods are used by single-line convenience macros defined in vtkMRMLCoreTestingMacros.h.

Function Documentation

◆ CheckNodeIdAndName()

VTK_MRML_EXPORT bool vtkMRMLCoreTestingUtilities::CheckNodeIdAndName ( int  line,
vtkMRMLNode node,
const char *  expectedID,
const char *  expectedName 
)

◆ CheckNodeInSceneByID()

VTK_MRML_EXPORT bool vtkMRMLCoreTestingUtilities::CheckNodeInSceneByID ( int  line,
vtkMRMLScene scene,
const char *  nodeID,
vtkMRMLNode expected 
)

◆ ExerciseAllBasicMRMLMethods()

VTK_MRML_EXPORT int vtkMRMLCoreTestingUtilities::ExerciseAllBasicMRMLMethods ( vtkMRMLNode object)

Tests all basic MRML methods available for the current class. Internally it calls ExerciseBasicObjectMethods, ExerciseBasicMRMLMethods, ExerciseBasicTransformableMRMLMethods, ExerciseBasicStorableMRMLMethods, etc.

◆ ExerciseBasicDisplayableMRMLMethods()

VTK_MRML_EXPORT int vtkMRMLCoreTestingUtilities::ExerciseBasicDisplayableMRMLMethods ( vtkMRMLDisplayableNode node)

For testing nodes in Libs/MRML that are displayable. Calls the basic transformable mrml methods macro first.

◆ ExerciseBasicDisplayMRMLMethods()

VTK_MRML_EXPORT int vtkMRMLCoreTestingUtilities::ExerciseBasicDisplayMRMLMethods ( vtkMRMLDisplayNode node)

For testing nodes in Libs/MRML that are subclasses of the display node. Calls the basic mrml methods macro first.

◆ ExerciseBasicMRMLMethods()

VTK_MRML_EXPORT int vtkMRMLCoreTestingUtilities::ExerciseBasicMRMLMethods ( vtkMRMLNode node)

Slicer Libs/MRML/vtkMRMLNode exercises.

◆ ExerciseBasicObjectMethods()

VTK_MRML_EXPORT int vtkMRMLCoreTestingUtilities::ExerciseBasicObjectMethods ( vtkObject *  object)

Test basic VTK object methods (print, superclass, etc.)

◆ ExerciseBasicStorableMRMLMethods()

VTK_MRML_EXPORT int vtkMRMLCoreTestingUtilities::ExerciseBasicStorableMRMLMethods ( vtkMRMLStorableNode node)

For testing nodes in Libs/MRML that are storable. Calls the basic mrml methods macro first.

◆ ExerciseBasicStorageMRMLMethods()

VTK_MRML_EXPORT int vtkMRMLCoreTestingUtilities::ExerciseBasicStorageMRMLMethods ( vtkMRMLStorageNode node)

For testing nodes in Libs/MRML that are subclasses of the storage node. Calls the basic mrml methods macro first.

◆ ExerciseBasicTransformableMRMLMethods()

VTK_MRML_EXPORT int vtkMRMLCoreTestingUtilities::ExerciseBasicTransformableMRMLMethods ( vtkMRMLTransformableNode node)

For testing nodes in Libs/MRML that are transformable. Calls the basic storable mrml methods macro first.

◆ ExerciseBasicTransformMRMLMethods()

VTK_MRML_EXPORT int vtkMRMLCoreTestingUtilities::ExerciseBasicTransformMRMLMethods ( vtkMRMLTransformNode node)

For testing nodes in Libs/MRML that are transform nodes. Calls the basic storable mrml methods macro first.

◆ ExerciseSceneLoadingMethods()

VTK_MRML_EXPORT int vtkMRMLCoreTestingUtilities::ExerciseSceneLoadingMethods ( const char *  sceneFilePath,
vtkMRMLScene inputScene = nullptr 
)

Test scene loading and import with a custom scene. This is a utility function because scene import of custom MRML nodes cannot be tested in the base MRML library. If inputScene is provided then that scene will be used for testing scene loading. It is needed when custom node registration is necessary in the scene.

◆ GetExpectedNodeAddedClassNames()

VTK_MRML_EXPORT int vtkMRMLCoreTestingUtilities::GetExpectedNodeAddedClassNames ( const char *  sceneFilePath,
std::vector< std::string > &  expectedNodeAddedClassNames 
)

Return list of node that should be added to the scene.

◆ ToString()

template<typename Type >
std::string vtkMRMLCoreTestingUtilities::ToString ( Type  value)