Medical Imaging Interaction Toolkit
2023.12.00
Medical Imaging Interaction Toolkit
|
Helper class providing functions which are useful for multiple usage. More...
#include <mitkToFProcessingCommon.h>
Public Types | |
typedef double | ToFScalarType |
typedef itk::Point< ToFScalarType, 2 > | ToFPoint2D |
typedef itk::Point< ToFScalarType, 3 > | ToFPoint3D |
typedef itk::Vector< ToFScalarType, 2 > | ToFVector2D |
typedef itk::Vector< ToFScalarType, 3 > | ToFVector3D |
Static Public Member Functions | |
static ToFPoint3D | IndexToCartesianCoordinates (unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY) |
Convert index based distances to cartesian coordinates. More... | |
static ToFPoint3D | IndexToCartesianCoordinates (unsigned int i, unsigned int j, ToFScalarType distance, ToFPoint2D focalLength, ToFPoint2D principalPoint) |
Convert index based distances to cartesian coordinates. More... | |
static ToFPoint3D | IndexToCartesianCoordinates (itk::Index< 3 > index, ToFScalarType distance, ToFPoint2D focalLength, ToFPoint2D principalPoint) |
Convert index based distances to cartesian coordinates. More... | |
static ToFPoint3D | IndexToCartesianCoordinates (unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLength[2], ToFScalarType principalPoint[2]) |
Convenience method to convert index based distances to cartesian coordinates using array as input. More... | |
static ToFPoint3D | IndexToCartesianCoordinatesWithInterpixdist (unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLength, ToFScalarType interPixelDistanceX, ToFScalarType interPixelDistanceY, ToFScalarType principalPointX, ToFScalarType principalPointY) |
Convert index based distances to cartesian coordinates. More... | |
static ToFPoint3D | IndexToCartesianCoordinatesWithInterpixdist (unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLength, ToFPoint2D interPixelDistance, ToFPoint2D principalPoint) |
Convert index based distances to cartesian coordinates. More... | |
static ToFPoint3D | IndexToCartesianCoordinatesWithInterpixdist (itk::Index< 3 > index, ToFScalarType distance, ToFScalarType focalLength, ToFPoint2D interPixelDistance, ToFPoint2D principalPoint) |
Convert index based distances to cartesian coordinates. More... | |
static ToFPoint3D | IndexToCartesianCoordinatesWithInterpixdist (unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLength, ToFScalarType interPixelDistance[2], ToFScalarType principalPoint[2]) |
Convenience method to convert index based distances to cartesian coordinates using array as input. More... | |
static ToFPoint3D | CartesianToIndexCoordinates (ToFScalarType cartesianPointX, ToFScalarType cartesianPointY, ToFScalarType cartesianPointZ, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY, bool calculateDistance=true) |
Convert cartesian coordinates to index based distances. More... | |
static ToFPoint3D | CartesianToIndexCoordinates (ToFScalarType cartesianPoint[3], ToFScalarType focalLength[2], ToFScalarType principalPoint[2], bool calculateDistance=true) |
Convenience method to convert cartesian coordinates to index based distances using arrays. More... | |
static ToFPoint3D | CartesianToIndexCoordinates (ToFPoint3D cartesianPoint, ToFPoint2D focalLength, ToFPoint2D principalPoint, bool calculateDistance=true) |
Convert cartesian coordinates to index based distances. More... | |
static ToFPoint3D | CartesianToIndexCoordinatesWithInterpixdist (ToFScalarType cartesianPointX, ToFScalarType cartesianPointY, ToFScalarType cartesianPointZ, ToFScalarType focalLength, ToFScalarType interPixelDistanceX, ToFScalarType interPixelDistanceY, ToFScalarType principalPointX, ToFScalarType principalPointY, bool calculateDistance=true) |
Convert cartesian coordinates to index based distances. More... | |
static ToFPoint3D | CartesianToIndexCoordinatesWithInterpixdist (ToFScalarType cartesianPoint[3], ToFScalarType focalLength, ToFScalarType interPixelDistance[2], ToFScalarType principalPoint[2], bool calculateDistance=true) |
Convenience method to convert cartesian coordinates to index based distances using arrays. More... | |
static ToFPoint3D | CartesianToIndexCoordinatesWithInterpixdist (ToFPoint3D cartesianPoint, ToFScalarType focalLength, ToFPoint2D interPixelDistance, ToFPoint2D principalPoint, bool calculateDistance=true) |
Convert cartesian coordinates to index based distances. More... | |
static ToFProcessingCommon::ToFPoint3D | KinectIndexToCartesianCoordinates (unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY) |
KinectIndexToCartesianCoordinates Convert a pixel (i,j) with value d to a 3D world point. This conversion is meant for Kinect and slightly different then ToF reconstruction. See also "Hacking the Kinect" - Jeff Kramer, Matt Parker, Daniel Herrera C., Nicolas Burrus, Florian Echtler, Chapter 7, Part 1 "Moving from Depth Map to Point Cloud. More... | |
static ToFPoint3D | KinectIndexToCartesianCoordinates (unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLength[2], ToFScalarType principalPoint[2]) |
static ToFPoint3D | KinectIndexToCartesianCoordinates (unsigned int i, unsigned int j, ToFScalarType distance, ToFPoint2D focalLength, ToFPoint2D principalPoint) |
static ToFPoint3D | KinectIndexToCartesianCoordinates (itk::Index< 3 > index, ToFScalarType distance, ToFPoint2D focalLength, ToFPoint2D principalPoint) |
static ToFPoint3D | CartesianToKinectIndexCoordinates (ToFScalarType cartesianPointX, ToFScalarType cartesianPointY, ToFScalarType cartesianPointZ, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY, bool calculateDistance=true) |
CartesianCoordinatesToKinectIndexCoordinates Transform a 3D world point back to distance image pixel coordinates. More... | |
static ToFProcessingCommon::ToFPoint3D | CartesianToKinectIndexCoordinates (ToFPoint3D cartesianPoint, ToFPoint2D focalLength, ToFPoint2D principalPoint, bool calculateDistance=true) |
static ToFProcessingCommon::ToFPoint3D | ContinuousKinectIndexToCartesianCoordinates (mitk::Point2D continuousIndex, ToFScalarType distance, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY) |
ContinuousKinectIndexToCartesianCoordinates This method is escpially meant for reconstructing a Kinect point with continuous index coordinates (i.e. not exactly a pixel position, but a point interpolated between two pixels). The only difference to KinectIndexToCartesianCoordinates() is that ContinuousKinectIndexToCartesianCoordinates does not cast to unsigned int for the index. More... | |
static ToFScalarType | CalculateViewAngle (mitk::CameraIntrinsics::Pointer intrinsics, unsigned int dimX) |
Calculates the horizontal view angle of the camera with the given intrinsics. More... | |
Helper class providing functions which are useful for multiple usage.
Currently the following methods are provided:
The coordinate conversion follows the model of a common pinhole camera where the origin of the camera coordinate system (world coordinates) is at the pinhole
The definition of the image plane and its coordinate systems (pixel and mm) is depicted in the following image
Definition at line 38 of file mitkToFProcessingCommon.h.
typedef itk::Point<ToFScalarType, 2> mitk::ToFProcessingCommon::ToFPoint2D |
Definition at line 42 of file mitkToFProcessingCommon.h.
typedef itk::Point<ToFScalarType, 3> mitk::ToFProcessingCommon::ToFPoint3D |
Definition at line 43 of file mitkToFProcessingCommon.h.
typedef double mitk::ToFProcessingCommon::ToFScalarType |
Definition at line 41 of file mitkToFProcessingCommon.h.
typedef itk::Vector<ToFScalarType, 2> mitk::ToFProcessingCommon::ToFVector2D |
Definition at line 44 of file mitkToFProcessingCommon.h.
typedef itk::Vector<ToFScalarType, 3> mitk::ToFProcessingCommon::ToFVector3D |
Definition at line 45 of file mitkToFProcessingCommon.h.
|
static |
Calculates the horizontal view angle of the camera with the given intrinsics.
intrinsics | intrinsic parameters of the camera |
dimX | dimension of the image in horizontal direction |
angle = atan(principalPoint[0]/focalLength[0]) + atan((dimX-principalPoint[0]/focalLength[0]))
|
inlinestatic |
Convert cartesian coordinates to index based distances.
cartesianPoint | point (of a surface or point set) to convert in 3D coordinates |
focalLength | focal length of optical system in pixel units (mostly obtained from camera calibration) |
principalPoint | coordinates of principal point on image plane in pixel |
calculateDistance | if this flag is set, the distance value is stored in the z position of the output otherwise z=0 |
Definition at line 204 of file mitkToFProcessingCommon.h.
|
inlinestatic |
Convenience method to convert cartesian coordinates to index based distances using arrays.
cartesianPoint | point (of a surface or point set) to convert in 3D coordinates |
focalLength | focal length of optical system in pixel units (mostly obtained from camera calibration) |
principalPoint | coordinates of principal point on image plane in pixel |
calculateDistance | if this flag is set, the distance value is stored in the z position of the output otherwise z=0 |
Definition at line 190 of file mitkToFProcessingCommon.h.
|
static |
Convert cartesian coordinates to index based distances.
cartesianPointX | x coordinate of point (of a surface or point set) to convert in 3D coordinates |
cartesianPointY | y coordinate of point (of a surface or point set) to convert in 3D coordinates |
cartesianPointZ | z coordinate of point (of a surface or point set) to convert in 3D coordinates |
focalLengthX | focal length of optical system in pixel units in x-direction (mostly obtained from camera calibration) |
focalLengthY | focal length of optical system in pixel units in y-direction (mostly obtained from camera calibration) |
principalPointX | x coordinate of principal point on image plane in pixel |
principalPointY | y coordinate of principal point on image plane in pixel |
calculateDistance | if this flag is set, the distance value is stored in the z position of the output otherwise z=0 |
|
inlinestatic |
Convert cartesian coordinates to index based distances.
cartesianPoint | point (of a surface or point set) to convert in 3D coordinates |
focalLength | focal length of optical system in mm (mostly obtained from camera calibration) |
interPixelDistance | distance between adjacent pixels in mm for x and y direction |
principalPoint | coordinates of principal point on image plane in pixel |
calculateDistance | if this flag is set, the distance value is stored in the z position of the output otherwise z=0 |
Definition at line 254 of file mitkToFProcessingCommon.h.
|
inlinestatic |
Convenience method to convert cartesian coordinates to index based distances using arrays.
cartesianPoint | point (of a surface or point set) to convert in 3D coordinates |
focalLength | focal length of optical system in mm (mostly obtained from camera calibration) |
interPixelDistance | distance between adjacent pixels in mm for x and y direction |
principalPoint | coordinates of principal point on image plane in pixel |
calculateDistance | if this flag is set, the distance value is stored in the z position of the output otherwise z=0 |
Definition at line 238 of file mitkToFProcessingCommon.h.
|
static |
Convert cartesian coordinates to index based distances.
cartesianPointX | x coordinate of point (of a surface or point set) to convert in 3D coordinates |
cartesianPointY | y coordinate of point (of a surface or point set) to convert in 3D coordinates |
cartesianPointZ | z coordinate of point (of a surface or point set) to convert in 3D coordinates |
focalLength | focal length of optical system in mm (mostly obtained from camera calibration) |
interPixelDistanceX | distance in x direction between adjacent pixels in mm |
interPixelDistanceY | distance in y direction between adjacent pixels in mm |
principalPointX | x coordinate of principal point on image plane in pixel |
principalPointY | y coordinate of principal point on image plane in pixel |
calculateDistance | if this flag is set, the distance value is stored in the z position of the output otherwise z=0 |
|
inlinestatic |
Definition at line 308 of file mitkToFProcessingCommon.h.
|
static |
CartesianCoordinatesToKinectIndexCoordinates Transform a 3D world point back to distance image pixel coordinates.
cartesianPointX | x value of the cartesian point. |
cartesianPointY | y value of the cartesian point. |
cartesianPointZ | z value of the cartesian point. |
focalLengthX | x value of the focal length (from calibration). |
focalLengthY | y value of the focal length (from calibration). |
principalPointX | x value of the principal point (from calibration). |
principalPointY | y value of the principal point (from calibration). |
calculateDistance | Do you want to compute also the distance of the distance image? For Kinect, this value is always the same in cartesian and index coordinates. |
|
static |
ContinuousKinectIndexToCartesianCoordinates This method is escpially meant for reconstructing a Kinect point with continuous index coordinates (i.e. not exactly a pixel position, but a point interpolated between two pixels). The only difference to KinectIndexToCartesianCoordinates() is that ContinuousKinectIndexToCartesianCoordinates does not cast to unsigned int for the index.
continuousIndex | The continuous coordinates (e.g. 0.5; 0.5). |
distance | Distance value d in mm as obtained from OpenNI. |
focalLengthX | x value of the focal length (from calibration). |
focalLengthY | y value of the focal length (from calibration) |
principalPointX | x value of the principal point (from calibration). |
principalPointY | y value of the principal point (from calibration). |
|
inlinestatic |
Convert index based distances to cartesian coordinates.
index | index coordinates |
distance | distance value at given index in mm |
focalLength | focal length of optical system in pixel units (mostly obtained from camera calibration) |
principalPoint | coordinates of principal point on image plane in pixel |
Definition at line 84 of file mitkToFProcessingCommon.h.
|
inlinestatic |
Convert index based distances to cartesian coordinates.
i | index in x direction of image plane |
j | index in y direction of image plane |
distance | distance value at given index in mm |
focalLength | focal length of optical system in pixel units (mostly obtained from camera calibration) |
principalPoint | coordinates of principal point on image plane in pixel |
Definition at line 70 of file mitkToFProcessingCommon.h.
|
inlinestatic |
Convenience method to convert index based distances to cartesian coordinates using array as input.
i | index in x direction of image plane |
j | index in y direction of image plane |
distance | distance value at given index in mm |
focalLength | focal length of optical system in pixel units (mostly obtained from camera calibration) |
principalPoint | coordinates of principal point on image plane in pixel |
Definition at line 98 of file mitkToFProcessingCommon.h.
|
static |
Convert index based distances to cartesian coordinates.
i | index in x direction of image plane |
j | index in y direction of image plane |
distance | distance value at given index in mm |
focalLengthX | focal length of optical system in pixel units in x-direction (mostly obtained from camera calibration) |
focalLengthY | focal length of optical system in pixel units in y-direction (mostly obtained from camera calibration) |
principalPointX | x coordinate of principal point on image plane in pixel |
principalPointY | y coordinate of principal point on image plane in pixel |
|
inlinestatic |
Convert index based distances to cartesian coordinates.
index | index coordinates |
distance | distance value at given index in mm |
focalLength | focal length of optical system (mostly obtained from camera calibration) |
interPixelDistance | distance between adjacent pixels in mm for x and y direction |
principalPoint | coordinates of principal point on image plane in pixel |
Definition at line 144 of file mitkToFProcessingCommon.h.
|
inlinestatic |
Convert index based distances to cartesian coordinates.
i | index in x direction of image plane |
j | index in y direction of image plane |
distance | distance value at given index in mm |
focalLength | focal length of optical system in mm (mostly obtained from camera calibration) |
interPixelDistance | distance between adjacent pixels in mm |
principalPoint | coordinates of principal point on image plane in pixel |
Definition at line 130 of file mitkToFProcessingCommon.h.
|
inlinestatic |
Convenience method to convert index based distances to cartesian coordinates using array as input.
i | index in x direction of image plane |
j | index in y direction of image plane |
distance | distance value at given index in mm |
focalLength | focal length of optical system in mm (mostly obtained from camera calibration) |
interPixelDistance | distance between adjacent pixels in mm |
principalPoint | coordinates of principal point on image plane in pixel |
Definition at line 159 of file mitkToFProcessingCommon.h.
|
static |
Convert index based distances to cartesian coordinates.
i | index in x direction of image plane |
j | index in y direction of image plane |
distance | distance value at given index in mm |
focalLength | focal length of optical system in mm (mostly obtained from camera calibration) |
interPixelDistanceX | distance in x direction between adjacent pixels in mm |
interPixelDistanceY | distance in y direction between adjacent pixels in mm |
principalPointX | x coordinate of principal point on image plane in pixel |
principalPointY | y coordinate of principal point on image plane in pixel |
|
inlinestatic |
Definition at line 286 of file mitkToFProcessingCommon.h.
|
inlinestatic |
Definition at line 280 of file mitkToFProcessingCommon.h.
|
inlinestatic |
Definition at line 274 of file mitkToFProcessingCommon.h.
|
static |
KinectIndexToCartesianCoordinates Convert a pixel (i,j) with value d to a 3D world point. This conversion is meant for Kinect and slightly different then ToF reconstruction. See also "Hacking the Kinect" - Jeff Kramer, Matt Parker, Daniel Herrera C., Nicolas Burrus, Florian Echtler, Chapter 7, Part 1 "Moving from Depth Map to Point Cloud.
i | Pixel index i. |
j | Pixel index j. |
distance | Distance value d in mm as obtained from OpenNI. |
focalLengthX | Focallength from calibration. |
focalLengthY | Focallength from calibration. |
principalPointX | Principal point from calibration. |
principalPointY | Principal point from calibration. |