15 #ifndef __vtkMRMLSliceNode_h 16 #define __vtkMRMLSliceNode_h 43 void PrintSelf(ostream& os, vtkIndent indent)
override;
53 void WriteXML(ostream& of,
int indent)
override;
74 virtual vtkMatrix4x4 *GetSliceToRAS();
78 vtkGetMacro(SliceVisible,
int);
79 vtkSetMacro(SliceVisible,
int);
83 vtkGetMacro(WidgetVisible,
int);
84 vtkSetMacro(WidgetVisible,
int);
87 vtkGetMacro(WidgetOutlineVisible,
int);
88 vtkSetMacro(WidgetOutlineVisible,
int);
92 void AddThreeDViewID(
const char* viewNodeID);
95 void RemoveThreeDViewID(
char* viewNodeID);
98 void RemoveAllThreeDViewIDs();
102 int GetNumberOfThreeDViewIDs()
const;
106 const char* GetNthThreeDViewID(
unsigned int index);
110 inline std::vector< std::string > GetThreeDViewIDs()
const;
114 bool IsThreeDViewIDPresent(
const char* ThreeDViewID)
const;
119 bool IsDisplayableInThreeDView(
const char* viewNodeID)
const;
123 vtkGetMacro(WidgetNormalLockedToCamera,
int);
124 vtkSetMacro(WidgetNormalLockedToCamera,
int);
128 vtkGetMacro(UseLabelOutline,
int);
129 vtkSetMacro(UseLabelOutline,
int);
130 vtkBooleanMacro(UseLabelOutline,
int);
138 bool SetOrientationToAxial();
139 bool SetOrientationToSagittal();
140 bool SetOrientationToCoronal();
144 bool SetOrientationToDefault();
152 std::string GetOrientation();
155 std::string GetOrientation(vtkMatrix4x4* sliceToRAS);
167 bool SetOrientation(
const char* orientation);
173 vtkSetStringMacro(DefaultOrientation);
174 vtkGetStringMacro(DefaultOrientation);
179 virtual const char* GetOrientationString();
187 vtkGetStringMacro(OrientationReference);
188 vtkSetStringMacro(OrientationReference);
193 vtkMatrix3x3 *GetSliceOrientationPreset(
const std::string& name);
199 std::string GetSliceOrientationPresetName(vtkMatrix3x3* orientationMatrix);
202 void GetSliceOrientationPresetNames(vtkStringArray* presetOrientationNames);
206 int GetNumberOfSliceOrientationPresets()
const;
212 bool AddSliceOrientationPreset(
const std::string& name, vtkMatrix3x3* orientationMatrix);
217 bool RemoveSliceOrientationPreset(
const std::string& name);
222 bool RenameSliceOrientationPreset(
const std::string& name,
const std::string& updatedName);
227 bool HasSliceOrientationPreset(
const std::string& name);
236 static void GetAxialSliceToRASMatrix(vtkMatrix3x3* orientationMatrix,
bool patientRightIsScreenLeft=
true);
241 static void GetSagittalSliceToRASMatrix(vtkMatrix3x3* orientationMatrix,
bool patientRightIsScreenLeft=
true);
246 static void GetCoronalSliceToRASMatrix(vtkMatrix3x3* orientationMatrix,
bool patientRightIsScreenLeft=
true);
253 static void AddDefaultSliceOrientationPresets(
vtkMRMLScene* scene,
bool patientRightIsScreenLeft=
true);
257 vtkGetVector3Macro(FieldOfView,
double);
258 void SetFieldOfView(
double x,
double y,
double z);
262 vtkGetVector3Macro(XYZOrigin,
double);
263 void SetXYZOrigin(
double x,
double y,
double z);
268 vtkGetVectorMacro(Dimensions,
int,3)
269 void SetDimensions(
int x,
int y,
int z);
278 vtkGetVectorMacro(UVWDimensions,
int,3)
279 void SetUVWDimensions(
int x,
int y,
int z);
280 void SetUVWDimensions(
int xyz[3]);
284 vtkGetVectorMacro(UVWMaximumDimensions,
int,3)
285 void SetUVWMaximumDimensions(
int x,
int y,
int z);
286 void SetUVWMaximumDimensions(
int xyz[3]);
290 vtkGetVector3Macro(UVWExtents,
double);
291 void SetUVWExtents(
double x,
double y,
double z);
292 void SetUVWExtents(
double xyz[3]);
296 vtkGetVector3Macro(UVWOrigin,
double);
297 void SetUVWOrigin(
double x,
double y,
double z);
298 void SetUVWOrigin(
double xyz[3]);
302 void SetSliceOrigin(
double xyz[3]);
303 void SetSliceOrigin(
double x,
double y,
double z);
308 void SetUVWExtentsAndDimensions (
double extents[3],
int dimensions[3]);
314 vtkMatrix4x4 *GetXYToSlice();
319 vtkMatrix4x4 *GetXYToRAS();
324 vtkMatrix4x4 *GetUVWToSlice();
329 vtkMatrix4x4 *GetUVWToRAS();
333 bool MatrixAreEqual(const vtkMatrix4x4 *m1, const vtkMatrix4x4 *m2);
335 bool MatrixAreEqual(const vtkMatrix4x4 *matrix,
336 const vtkMatrix3x3 *orientationMatrix);
340 void UpdateMatrices();
345 void SetLayoutGrid(
int rows,
int columns );
349 vtkGetMacro(LayoutGridRows,
int);
350 virtual
void SetLayoutGridRows(
int rows);
354 vtkGetMacro(LayoutGridColumns,
int);
355 virtual
void SetLayoutGridColumns(
int cols);
363 void SetSliceToRASByNTP(
double Nx,
double Ny,
double Nz,
364 double Tx,
double Ty,
double Tz,
365 double Px,
double Py,
double Pz,
371 void JumpSlice(
double r,
double a,
double s);
372 void JumpAllSlices(
double r,
double a,
double s);
379 static
void JumpAllSlices(
vtkMRMLScene* scene,
double r,
double a,
double s,
381 void JumpSliceByOffsetting(
double r,
double a,
double s);
382 void JumpSliceByOffsetting(
int k,
double r,
double a,
double s);
383 void JumpSliceByCentering(
double r,
double a,
double s);
386 enum {DefaultJumpSlice=-1, CenteredJumpSlice=0, OffsetJumpSlice};
393 vtkSetMacro(JumpMode,
int);
394 vtkGetMacro(JumpMode,
int);
395 void SetJumpModeToCentered();
396 void SetJumpModeToOffset();
400 enum {AutomaticSliceSpacingMode=0, PrescribedSliceSpacingMode};
405 vtkGetMacro(SliceSpacingMode,
int);
406 vtkSetMacro(SliceSpacingMode,
int);
407 void SetSliceSpacingModeToAutomatic();
408 void SetSliceSpacingModeToPrescribed();
413 vtkSetVector3Macro(PrescribedSliceSpacing,
double);
414 vtkGetVector3Macro(PrescribedSliceSpacing,
double);
418 double GetSliceOffset();
419 void SetSliceOffset(
double offset);
423 vtkSetMacro(ActiveSlice,
int);
424 vtkGetMacro(ActiveSlice,
int);
433 void RotateToVolumePlane(
vtkMRMLVolumeNode *volumeNode,
bool forceSlicePlaneToSingleSlice=
true);
442 void RotateToAxes(vtkMatrix4x4 *referenceToRAS,
int sliceNormalAxisIndex=-1);
449 void SetInteracting(
int);
450 vtkGetMacro(Interacting,
int);
451 vtkBooleanMacro(Interacting,
int);
473 ResetFieldOfViewFlag = 8,
474 MultiplanarReformatFlag = 16,
476 LabelOutlineFlag = 64,
477 SliceVisibleFlag = 128,
478 SliceSpacingFlag = 256,
479 ResetOrientationFlag = 512,
480 RotateToBackgroundVolumePlaneFlag = 1024
488 void SetInteractionFlags(
unsigned int);
489 vtkGetMacro(InteractionFlags,
unsigned int);
496 void SetInteractionFlagsModifier(
unsigned int);
497 vtkGetMacro(InteractionFlagsModifier,
unsigned int);
502 void ResetInteractionFlagsModifier();
510 SliceResolutionMatchVolumes=0,
514 SliceResolutionCustom
519 virtual void SetSliceResolutionMode(
int mode);
520 vtkGetMacro(SliceResolutionMode,
int);
547 double FieldOfView[3];
553 double UVWExtents[3];
554 int UVWDimensions[3];
555 int UVWMaximumDimensions[3];
568 double PrescribedSliceSpacing[3];
unsigned int InteractionFlagsModifier
char * OrientationReference
std::vector< std::string > ThreeDViewIDs
unsigned int InteractionFlags
MRML node for storing a slice through RAS space.
vtkSmartPointer< vtkMatrix4x4 > UVWToRAS
vtkSmartPointer< vtkMatrix4x4 > XYToRAS
void Reset(vtkMRMLNode *defaultNode) override
Reimplemented to preserve layout label when reset.
void operator=(const vtkMRMLAbstractViewNode &)
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
vtkSmartPointer< vtkMatrix4x4 > SliceToRAS
std::vector< std::string > GetThreeDViewIDs() const
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D...
A set of MRML Nodes that supports serialization and undo/redo.
void ReadXMLAttributes(const char **atts) override
MRMLNode methods.
static const char * GetReformatOrientationName()
std::vector< OrientationPresetType > OrientationMatrices
MRML node for representing a volume (image stack).
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
vtkSmartPointer< vtkMatrix4x4 > XYToSlice
vtkMRMLCopyContentMacro(vtkMRMLAbstractViewNode)
char * DefaultOrientation
void PrintSelf(ostream &os, vtkIndent indent) override
SliceResolutionModeType
Enum to specify the method for setting UVW extents.
Abstract Superclass for all specific types of MRML nodes.
vtkSmartPointer< vtkMatrix4x4 > UVWToSlice
std::pair< std::string, vtkSmartPointer< vtkMatrix3x3 > > OrientationPresetType
int WidgetNormalLockedToCamera
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
std::string OrientationString