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);
234 static void InitializeAxialMatrix(vtkMatrix3x3* orientationMatrix);
237 static void InitializeSagittalMatrix(vtkMatrix3x3* orientationMatrix);
240 static void InitializeCoronalMatrix(vtkMatrix3x3* orientationMatrix);
248 static void AddDefaultSliceOrientationPresets(
vtkMRMLScene* scene);
252 vtkGetVector3Macro(FieldOfView,
double);
253 void SetFieldOfView(
double x,
double y,
double z);
257 vtkGetVector3Macro(XYZOrigin,
double);
258 void SetXYZOrigin(
double x,
double y,
double z);
263 vtkGetVectorMacro(Dimensions,
int,3)
264 void SetDimensions(
int x,
int y,
int z);
273 vtkGetVectorMacro(UVWDimensions,
int,3)
274 void SetUVWDimensions(
int x,
int y,
int z);
275 void SetUVWDimensions(
int xyz[3]);
279 vtkGetVectorMacro(UVWMaximumDimensions,
int,3)
280 void SetUVWMaximumDimensions(
int x,
int y,
int z);
281 void SetUVWMaximumDimensions(
int xyz[3]);
285 vtkGetVector3Macro(UVWExtents,
double);
286 void SetUVWExtents(
double x,
double y,
double z);
287 void SetUVWExtents(
double xyz[3]);
291 vtkGetVector3Macro(UVWOrigin,
double);
292 void SetUVWOrigin(
double x,
double y,
double z);
293 void SetUVWOrigin(
double xyz[3]);
297 void SetSliceOrigin(
double xyz[3]);
298 void SetSliceOrigin(
double x,
double y,
double z);
303 void SetUVWExtentsAndDimensions (
double extents[3],
int dimensions[3]);
309 vtkMatrix4x4 *GetXYToSlice();
314 vtkMatrix4x4 *GetXYToRAS();
319 vtkMatrix4x4 *GetUVWToSlice();
324 vtkMatrix4x4 *GetUVWToRAS();
328 bool MatrixAreEqual(const vtkMatrix4x4 *m1, const vtkMatrix4x4 *m2);
330 bool MatrixAreEqual(const vtkMatrix4x4 *matrix,
331 const vtkMatrix3x3 *orientationMatrix);
335 void UpdateMatrices();
340 void SetLayoutGrid(
int rows,
int columns );
344 vtkGetMacro(LayoutGridRows,
int);
345 virtual
void SetLayoutGridRows(
int rows);
349 vtkGetMacro(LayoutGridColumns,
int);
350 virtual
void SetLayoutGridColumns(
int cols);
358 void SetSliceToRASByNTP(
double Nx,
double Ny,
double Nz,
359 double Tx,
double Ty,
double Tz,
360 double Px,
double Py,
double Pz,
366 void JumpSlice(
double r,
double a,
double s);
367 void JumpAllSlices(
double r,
double a,
double s);
374 static
void JumpAllSlices(
vtkMRMLScene* scene,
double r,
double a,
double s,
376 void JumpSliceByOffsetting(
double r,
double a,
double s);
377 void JumpSliceByOffsetting(
int k,
double r,
double a,
double s);
378 void JumpSliceByCentering(
double r,
double a,
double s);
381 enum {DefaultJumpSlice=-1, CenteredJumpSlice=0, OffsetJumpSlice};
388 vtkSetMacro(JumpMode,
int);
389 vtkGetMacro(JumpMode,
int);
390 void SetJumpModeToCentered();
391 void SetJumpModeToOffset();
395 enum {AutomaticSliceSpacingMode=0, PrescribedSliceSpacingMode};
400 vtkGetMacro(SliceSpacingMode,
int);
401 vtkSetMacro(SliceSpacingMode,
int);
402 void SetSliceSpacingModeToAutomatic();
403 void SetSliceSpacingModeToPrescribed();
408 vtkSetVector3Macro(PrescribedSliceSpacing,
double);
409 vtkGetVector3Macro(PrescribedSliceSpacing,
double);
413 double GetSliceOffset();
414 void SetSliceOffset(
double offset);
418 vtkSetMacro(ActiveSlice,
int);
419 vtkGetMacro(ActiveSlice,
int);
428 void RotateToVolumePlane(
vtkMRMLVolumeNode *volumeNode,
bool forceSlicePlaneToSingleSlice=
true);
437 void RotateToAxes(vtkMatrix4x4 *referenceToRAS,
int sliceNormalAxisIndex=-1);
444 void SetInteracting(
int);
445 vtkGetMacro(Interacting,
int);
446 vtkBooleanMacro(Interacting,
int);
468 ResetFieldOfViewFlag = 8,
469 MultiplanarReformatFlag = 16,
471 LabelOutlineFlag = 64,
472 SliceVisibleFlag = 128,
473 SliceSpacingFlag = 256,
474 ResetOrientationFlag = 512,
475 RotateToBackgroundVolumePlaneFlag = 1024
483 void SetInteractionFlags(
unsigned int);
484 vtkGetMacro(InteractionFlags,
unsigned int);
491 void SetInteractionFlagsModifier(
unsigned int);
492 vtkGetMacro(InteractionFlagsModifier,
unsigned int);
497 void ResetInteractionFlagsModifier();
505 SliceResolutionMatchVolumes=0,
509 SliceResolutionCustom
514 virtual void SetSliceResolutionMode(
int mode);
515 vtkGetMacro(SliceResolutionMode,
int);
542 double FieldOfView[3];
548 double UVWExtents[3];
549 int UVWDimensions[3];
550 int UVWMaximumDimensions[3];
563 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