Slicer
5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
#include <Modules/Loadable/Transforms/Logic/vtkSlicerTransformLogic.h>
Public Types | |
typedef vtkMRMLAbstractLogic | Superclass |
enum | TransformKind { TRANSFORM_OTHER, TRANSFORM_LINEAR, TRANSFORM_BSPLINE, TRANSFORM_GRID, TRANSFORM_THINPLATESPLINE } |
Public Types inherited from vtkMRMLAbstractLogic | |
typedef vtkObject | Superclass |
typedef void(vtkMRMLAbstractLogic::* | TaskFunctionPointer) (void *clientdata) |
Public Member Functions | |
vtkMRMLTransformNode * | AddTransform (const char *filename, vtkMRMLScene *scene) |
Read transform from file More... | |
vtkMRMLTransformNode * | ConvertToGridTransform (vtkMRMLTransformNode *inputTransformNode, vtkMRMLVolumeNode *referenceVolumeNode=nullptr, vtkMRMLTransformNode *existingOutputTransformNode=nullptr) |
vtkMRMLVolumeNode * | CreateDisplacementVolumeFromTransform (vtkMRMLTransformNode *inputTransformNode, vtkMRMLVolumeNode *referenceVolumeNode=nullptr, bool magnitude=true, vtkMRMLVolumeNode *existingOutputVolumeNode=nullptr) |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) override |
int | SaveTransform (const char *filename, vtkMRMLTransformNode *transformNode) |
Write transform's data to a specified file More... | |
Public Member Functions inherited from vtkMRMLAbstractLogic | |
virtual vtkMRMLApplicationLogic * | GetMRMLApplicationLogic () const |
Get access to overall application state. More... | |
vtkMRMLScene * | GetMRMLScene () const |
Return a reference to the current MRML scene. More... | |
void | PrintSelf (ostream &os, vtkIndent indent) override |
virtual void | SetMRMLApplicationLogic (vtkMRMLApplicationLogic *logic) |
void | SetMRMLScene (vtkMRMLScene *newScene) |
Set and observe the MRMLScene. More... | |
Static Public Member Functions | |
static void | GetNodesBounds (const std::vector< vtkMRMLDisplayableNode *> &nodes, double bounds[6]) |
static void | GetNodesRASBounds (const std::vector< vtkMRMLDisplayableNode *> &nodes, double bounds[6]) |
static void | GetTransformedNodes (vtkMRMLScene *scene, vtkMRMLTransformNode *transformNode, std::vector< vtkMRMLDisplayableNode *> &transformedNodes, bool recursive=true) |
static bool | GetTransformedPointSamplesAsMagnitudeImage (vtkImageData *outputMagnitudeImage, vtkMRMLTransformNode *inputTransformNode, vtkMatrix4x4 *ijkToRAS, bool transformToWorld=true) |
static bool | GetTransformedPointSamplesAsVectorImage (vtkImageData *outputVectorImage, vtkMRMLTransformNode *inputTransformNode, vtkMatrix4x4 *ijkToRAS, bool transformToWorld=true) |
static TransformKind | GetTransformKind (vtkMRMLTransformNode *transformNode) |
static bool | GetVisualization2d (vtkPolyData *output_RAS, vtkMRMLTransformDisplayNode *displayNode, vtkMRMLSliceNode *sliceNode, vtkMRMLMarkupsNode *glyphPointsNode=nullptr) |
static bool | GetVisualization2d (vtkPolyData *output_RAS, vtkMRMLTransformDisplayNode *displayNode, vtkMatrix4x4 *sliceToRAS, double *fieldOfViewOrigin, double *fieldOfViewSize, vtkPoints *samplePositions_RAS=nullptr) |
static bool | GetVisualization3d (vtkPolyData *output_RAS, vtkMRMLTransformDisplayNode *displayNode, vtkMatrix4x4 *roiToRAS, int *roiSize, vtkPoints *samplePositions_RAS=nullptr) |
static bool | GetVisualization3d (vtkPolyData *output_RAS, vtkMRMLTransformDisplayNode *displayNode, vtkMRMLNode *regionNode) |
static const char * | GetVisualizationDisplacementMagnitudeScalarName () |
static bool | hardenTransform (vtkMRMLTransformableNode *node) |
static int | IsTypeOf (const char *type) |
static vtkSlicerTransformLogic * | New () |
The Usual vtk class functions. More... | |
static vtkSlicerTransformLogic * | SafeDownCast (vtkObject *o) |
Static Public Member Functions inherited from vtkMRMLAbstractLogic | |
static int | IsTypeOf (const char *type) |
static vtkMRMLAbstractLogic * | New () |
static vtkMRMLAbstractLogic * | SafeDownCast (vtkObject *o) |
Static Protected Member Functions | |
static void | CreateGrid (vtkPolyData *outputGrid_RAS, vtkMRMLTransformDisplayNode *displayNode, int numGridPoints[3], vtkPolyData *outputWarpedGrid_RAS=nullptr) |
Add lines to the gridPolyData to make it a grid. If warpedGrid is specified then a warped grid is generated, too. More... | |
static void | GetContourVisualization2d (vtkPolyData *output_RAS, vtkMRMLTransformDisplayNode *displayNode, vtkMatrix4x4 *sliceToRAS, double *fieldOfViewOrigin, double *fieldOfViewSize) |
static void | GetContourVisualization3d (vtkPolyData *output_RAS, vtkMRMLTransformDisplayNode *displayNode, vtkMatrix4x4 *roiToRAS, int *roiSize) |
static void | GetGlyphVisualization2d (vtkPolyData *output_RAS, vtkMRMLTransformDisplayNode *displayNode, vtkMatrix4x4 *sliceToRAS, double *fieldOfViewOrigin, double *fieldOfViewSize, vtkPoints *samplePositions_RAS=nullptr) |
static void | GetGlyphVisualization3d (vtkPolyData *output_RAS, vtkMRMLTransformDisplayNode *displayNode, vtkMatrix4x4 *roiToRAS, int *roiSize, vtkPoints *samplePositions_RAS=nullptr) |
static int | GetGridSubdivision (vtkMRMLTransformDisplayNode *displayNode) |
Return the number of samples in each grid. More... | |
static void | GetGridVisualization2d (vtkPolyData *output_RAS, vtkMRMLTransformDisplayNode *displayNode, vtkMatrix4x4 *sliceToRAS, double *fieldOfViewOrigin, double *fieldOfViewSize) |
static void | GetGridVisualization3d (vtkPolyData *output_RAS, vtkMRMLTransformDisplayNode *displayNode, vtkMatrix4x4 *roiToRAS, int *roiSize) |
static void | GetMarkupsAsPoints (vtkMRMLMarkupsNode *markupsNode, vtkPoints *samplePoints_RAS) |
Get markup points as vtkPoints in RAS coordinate system. More... | |
static void | GetTransformedPointSamples (vtkPointSet *outputPointSet, vtkMRMLTransformNode *inputTransformNode, vtkPoints *samplePositions_RAS, bool transformToWorld=true) |
static void | GetTransformedPointSamples (vtkPointSet *outputPointSet_RAS, vtkMRMLTransformNode *inputTransformNode, vtkMatrix4x4 *gridToRAS, int *gridSize, bool transformToWorld=true) |
static void | GetTransformedPointSamplesOnRoi (vtkPointSet *outputPointSet_RAS, vtkMRMLTransformNode *inputTransformNode, vtkMatrix4x4 *roiToRAS, int *roiSize, double pointSpacingMm, int pointGroupSize=1, int *numGridPoints=nullptr) |
static void | GetTransformedPointSamplesOnSlice (vtkPointSet *outputPointSet_RAS, vtkMRMLTransformNode *inputTransformNode, vtkMatrix4x4 *sliceToRAS, double *fieldOfViewOrigin, double *fieldOfViewSize, double pointSpacing, int pointGroupSize=1, int *numGridPoints=nullptr, vtkPoints *samplePositions_RAS=nullptr) |
Static Protected Member Functions inherited from vtkMRMLAbstractLogic | |
static void | MRMLLogicsCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
MRMLLogicCallback is a static function to relay modified events from the logics. More... | |
static void | MRMLNodesCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
MRMLNodesCallback is a static function to relay modified events from the nodes. More... | |
static void | MRMLSceneCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
Definition at line 52 of file vtkSlicerTransformLogic.h.
Definition at line 58 of file vtkSlicerTransformLogic.h.
Enumerator | |
---|---|
TRANSFORM_OTHER | |
TRANSFORM_LINEAR | |
TRANSFORM_BSPLINE | |
TRANSFORM_GRID | |
TRANSFORM_THINPLATESPLINE |
Definition at line 158 of file vtkSlicerTransformLogic.h.
|
protected |
|
overrideprotected |
|
protected |
vtkMRMLTransformNode* vtkSlicerTransformLogic::AddTransform | ( | const char * | filename, |
vtkMRMLScene * | scene | ||
) |
Read transform from file
vtkMRMLTransformNode* vtkSlicerTransformLogic::ConvertToGridTransform | ( | vtkMRMLTransformNode * | inputTransformNode, |
vtkMRMLVolumeNode * | referenceVolumeNode = nullptr , |
||
vtkMRMLTransformNode * | existingOutputTransformNode = nullptr |
||
) |
Convert the input transform to a grid transform. If referenceVolumeNode is specified then it will determine the origin, spacing, extent, and orientation of the displacement field. If existingOutputTransformNode is specified then instead of creating a new transform node, that existing node will be updated.
vtkMRMLVolumeNode* vtkSlicerTransformLogic::CreateDisplacementVolumeFromTransform | ( | vtkMRMLTransformNode * | inputTransformNode, |
vtkMRMLVolumeNode * | referenceVolumeNode = nullptr , |
||
bool | magnitude = true , |
||
vtkMRMLVolumeNode * | existingOutputVolumeNode = nullptr |
||
) |
Create a volume node that contains the transform displacement in each voxel. If magnitude is true then a scalar volume is created, each voxel containing the magnitude of the displacement. If magnitude is false then a 3-component scalar volume is created, each voxel containing the displacement vector. referenceVolumeNode specifies the volume origin, spacing, extent, and orientation. If existingOutputVolumeNode is specified then instead of creating a new volume node, that existing node will be updated.
|
staticprotected |
Add lines to the gridPolyData to make it a grid. If warpedGrid is specified then a warped grid is generated, too.
|
virtual |
Reimplemented from vtkMRMLAbstractLogic.
|
staticprotected |
Generate contours for 2D transform visualization
|
staticprotected |
Generate contours for 3D transform visualization
|
staticprotected |
Generate glyph for 2D transform visualization If samplePositions_RAS is specified then those samples will be used as glyph starting points instead of a regular grid.
|
staticprotected |
Generate glyph for 3D transform visualization If samplePositions_RAS is specified then those samples will be used as glyph starting points instead of a regular grid.
|
staticprotected |
Return the number of samples in each grid.
|
staticprotected |
Generate grid for 2D transform visualization
|
staticprotected |
Generate grid for 3D transform visualization
|
staticprotected |
Get markup points as vtkPoints in RAS coordinate system.
|
static |
Return the bounding box around the list of given nodes using GetBounds. Only the nodes with a valid bounding box are taken into account.
|
static |
Return the RAS bounding box around the list of given nodes using GetRASBounds. Only the nodes with a valid bounding box are taken into account.
|
static |
Return the list of nodes that are transformed by the given node. If recursive is True, this be recursively called on any transform node that might be transformed by the given node. Otherwise, only the nodes immediately transformed by the given transform are returned.
|
staticprotected |
Takes samples from the displacement field specified by a point set and stores it in an unstructured grid. If transformToWorld is true then transform to world is returned, otherwise transform from world is returned.
|
staticprotected |
Takes samples from the displacement field specified by the transformation on a uniform grid and stores it in an unstructured grid. gridToRAS specifies the grid origin, direction, and spacing gridSize is a 3-component int array specifying the dimension of the grid If transformToWorld is true then transform to world is returned, otherwise transform from world is returned.
|
static |
Take samples from the displacement field and store the magnitude in an image volume The extents of the output image must be set before calling this method. The origin and spacing attributes of the output image are ignored (origin, spacing, and axis directions are all specified by ijkToRAS). If transformToWorld is true then transform to world is returned, otherwise transform from world is returned. Returns true on success.
|
static |
Take samples from the displacement field and store the vector components in an image volume The extents of the output image must be set before calling this method. The origin and spacing attributes of the output image are ignored (origin, spacing, and axis directions are all specified by ijkToRAS). If transformToWorld is true then transform to world is returned, otherwise transform from world is returned. Returns true on success.
|
staticprotected |
Takes samples from the displacement field specified by the transformation on a 3D ROI and stores it in an unstructured grid. pointGroupSize: the number of points will be N*pointGroupSize (the actual number will be returned in numGridPoints[3])
|
staticprotected |
Takes samples from the displacement field specified by the transformation on a slice and stores it in an unstructured grid. pointGroupSize: the number of points will be N*pointGroupSize (the actual number will be returned in numGridPoints[3]) samplePositions_RAS: if specified then instead of a regular grid, sample points on the slice will be used
|
static |
Returns TRANSFORM_LINEAR if the node contains a simple linear transform. Returns TRANSFORM_BSPLINE if the node contains a bspline transform with an optional additive or composite bulk component. Returns TRANSFORM_GRID if the node contains a simple grid transform. Returns TRANSFORM_THINPLATESPLINE if the node contains a simple thin plate spline transform. Returns TRANSFORM_OTHER in all other cases.
|
static |
Generate polydata for 2D transform visualization Return true on success.
|
static |
Generate polydata for 2D transform visualization Return true on success.
|
static |
Generate polydata for 3D transform visualization roiToRAS defines the ROI origin and direction. roiSize defines the ROI size (in the ROI coordinate system spacing) . Return true on success.
|
static |
Generate polydata for 3D transform visualization Region node can be slice (vtkMRMLSliceNode), volume (vtkMRMLVolumeNode), region of interest (vtkMRMLAnnotationROINode), or model (vtkMRMLModelNode). Return true on success.
|
static |
Name of the scalar array that stores the displacement magnitude values in polydata returned by GetVisualization2d and GetVisualization3d.
|
static |
Apply the associated transform to the transformable node. Return true on success, false otherwise. This method is kept for backward compatibility only, it is recommended to use vtkMRMLTransformableNode::HardenTransform() method instead.
|
virtual |
Reimplemented from vtkMRMLAbstractLogic.
|
static |
|
static |
The Usual vtk class functions.
|
protected |
|
inlineoverride |
Definition at line 59 of file vtkSlicerTransformLogic.h.
|
static |
int vtkSlicerTransformLogic::SaveTransform | ( | const char * | filename, |
vtkMRMLTransformNode * | transformNode | ||
) |
Write transform's data to a specified file