NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
Public Member Functions | List of all members
vtkCalibratedModelRenderingPipeline Class Reference

Used to quickly make test harnesses demos and research prototypes. More...

Public Member Functions

 vtkCalibratedModelRenderingPipeline (const std::string &name, const mitk::Point2I &windowSize, const mitk::Point2I &calibratedWindowSize, const std::string &leftIntrinsicsFileName, const std::string &rightIntrinsicsFileName, const std::string &visualisationModelFileName, const std::string &rightToLeftFileName, const std::string &textureFileName, const std::string &trackingModelFileName, const std::string &ultrasoundCalibrationMatrixFileName, const std::string &ultrasoundImageFileName, const float &trackingGlyphRadius)
 Constructor. More...
 
virtual ~vtkCalibratedModelRenderingPipeline ()
 
std::string GetName () const
 Returns the name of this object, just used for reference. More...
 
void SetIsRightHandCamera (const bool &isRight)
 This class can be setup to be a right or left handed camera in a stereo camera pair. More...
 
bool GetIsRightHandCamera () const
 Get the right(true)/left(false) indicator. More...
 
virtual void Render ()
 Updates the whole VTK pipeline. More...
 
void DumpScreen (const std::string fileName)
 Updates screen and writes to specified file. More...
 
void SaveModelToWorld (const std::string &fileName)
 Saves the Model to World transform to file. More...
 
void SaveCameraToWorld (const std::string &fileName)
 Saves the Camera to World transform to file. More...
 
void SetModelToWorldMatrix (const vtkMatrix4x4 &modelToWorld)
 Multiplies model vtkPolyData points by modelToWorld to give a position in world coordinates, having the effect of moving the model relative to the world coordinates. More...
 
void SetModelToWorldTransform (const std::vector< float > &)
 Sets transform using rx,ry,rz (degrees), tx,ty,rz (mm). More...
 
void SetCameraToWorldMatrix (const vtkMatrix4x4 &cameraToWorld)
 Used to set the camera position in world coordinates. More...
 
void SetCameraToWorldTransform (const std::vector< float > &)
 Sets transform using rx,ry,rz (degrees), tx,ty,rz (mm). More...
 
void SetWorldToCameraMatrix (const vtkMatrix4x4 &worldToCamera)
 Used to set the camera position in world coordinates. More...
 
void SetWorldToCameraTransform (const std::vector< float > &)
 Sets transform using rx,ry,rz (degrees), tx,ty,rz (mm). More...
 
bool IsFacingCamera (const double normal[3])
 Returns true if point is deemed to be facing camera. normal vector of a point in world coordinates. More...
 
void ProjectPoint (const double world[3], double imagePoint[2])
 projects a point from world 3D to image 2D. More...
 
void ProjectToCameraSpace (const double worldPoint[3], double cameraPoint[3])
 projects a point from world 3D to camera 3D. More...
 
vtkPolyData * GetTrackingModel () const
 Returns a pointer to the tracking model, so external classes can iterate over points for instance. More...
 
vtkRenderWindow * GetRenderWindow () const
 Returns a point to the vtkRenderWindow. More...
 

Detailed Description

Used to quickly make test harnesses demos and research prototypes.

Loads camera calibration files and displays a perspective projection without doing distortion correction (i.e. just does intrinsic and extrinsic).

Constructor & Destructor Documentation

vtkCalibratedModelRenderingPipeline::vtkCalibratedModelRenderingPipeline ( const std::string name,
const mitk::Point2I &  windowSize,
const mitk::Point2I &  calibratedWindowSize,
const std::string leftIntrinsicsFileName,
const std::string rightIntrinsicsFileName,
const std::string visualisationModelFileName,
const std::string rightToLeftFileName,
const std::string textureFileName,
const std::string trackingModelFileName,
const std::string ultrasoundCalibrationMatrixFileName,
const std::string ultrasoundImageFileName,
const float &  trackingGlyphRadius 
)

Constructor.

Parameters
name
windowSizeThe actual window size we want to represent (e.g. 1920, 1080)
calibratedWindowSizeFor calibrated camera model, we specify the size of the window that the calibration (e.g. niftkCameraCalibration) was done at. (e.g. 1920,540)
leftIntrinsicsFileNameFilename containing intrinsic parameters, as output by other NifTK programs such as niftkCameraCalibration.
rightIntrinsicsFileNameFilename containing intrinsic parameters, as output by other NifTK programs such as niftkCameraCalibration.
visualisationModelFileNameFilename of vtkPolyData that will be rendered at a given pose.
textureFileNameIf not-empty, and if loadable, will be texture mapped onto the visualisationModel.
rightToLeftFileNameIf not-empty, and if loadable, will be added into camera matrices to simulate a right-hand camera. Default is left.
trackingModelFileNameIf not-empty, and if loadable, will also be rendered, where each surface point is combined with a sphere glyph.
ultrasoundCalibrationMatrixFileNameIf not-empty, and if loadable, and if ultrasoundImageFileName is also set, will also render the ultrasound image in place.
ultrasoundImageFileNameIf not-empty, and if loadable, and if ultrasoundCalibrationMatrixFileName is also set, will also render the ultrasound image in place.
vtkCalibratedModelRenderingPipeline::~vtkCalibratedModelRenderingPipeline ( )
virtual

Member Function Documentation

void vtkCalibratedModelRenderingPipeline::DumpScreen ( const std::string  fileName)

Updates screen and writes to specified file.

Parameters
fileNamefile name
bool vtkCalibratedModelRenderingPipeline::GetIsRightHandCamera ( ) const
inline

Get the right(true)/left(false) indicator.

std::string vtkCalibratedModelRenderingPipeline::GetName ( ) const
inline

Returns the name of this object, just used for reference.

vtkRenderWindow * vtkCalibratedModelRenderingPipeline::GetRenderWindow ( ) const

Returns a point to the vtkRenderWindow.

vtkPolyData * vtkCalibratedModelRenderingPipeline::GetTrackingModel ( ) const

Returns a pointer to the tracking model, so external classes can iterate over points for instance.

bool vtkCalibratedModelRenderingPipeline::IsFacingCamera ( const double  normal[3])

Returns true if point is deemed to be facing camera. normal vector of a point in world coordinates.

void vtkCalibratedModelRenderingPipeline::ProjectPoint ( const double  world[3],
double  imagePoint[2] 
)

projects a point from world 3D to image 2D.

void vtkCalibratedModelRenderingPipeline::ProjectToCameraSpace ( const double  worldPoint[3],
double  cameraPoint[3] 
)

projects a point from world 3D to camera 3D.

void vtkCalibratedModelRenderingPipeline::Render ( )
virtual

Updates the whole VTK pipeline.

void vtkCalibratedModelRenderingPipeline::SaveCameraToWorld ( const std::string fileName)

Saves the Camera to World transform to file.

Parameters
fileName
void vtkCalibratedModelRenderingPipeline::SaveModelToWorld ( const std::string fileName)

Saves the Model to World transform to file.

Parameters
fileName
void vtkCalibratedModelRenderingPipeline::SetCameraToWorldMatrix ( const vtkMatrix4x4 &  cameraToWorld)

Used to set the camera position in world coordinates.

Parameters
cameraToWorldrigid body transform
void vtkCalibratedModelRenderingPipeline::SetCameraToWorldTransform ( const std::vector< float > &  transform)

Sets transform using rx,ry,rz (degrees), tx,ty,rz (mm).

void vtkCalibratedModelRenderingPipeline::SetIsRightHandCamera ( const bool &  isRight)

This class can be setup to be a right or left handed camera in a stereo camera pair.

void vtkCalibratedModelRenderingPipeline::SetModelToWorldMatrix ( const vtkMatrix4x4 &  modelToWorld)

Multiplies model vtkPolyData points by modelToWorld to give a position in world coordinates, having the effect of moving the model relative to the world coordinates.

Parameters
modelToWorldrigid body transform
void vtkCalibratedModelRenderingPipeline::SetModelToWorldTransform ( const std::vector< float > &  transform)

Sets transform using rx,ry,rz (degrees), tx,ty,rz (mm).

void vtkCalibratedModelRenderingPipeline::SetWorldToCameraMatrix ( const vtkMatrix4x4 &  worldToCamera)

Used to set the camera position in world coordinates.

Parameters
worldToCamerarigid body transform
void vtkCalibratedModelRenderingPipeline::SetWorldToCameraTransform ( const std::vector< float > &  transform)

Sets transform using rx,ry,rz (degrees), tx,ty,rz (mm).


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