15#ifndef __vtkMRMLSliceNode_h
16#define __vtkMRMLSliceNode_h
43 void PrintSelf(ostream& os, vtkIndent indent)
override;
53 void WriteXML(ostream& of,
int indent)
override;
78 vtkGetMacro(SliceVisible,
int);
79 vtkSetMacro(SliceVisible,
int);
83 vtkGetMacro(WidgetVisible,
int);
84 vtkSetMacro(WidgetVisible,
int);
87 vtkGetMacro(WidgetOutlineVisible,
int);
88 vtkSetMacro(WidgetOutlineVisible,
int);
110 inline std::vector< std::string > GetThreeDViewIDs()
const;
123 vtkGetMacro(WidgetNormalLockedToCamera,
int);
124 vtkSetMacro(WidgetNormalLockedToCamera,
int);
128 vtkGetMacro(UseLabelOutline,
int);
129 vtkSetMacro(UseLabelOutline,
int);
130 vtkBooleanMacro(UseLabelOutline,
int);
173 vtkSetStringMacro(DefaultOrientation);
174 vtkGetStringMacro(DefaultOrientation);
187 vtkGetStringMacro(OrientationReference);
188 vtkSetStringMacro(OrientationReference);
257 vtkGetVector3Macro(FieldOfView,
double);
263 vtkGetVector3Macro(XYZOrigin,
double);
271 vtkGetVectorMacro(Dimensions,
int,3)
272 void SetDimensions(
int x,
int y,
int z);
282 vtkGetVectorMacro(UVWDimensions,
int,3)
283 void SetUVWDimensions(
int x,
int y,
int z);
284 void SetUVWDimensions(
int xyz[3]);
288 vtkGetVectorMacro(UVWMaximumDimensions,
int,3)
289 void SetUVWMaximumDimensions(
int x,
int y,
int z);
290 void SetUVWMaximumDimensions(
int xyz[3]);
294 vtkGetVector3Macro(UVWExtents,
double);
295 void SetUVWExtents(
double x,
double y,
double z);
296 void SetUVWExtents(
double xyz[3]);
300 vtkGetVector3Macro(UVWOrigin,
double);
301 void SetUVWOrigin(
double x,
double y,
double z);
302 void SetUVWOrigin(
double xyz[3]);
306 void SetSliceOrigin(
double xyz[3]);
307 void SetSliceOrigin(
double x,
double y,
double z);
312 void SetUVWExtentsAndDimensions (
double extents[3],
int dimensions[3]);
318 vtkMatrix4x4 *GetXYToSlice();
323 vtkMatrix4x4 *GetXYToRAS();
328 vtkMatrix4x4 *GetUVWToSlice();
333 vtkMatrix4x4 *GetUVWToRAS();
337 bool MatrixAreEqual(const vtkMatrix4x4 *m1, const vtkMatrix4x4 *m2);
339 bool MatrixAreEqual(const vtkMatrix4x4 *matrix,
340 const vtkMatrix3x3 *orientationMatrix);
344 void UpdateMatrices();
349 void SetLayoutGrid(
int rows,
int columns );
353 vtkGetMacro(LayoutGridRows,
int);
354 virtual
void SetLayoutGridRows(
int rows);
358 vtkGetMacro(LayoutGridColumns,
int);
359 virtual
void SetLayoutGridColumns(
int cols);
367 void SetSliceToRASByNTP(
double Nx,
double Ny,
double Nz,
368 double Tx,
double Ty,
double Tz,
369 double Px,
double Py,
double Pz,
375 void JumpSlice(
double r,
double a,
double s);
376 void JumpAllSlices(
double r,
double a,
double s);
383 static
void JumpAllSlices(
vtkMRMLScene* scene,
double r,
double a,
double s,
385 void JumpSliceByOffsetting(
double r,
double a,
double s);
386 void JumpSliceByOffsetting(
int k,
double r,
double a,
double s);
387 void JumpSliceByCentering(
double r,
double a,
double s);
390 enum {DefaultJumpSlice=-1, CenteredJumpSlice=0, OffsetJumpSlice};
397 vtkSetMacro(JumpMode,
int);
398 vtkGetMacro(JumpMode,
int);
404 enum {AutomaticSliceSpacingMode=0, PrescribedSliceSpacingMode};
409 vtkGetMacro(SliceSpacingMode,
int);
410 vtkSetMacro(SliceSpacingMode,
int);
417 vtkSetVector3Macro(PrescribedSliceSpacing,
double);
418 vtkGetVector3Macro(PrescribedSliceSpacing,
double);
427 vtkSetMacro(ActiveSlice,
int);
428 vtkGetMacro(ActiveSlice,
int);
446 void RotateToAxes(vtkMatrix4x4 *referenceToRAS,
int sliceNormalAxisIndex=-1);
454 vtkGetMacro(Interacting,
int);
455 vtkBooleanMacro(Interacting,
int);
477 ResetFieldOfViewFlag = 8,
478 MultiplanarReformatFlag = 16,
480 LabelOutlineFlag = 64,
481 SliceVisibleFlag = 128,
482 SliceSpacingFlag = 256,
483 ResetOrientationFlag = 512,
484 RotateToBackgroundVolumePlaneFlag = 1024
493 vtkGetMacro(InteractionFlags,
unsigned int);
501 vtkGetMacro(InteractionFlagsModifier,
unsigned int);
514 SliceResolutionMatchVolumes=0,
518 SliceResolutionCustom
524 vtkGetMacro(SliceResolutionMode,
int);
528 vtkGetMacro(SlabReconstructionEnabled,
bool);
529 vtkSetMacro(SlabReconstructionEnabled,
bool);
530 vtkBooleanMacro(SlabReconstructionEnabled,
bool);
535 vtkGetMacro(SlabReconstructionType,
int);
536 vtkSetMacro(SlabReconstructionType,
int);
543 vtkGetMacro(SlabReconstructionThickness,
double);
544 vtkSetMacro(SlabReconstructionThickness,
double);
549 vtkGetMacro(SlabReconstructionOversamplingFactor,
double);
550 vtkSetMacro(SlabReconstructionOversamplingFactor,
double);
578 double FieldOfView[3];
584 double UVWExtents[3];
585 int UVWDimensions[3];
586 int UVWMaximumDimensions[3];
604 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 SetSliceOffset(double offset)
virtual const char * GetOrientationString()
Get orientation.
void SetInteractionFlags(unsigned int)
bool SetOrientationToSagittal()
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()
unsigned int InteractionFlagsModifier
static void GetSagittalSliceToRASMatrix(vtkMatrix3x3 *orientationMatrix, bool patientRightIsScreenLeft=true)
Initialize orientationMatrix as a Sagittal orientation matrix.
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 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.
vtkSmartPointer< vtkMatrix4x4 > SliceToRAS
int SlabReconstructionType
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.
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.
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
void RemoveThreeDViewID(char *viewNodeID)
void operator=(const vtkMRMLSliceNode &)
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)
double GetSliceOffset()
Get/Set the current distance from the origin to the slice plane.
void AddThreeDViewID(const char *viewNodeID)
int GetNumberOfThreeDViewIDs() const
double SlabReconstructionOversamplingFactor
void SetSliceSpacingModeToAutomatic()
bool HasSliceOrientationPreset(const std::string &name)
Return True if an orientation preset is stored.
char * DefaultOrientation
std::string OrientationString
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
virtual vtkMatrix4x4 * GetSliceToRAS()
~vtkMRMLSliceNode() override
vtkSmartPointer< vtkMatrix4x4 > UVWToSlice
void SetJumpModeToCentered()
int GetNumberOfSliceOrientationPresets() const
Return number of orientation presets.
vtkSmartPointer< vtkMatrix4x4 > XYToSlice
vtkSmartPointer< vtkMatrix4x4 > XYToRAS
void SetXYZOrigin(double x, double y, double z)
bool SlabReconstructionEnabled
static vtkMRMLSliceNode * New()
Instantiate a new Slice node without any orientation presets.
MRML node for representing a volume (image stack).