15#ifndef __vtkMRMLSliceNode_h
16#define __vtkMRMLSliceNode_h
23class vtkImplicitFunction;
45 void PrintSelf(ostream& os, vtkIndent indent)
override;
55 void WriteXML(ostream& of,
int indent)
override;
80 vtkGetMacro(SliceVisible,
int);
81 vtkSetMacro(SliceVisible,
int);
85 vtkGetMacro(SliceEdgeVisibility3D,
bool);
86 vtkSetMacro(SliceEdgeVisibility3D,
bool);
87 vtkBooleanMacro(SliceEdgeVisibility3D,
bool);
91 vtkGetMacro(WidgetVisible,
int);
92 vtkSetMacro(WidgetVisible,
int);
96 vtkGetMacro(WidgetOutlineVisible,
int);
97 vtkSetMacro(WidgetOutlineVisible,
int);
119 inline std::vector< std::string > GetThreeDViewIDs()
const;
132 vtkGetMacro(WidgetNormalLockedToCamera,
int);
133 vtkSetMacro(WidgetNormalLockedToCamera,
int);
137 vtkGetMacro(UseLabelOutline,
int);
138 vtkSetMacro(UseLabelOutline,
int);
139 vtkBooleanMacro(UseLabelOutline,
int);
182 vtkSetStringMacro(DefaultOrientation);
183 vtkGetStringMacro(DefaultOrientation);
196 vtkGetStringMacro(OrientationReference);
197 vtkSetStringMacro(OrientationReference);
266 vtkGetVector3Macro(FieldOfView,
double);
272 vtkGetVector3Macro(XYZOrigin,
double);
280 vtkGetVectorMacro(Dimensions,
int,3);
291 vtkGetVectorMacro(UVWDimensions,
int,3);
297 vtkGetVectorMacro(UVWMaximumDimensions,
int,3);
303 vtkGetVector3Macro(UVWExtents,
double);
309 vtkGetVector3Macro(UVWOrigin,
double);
349 const vtkMatrix3x3 *orientationMatrix);
362 vtkGetMacro(LayoutGridRows,
int);
367 vtkGetMacro(LayoutGridColumns,
int);
377 double Tx,
double Ty,
double Tz,
378 double Px,
double Py,
double Pz,
399 enum {DefaultJumpSlice=-1, CenteredJumpSlice=0, OffsetJumpSlice};
406 vtkSetMacro(JumpMode,
int);
407 vtkGetMacro(JumpMode,
int);
413 enum {AutomaticSliceSpacingMode=0, PrescribedSliceSpacingMode};
418 vtkGetMacro(SliceSpacingMode,
int);
419 vtkSetMacro(SliceSpacingMode,
int);
426 vtkSetVector3Macro(PrescribedSliceSpacing,
double);
427 vtkGetVector3Macro(PrescribedSliceSpacing,
double);
436 vtkSetMacro(ActiveSlice,
int);
437 vtkGetMacro(ActiveSlice,
int);
455 void RotateToAxes(vtkMatrix4x4 *referenceToRAS,
int sliceNormalAxisIndex=-1);
463 vtkGetMacro(Interacting,
int);
464 vtkBooleanMacro(Interacting,
int);
488 ResetFieldOfViewFlag = 8,
489 MultiplanarReformatFlag = 16,
491 LabelOutlineFlag = 64,
492 SliceVisibleFlag = 128,
493 SliceEdgeVisibility3DFlag = 256,
494 SliceSpacingFlag = 512,
495 ResetOrientationFlag = 1024,
496 RotateToBackgroundVolumePlaneFlag = 2048,
497 UpdateSlabReconstructionThicknessFlag = 4096,
506 vtkGetMacro(InteractionFlags,
unsigned int);
514 vtkGetMacro(InteractionFlagsModifier,
unsigned int);
527 SliceResolutionMatchVolumes=0,
531 SliceResolutionCustom
537 vtkGetMacro(SliceResolutionMode,
int);
541 vtkGetMacro(SlabReconstructionEnabled,
bool);
542 vtkSetMacro(SlabReconstructionEnabled,
bool);
543 vtkBooleanMacro(SlabReconstructionEnabled,
bool);
548 vtkGetMacro(SlabReconstructionType,
int);
549 vtkSetMacro(SlabReconstructionType,
int);
556 vtkGetMacro(SlabReconstructionThickness,
double);
557 vtkSetMacro(SlabReconstructionThickness,
double);
562 vtkGetMacro(SlabReconstructionOversamplingFactor,
double);
563 vtkSetMacro(SlabReconstructionOversamplingFactor,
double);
594 double FieldOfView[3];
600 double UVWExtents[3];
601 int UVWDimensions[3];
602 int UVWMaximumDimensions[3];
620 double PrescribedSliceSpacing[3];
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D,...
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node for storing a slice through RAS space.
void ResetInteractionFlagsModifier()
bool IsDisplayableInThreeDView(const char *viewNodeID) const
void ReadXMLAttributes(const char **atts) override
Set node attributes.
void SetXYZOrigin(double xyz[3])
int WidgetNormalLockedToCamera
void SetSliceToRASByNTP(double Nx, double Ny, double Nz, double Tx, double Ty, double Tz, double Px, double Py, double Pz, int Orientation)
void SetSliceOffset(double offset)
virtual const char * GetOrientationString()
Get orientation.
void SetInteractionFlags(unsigned int)
bool SetOrientationToSagittal()
void JumpSlice(double r, double a, double s)
void RotateToAxes(vtkMatrix4x4 *referenceToRAS, int sliceNormalAxisIndex=-1)
const char * GetNthThreeDViewID(unsigned int index)
bool RemoveSliceOrientationPreset(const std::string &name)
Remove an orientation preset.
void SetJumpModeToOffset()
void SetUVWExtentsAndDimensions(double extents[3], int dimensions[3])
unsigned int InteractionFlagsModifier
vtkMatrix4x4 * GetXYToSlice()
vtkMatrix4x4 * GetUVWToSlice()
static void GetSagittalSliceToRASMatrix(vtkMatrix3x3 *orientationMatrix, bool patientRightIsScreenLeft=true)
Initialize orientationMatrix as a Sagittal orientation matrix.
bool MatrixAreEqual(const vtkMatrix4x4 *m1, const vtkMatrix4x4 *m2)
helper for comparing to matrices
static void GetCoronalSliceToRASMatrix(vtkMatrix3x3 *orientationMatrix, bool patientRightIsScreenLeft=true)
Initialize orientationMatrix as a Coronal orientation matrix.
void SetDimensions(int xyz[3])
void SetSliceSpacingModeToPrescribed()
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
void RemoveAllThreeDViewIDs()
void JumpSliceByOffsetting(double r, double a, double s)
void SetFieldOfView(double x, double y, double z)
static const char * GetReformatOrientationName()
void RotateToVolumePlane(vtkMRMLVolumeNode *volumeNode, bool forceSlicePlaneToSingleSlice=true)
virtual void SetSliceResolutionMode(int mode)
method for setting UVW space (extents, dimensions and spacing)
static void AddDefaultSliceOrientationPresets(vtkMRMLScene *scene, bool patientRightIsScreenLeft=true)
Add default slice orientation presets to scene.
vtkMatrix4x4 * GetUVWToRAS()
vtkSmartPointer< vtkMatrix4x4 > SliceToRAS
int SlabReconstructionType
void SetUVWOrigin(double x, double y, double z)
void JumpSliceByCentering(double r, double a, double s)
vtkMRMLSliceNode(const vtkMRMLSliceNode &)
std::vector< OrientationPresetType > OrientationMatrices
std::string GetOrientation(vtkMatrix4x4 *sliceToRAS)
Return the orientation name associated with sliceToRAS.
bool RenameSliceOrientationPreset(const std::string &name, const std::string &updatedName)
Rename an orientation preset.
virtual vtkImplicitFunction * GetImplicitFunctionWorld()
bool AddSliceOrientationPreset(const std::string &name, vtkMatrix3x3 *orientationMatrix)
Add or update an orientation preset.
void PrintSelf(ostream &os, vtkIndent indent) override
static int GetSlabReconstructionTypeFromString(const char *name)
static const char * GetSlabReconstructionTypeAsString(int slabReconstructionType)
bool SetOrientation(const char *orientation)
Set orientation.
char * OrientationReference
bool SetOrientationToAxial()
Set 'standard' radiological convention views of patient space.
void SetUVWExtents(double xyz[3])
bool SetOrientationToCoronal()
void Reset(vtkMRMLNode *defaultNode) override
Reimplemented to preserve orientation and layout color when reset.
unsigned int InteractionFlags
SliceResolutionModeType
Enum to specify the method for setting UVW extents.
@ SliceResolutionMatch2DView
@ SliceFOVMatch2DViewSpacingMatchVolumes
@ SliceFOVMatchVolumesSpacingMatch2DView
bool IsThreeDViewIDPresent(const char *ThreeDViewID) const
bool MatrixAreEqual(const vtkMatrix4x4 *matrix, const vtkMatrix3x3 *orientationMatrix)
void RemoveThreeDViewID(char *viewNodeID)
void JumpAllSlices(double r, double a, double s)
void SetUVWDimensions(int xyz[3])
void operator=(const vtkMRMLSliceNode &)
void SetUVWMaximumDimensions(int x, int y, int z)
vtkMRMLNode * CreateNodeInstance() override
Create instance of the default node. Like New only virtual.
void GetSliceOrientationPresetNames(vtkStringArray *presetOrientationNames)
Return all the orientation preset names.
bool SetOrientationToDefault()
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
std::string GetSliceOrientationPresetName(vtkMatrix3x3 *orientationMatrix)
Return the preset name corresponding to orientationMatrix.
vtkMatrix3x3 * GetSliceOrientationPreset(const std::string &name)
Return the sliceToRAS matrix associated with name.
std::pair< std::string, vtkSmartPointer< vtkMatrix3x3 > > OrientationPresetType
vtkMRMLCopyContentMacro(vtkMRMLSliceNode)
bool SliceEdgeVisibility3D
double GetSliceOffset()
Get/Set the current distance from the origin to the slice plane.
void AddThreeDViewID(const char *viewNodeID)
int GetNumberOfThreeDViewIDs() const
vtkSmartPointer< vtkPlane > ImplicitFunction
double SlabReconstructionOversamplingFactor
virtual void SetLayoutGridColumns(int cols)
void SetSliceSpacingModeToAutomatic()
bool HasSliceOrientationPreset(const std::string &name)
Return True if an orientation preset is stored.
char * DefaultOrientation
std::string OrientationString
void JumpSliceByOffsetting(int k, double r, double a, double s)
void SetUVWMaximumDimensions(int xyz[3])
static void JumpAllSlices(vtkMRMLScene *scene, double r, double a, double s, int jumpMode=vtkMRMLSliceNode::DefaultJumpSlice, int viewGroup=-1, vtkMRMLSliceNode *exclude=nullptr)
std::vector< std::string > GetThreeDViewIDs() const
std::string GetOrientation()
Get orientation.
void SetInteractionFlagsModifier(unsigned int)
void SetFieldOfView(double xyz[3])
double SlabReconstructionThickness
static void GetAxialSliceToRASMatrix(vtkMatrix3x3 *orientationMatrix, bool patientRightIsScreenLeft=true)
Initialize orientationMatrix as an Axial orientation matrix.
std::vector< std::string > ThreeDViewIDs
vtkSmartPointer< vtkMatrix4x4 > UVWToRAS
void SetSliceOrigin(double x, double y, double z)
virtual vtkMatrix4x4 * GetSliceToRAS()
~vtkMRMLSliceNode() override
vtkSmartPointer< vtkMatrix4x4 > UVWToSlice
virtual void SetLayoutGridRows(int rows)
void SetJumpModeToCentered()
void SetDimensions(int x, int y, int z)
int GetNumberOfSliceOrientationPresets() const
Return number of orientation presets.
vtkSmartPointer< vtkMatrix4x4 > XYToSlice
void SetUVWDimensions(int x, int y, int z)
vtkSmartPointer< vtkMatrix4x4 > XYToRAS
void SetXYZOrigin(double x, double y, double z)
bool SlabReconstructionEnabled
vtkMatrix4x4 * GetXYToRAS()
static vtkMRMLSliceNode * New()
Instantiate a new Slice node without any orientation presets.
void SetSliceOrigin(double xyz[3])
Origin of slice in XYZ or UVW space depending on SliceResolutionMode.
void SetUVWExtents(double x, double y, double z)
void SetLayoutGrid(int rows, int columns)
void SetUVWOrigin(double xyz[3])
MRML node for representing a volume (image stack).