NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
Public Types | Public Member Functions | Static Public Member Functions | List of all members
niftk::SingleViewerWidgetTestClass Class Reference
Inheritance diagram for niftk::SingleViewerWidgetTestClass:
Inheritance graph
[legend]
Collaboration diagram for niftk::SingleViewerWidgetTestClass:
Collaboration graph
[legend]

Public Types

enum  WorldAxes { SagittalAxis, CoronalAxis, AxialAxis }
 
typedef
AtomicStateTransitionTester
< const SingleViewerWidget
*, SingleViewerWidgetState
ViewerStateTester
 
typedef SingleViewerWidgetState ViewerState
 
typedef SingleViewerWidgetTestClass Self
 

Public Member Functions

 SingleViewerWidgetTestClass ()
 Constructs a niftkSingleViewerWidgetTestClass object. More...
 
virtual ~SingleViewerWidgetTestClass ()
 Destructs the niftkSingleViewerWidgetTestClass object. More...
 
std::string GetFileName () const
 Gets the name of the image file to load into the viewer. More...
 
void SetFileName (const std::string &fileName)
 Sets the name of the image file to load into the viewer. More...
 
bool GetInteractiveMode () const
 Gets the interactive mode. In interactive mode the windows are not closed when the test is finished. More...
 
void SetInteractiveMode (bool interactiveMode)
 Sets the interactive mode. In interactive mode the windows are not closed when the test is finished. More...
 
mitk::Point3D GetWorldPositionAtDisplayPosition (int orientation, const mitk::Vector2D &displayPosition)
 
mitk::Vector2D GetDisplayPositionAtWorldPosition (int orientation, const mitk::Point3D &worldPosition)
 
mitk::Vector2D GetCentrePosition (int windowIndex)
 Gets the position of the centre of the displayed region, relative to the render window. More...
 
std::vector< mitk::Vector2D > GetCentrePositions ()
 Gets the position of the centre of the displayed regions, relative to their render windows. More...
 
double GetVoxelCentreCoordinate (int axis, double coordinate)
 Gets one coordinate of the centre of the voxel that contains the given coordinate along the axis. More...
 
mitk::Point3D GetVoxelCentrePosition (const mitk::Point3D &position)
 Gets the position of the centre of the voxel that contains the given position. More...
 
bool Equals (const mitk::Point3D &selectedPosition1, const mitk::Point3D &selectedPosition2, double tolerance=-1.0)
 Determines if two world positions are equal with the certain tolerance. By default, or if negative value is specified, the tolerance is half voxel for each coordinate. Converting the positions to voxel space should result equal coordinates. More...
 
bool Equals (const std::vector< mitk::Vector2D > &cursorPositions1, const std::vector< mitk::Vector2D > &cursorPositions2, double tolerance=0.01)
 Determines if two vectors of cursor positions are equal with the given tolerance. The function assumes that the vectors contain three elements. More...
 
mitk::Point3D GetRandomWorldPosition () const
 Gives a random position from the image volume, in mm coordinates. More...
 
void SetRandomPositions ()
 Sets random selected position, cursor positions and scale factors for the viewer. More...
 

Static Public Member Functions

static mitk::Point3D GetWorldOrigin (const mitk::BaseGeometry *geometry)
 Calculates the world origin from a 3D geometry. The world origin is the centre of the bottom-left-back voxel for image geometries and the bottom-left-back corner of the bottom-left-back voxel for non-image geometries. More...
 
static mitk::Vector3D GetWorldUpDirections (const mitk::BaseGeometry *geometry)
 Calculates the up direction of the world axes from a 3D geometry. More...
 
static std::vector< intGetWorldAxes (const mitk::Geometry3D *geometry)
 Calculates the world axes from a 3D geometry. More...
 
static mitk::Point3D GetWorldBottomLeftBackCorner (const mitk::BaseGeometry *geometry)
 Calculates the world origin from a 3D geometry. The world origin is the centre of the bottom-left-back voxel for image geometries and the bottom-left-back corner of the bottom-left-back voxel for non-image geometries. More...
 
static QPoint GetPointAtCursorPosition (QmitkRenderWindow *renderWindow, const mitk::Vector2D &cursorPosition)
 Converts a cursor position in a render window to a point on the screen. The cursor position is a relative position within the render window normalised to the render window size. The bottom left position is (0.0, 0.0), the top right position is (1.0, 1.0). More...
 
static mitk::Vector2D GetDisplayPositionAtPoint (QmitkRenderWindow *renderWindow, const QPoint &point)
 Converts a point on the screen to a cursor position in a render window. The cursor position is a relative position within the render window normalised to the render window size. The bottom left position is (0.0, 0.0), the top right position is (1.0, 1.0). More...
 
static bool Equals (const mitk::Vector2D &cursorPosition1, const mitk::Vector2D &cursorPosition2, double tolerance=0.01)
 Determines if two cursor positions are equal with the given tolerance. More...
 
static mitk::Vector2D GetRandomDisplayPosition ()
 Gives a random position in the render window, normalised with the render window size. The measurement is unit (i.e. px/px). More...
 
static std::vector
< mitk::Vector2D > 
GetRandomDisplayPositions (std::vcl_size_t size=std::vcl_size_t(3))
 Gives a vector of random diplay positions, normalised with the render window size. More...
 
static double GetRandomScaleFactor ()
 Gives a random scale factor (mm/px) within the range (0.0, 2.0). More...
 
static std::vector< double > GetRandomScaleFactors (std::vcl_size_t size=std::vcl_size_t(3))
 Gives a vector of random scale factors (mm/px) within the range (0.0, 2.0). More...
 

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
SagittalAxis 
CoronalAxis 
AxialAxis 

Constructor & Destructor Documentation

niftk::SingleViewerWidgetTestClass::SingleViewerWidgetTestClass ( )
explicit

Constructs a niftkSingleViewerWidgetTestClass object.

niftk::SingleViewerWidgetTestClass::~SingleViewerWidgetTestClass ( )
virtual

Destructs the niftkSingleViewerWidgetTestClass object.

Member Function Documentation

bool niftk::SingleViewerWidgetTestClass::Equals ( const mitk::Point3D &  selectedPosition1,
const mitk::Point3D &  selectedPosition2,
double  tolerance = -1.0 
)

Determines if two world positions are equal with the certain tolerance. By default, or if negative value is specified, the tolerance is half voxel for each coordinate. Converting the positions to voxel space should result equal coordinates.

bool niftk::SingleViewerWidgetTestClass::Equals ( const mitk::Vector2D &  cursorPosition1,
const mitk::Vector2D &  cursorPosition2,
double  tolerance = 0.01 
)
static

Determines if two cursor positions are equal with the given tolerance.

bool niftk::SingleViewerWidgetTestClass::Equals ( const std::vector< mitk::Vector2D > &  cursorPositions1,
const std::vector< mitk::Vector2D > &  cursorPositions2,
double  tolerance = 0.01 
)

Determines if two vectors of cursor positions are equal with the given tolerance. The function assumes that the vectors contain three elements.

mitk::Vector2D niftk::SingleViewerWidgetTestClass::GetCentrePosition ( int  windowIndex)

Gets the position of the centre of the displayed region, relative to the render window.

std::vector< mitk::Vector2D > niftk::SingleViewerWidgetTestClass::GetCentrePositions ( )

Gets the position of the centre of the displayed regions, relative to their render windows.

This is not necessary but makes the printed results easier to read.

mitk::Vector2D niftk::SingleViewerWidgetTestClass::GetDisplayPositionAtPoint ( QmitkRenderWindow *  renderWindow,
const QPoint &  point 
)
static

Converts a point on the screen to a cursor position in a render window. The cursor position is a relative position within the render window normalised to the render window size. The bottom left position is (0.0, 0.0), the top right position is (1.0, 1.0).

mitk::Vector2D niftk::SingleViewerWidgetTestClass::GetDisplayPositionAtWorldPosition ( int  orientation,
const mitk::Point3D &  worldPosition 
)
std::string niftk::SingleViewerWidgetTestClass::GetFileName ( ) const

Gets the name of the image file to load into the viewer.

bool niftk::SingleViewerWidgetTestClass::GetInteractiveMode ( ) const

Gets the interactive mode. In interactive mode the windows are not closed when the test is finished.

QPoint niftk::SingleViewerWidgetTestClass::GetPointAtCursorPosition ( QmitkRenderWindow *  renderWindow,
const mitk::Vector2D &  cursorPosition 
)
static

Converts a cursor position in a render window to a point on the screen. The cursor position is a relative position within the render window normalised to the render window size. The bottom left position is (0.0, 0.0), the top right position is (1.0, 1.0).

mitk::Vector2D niftk::SingleViewerWidgetTestClass::GetRandomDisplayPosition ( )
static

Gives a random position in the render window, normalised with the render window size. The measurement is unit (i.e. px/px).

std::vector< mitk::Vector2D > niftk::SingleViewerWidgetTestClass::GetRandomDisplayPositions ( std::vcl_size_t  size = std::vcl_size_t(3))
static

Gives a vector of random diplay positions, normalised with the render window size.

double niftk::SingleViewerWidgetTestClass::GetRandomScaleFactor ( )
static

Gives a random scale factor (mm/px) within the range (0.0, 2.0).

std::vector< double > niftk::SingleViewerWidgetTestClass::GetRandomScaleFactors ( std::vcl_size_t  size = std::vcl_size_t(3))
static

Gives a vector of random scale factors (mm/px) within the range (0.0, 2.0).

mitk::Point3D niftk::SingleViewerWidgetTestClass::GetRandomWorldPosition ( ) const

Gives a random position from the image volume, in mm coordinates.

double niftk::SingleViewerWidgetTestClass::GetVoxelCentreCoordinate ( int  axis,
double  coordinate 
)

Gets one coordinate of the centre of the voxel that contains the given coordinate along the axis.

mitk::Point3D niftk::SingleViewerWidgetTestClass::GetVoxelCentrePosition ( const mitk::Point3D &  position)

Gets the position of the centre of the voxel that contains the given position.

static std::vector<int> niftk::SingleViewerWidgetTestClass::GetWorldAxes ( const mitk::Geometry3D *  geometry)
static

Calculates the world axes from a 3D geometry.

mitk::Point3D niftk::SingleViewerWidgetTestClass::GetWorldBottomLeftBackCorner ( const mitk::BaseGeometry *  geometry)
static

Calculates the world origin from a 3D geometry. The world origin is the centre of the bottom-left-back voxel for image geometries and the bottom-left-back corner of the bottom-left-back voxel for non-image geometries.

TODO !!! This line should not be needed. !!!

mitk::Point3D niftk::SingleViewerWidgetTestClass::GetWorldOrigin ( const mitk::BaseGeometry *  geometry)
static

Calculates the world origin from a 3D geometry. The world origin is the centre of the bottom-left-back voxel for image geometries and the bottom-left-back corner of the bottom-left-back voxel for non-image geometries.

mitk::Point3D niftk::SingleViewerWidgetTestClass::GetWorldPositionAtDisplayPosition ( int  orientation,
const mitk::Vector2D &  displayPosition 
)
mitk::Vector3D niftk::SingleViewerWidgetTestClass::GetWorldUpDirections ( const mitk::BaseGeometry *  geometry)
static

Calculates the up direction of the world axes from a 3D geometry.

void niftk::SingleViewerWidgetTestClass::SetFileName ( const std::string fileName)

Sets the name of the image file to load into the viewer.

void niftk::SingleViewerWidgetTestClass::SetInteractiveMode ( bool  interactiveMode)

Sets the interactive mode. In interactive mode the windows are not closed when the test is finished.

void niftk::SingleViewerWidgetTestClass::SetRandomPositions ( )

Sets random selected position, cursor positions and scale factors for the viewer.


The documentation for this class was generated from the following files: