15 #ifndef __vtkMRMLSliceNode_h 16 #define __vtkMRMLSliceNode_h 43 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
49 virtual
void ReadXMLAttributes( const
char** atts) VTK_OVERRIDE;
53 virtual
void WriteXML(ostream& of,
int indent) VTK_OVERRIDE;
62 virtual
void Reset(
vtkMRMLNode* defaultNode) VTK_OVERRIDE;
66 virtual const
char* GetNodeTagName() VTK_OVERRIDE {
return "Slice";};
73 virtual vtkMatrix4x4 *GetSliceToRAS();
77 vtkGetMacro(SliceVisible,
int);
78 vtkSetMacro(SliceVisible,
int);
82 vtkGetMacro(WidgetVisible,
int);
83 vtkSetMacro(WidgetVisible,
int);
86 vtkGetMacro(WidgetOutlineVisible,
int);
87 vtkSetMacro(WidgetOutlineVisible,
int);
91 void AddThreeDViewID(
const char* viewNodeID);
94 void RemoveThreeDViewID(
char* viewNodeID);
97 void RemoveAllThreeDViewIDs();
101 int GetNumberOfThreeDViewIDs()
const;
105 const char* GetNthThreeDViewID(
unsigned int index);
109 inline std::vector< std::string > GetThreeDViewIDs()
const;
113 bool IsThreeDViewIDPresent(
const char* ThreeDViewID)
const;
118 bool IsDisplayableInThreeDView(
const char* viewNodeID)
const;
122 vtkGetMacro(WidgetNormalLockedToCamera,
int);
123 vtkSetMacro(WidgetNormalLockedToCamera,
int);
127 vtkGetMacro(UseLabelOutline,
int);
128 vtkSetMacro(UseLabelOutline,
int);
129 vtkBooleanMacro(UseLabelOutline,
int);
137 bool SetOrientationToAxial();
138 bool SetOrientationToSagittal();
139 bool SetOrientationToCoronal();
147 std::string GetOrientation();
150 std::string GetOrientation(vtkMatrix4x4* sliceToRAS);
162 bool SetOrientation(
const char* orientation);
167 virtual const char* GetOrientationString();
175 vtkGetStringMacro(OrientationReference);
176 vtkSetStringMacro(OrientationReference);
181 vtkMatrix3x3 *GetSliceOrientationPreset(
const std::string& name);
187 std::string GetSliceOrientationPresetName(vtkMatrix3x3* orientationMatrix);
190 void GetSliceOrientationPresetNames(vtkStringArray* presetOrientationNames);
194 int GetNumberOfSliceOrientationPresets()
const;
200 bool AddSliceOrientationPreset(
const std::string& name, vtkMatrix3x3* orientationMatrix);
205 bool RemoveSliceOrientationPreset(
const std::string& name);
210 bool RenameSliceOrientationPreset(
const std::string& name,
const std::string& updatedName);
215 bool HasSliceOrientationPreset(
const std::string& name);
218 static void InitializeAxialMatrix(vtkMatrix3x3* orientationMatrix);
221 static void InitializeSagittalMatrix(vtkMatrix3x3* orientationMatrix);
224 static void InitializeCoronalMatrix(vtkMatrix3x3* orientationMatrix);
232 static void AddDefaultSliceOrientationPresets(
vtkMRMLScene* scene);
236 vtkGetVector3Macro(FieldOfView,
double);
237 void SetFieldOfView(
double x,
double y,
double z);
241 vtkGetVector3Macro(XYZOrigin,
double);
242 void SetXYZOrigin(
double x,
double y,
double z);
247 vtkGetVectorMacro(Dimensions,
int,3)
248 void SetDimensions(
int x,
int y,
int z);
257 vtkGetVectorMacro(UVWDimensions,
int,3)
258 void SetUVWDimensions(
int x,
int y,
int z);
259 void SetUVWDimensions(
int xyz[3]);
263 vtkGetVectorMacro(UVWMaximumDimensions,
int,3)
264 void SetUVWMaximumDimensions(
int x,
int y,
int z);
265 void SetUVWMaximumDimensions(
int xyz[3]);
269 vtkGetVector3Macro(UVWExtents,
double);
270 void SetUVWExtents(
double x,
double y,
double z);
271 void SetUVWExtents(
double xyz[3]);
275 vtkGetVector3Macro(UVWOrigin,
double);
276 void SetUVWOrigin(
double x,
double y,
double z);
277 void SetUVWOrigin(
double xyz[3]);
281 void SetSliceOrigin(
double xyz[3]);
282 void SetSliceOrigin(
double x,
double y,
double z);
287 void SetUVWExtentsAndDimensions (
double extents[3],
int dimensions[3]);
293 vtkMatrix4x4 *GetXYToSlice();
298 vtkMatrix4x4 *GetXYToRAS();
303 vtkMatrix4x4 *GetUVWToSlice();
308 vtkMatrix4x4 *GetUVWToRAS();
312 bool MatrixAreEqual(const vtkMatrix4x4 *m1, const vtkMatrix4x4 *m2);
314 bool MatrixAreEqual(const vtkMatrix4x4 *matrix,
315 const vtkMatrix3x3 *orientationMatrix);
319 void UpdateMatrices();
324 void SetLayoutGrid(
int rows,
int columns );
328 vtkGetMacro(LayoutGridRows,
int);
329 virtual
void SetLayoutGridRows(
int rows);
333 vtkGetMacro(LayoutGridColumns,
int);
334 virtual
void SetLayoutGridColumns(
int cols);
342 void SetSliceToRASByNTP(
double Nx,
double Ny,
double Nz,
343 double Tx,
double Ty,
double Tz,
344 double Px,
double Py,
double Pz,
350 void JumpSlice(
double r,
double a,
double s);
351 void JumpAllSlices(
double r,
double a,
double s);
358 static
void JumpAllSlices(
vtkMRMLScene* scene,
double r,
double a,
double s,
360 void JumpSliceByOffsetting(
double r,
double a,
double s);
361 void JumpSliceByOffsetting(
int k,
double r,
double a,
double s);
362 void JumpSliceByCentering(
double r,
double a,
double s);
365 enum {DefaultJumpSlice=-1, CenteredJumpSlice=0, OffsetJumpSlice};
372 vtkSetMacro(JumpMode,
int);
373 vtkGetMacro(JumpMode,
int);
374 void SetJumpModeToCentered();
375 void SetJumpModeToOffset();
379 enum {AutomaticSliceSpacingMode=0, PrescribedSliceSpacingMode};
384 vtkGetMacro(SliceSpacingMode,
int);
385 vtkSetMacro(SliceSpacingMode,
int);
386 void SetSliceSpacingModeToAutomatic();
387 void SetSliceSpacingModeToPrescribed();
392 vtkSetVector3Macro(PrescribedSliceSpacing,
double);
393 vtkGetVector3Macro(PrescribedSliceSpacing,
double);
397 double GetSliceOffset();
398 void SetSliceOffset(
double offset);
402 vtkSetMacro(ActiveSlice,
int);
403 vtkGetMacro(ActiveSlice,
int);
420 void RotateToAxes(vtkMatrix4x4 *referenceToRAS,
int sliceNormalAxisIndex=-1);
427 void SetInteracting(
int);
428 vtkGetMacro(Interacting,
int);
429 vtkBooleanMacro(Interacting,
int);
450 ResetFieldOfViewFlag = 8,
451 MultiplanarReformatFlag = 16,
453 LabelOutlineFlag = 64,
454 SliceVisibleFlag = 128,
455 SliceSpacingFlag = 256
464 void SetInteractionFlags(
unsigned int);
465 vtkGetMacro(InteractionFlags,
unsigned int);
472 void SetInteractionFlagsModifier(
unsigned int);
473 vtkGetMacro(InteractionFlagsModifier,
unsigned int);
478 void ResetInteractionFlagsModifier();
486 SliceResolutionMatchVolumes=0,
490 SliceResolutionCustom
495 virtual void SetSliceResolutionMode(
int mode);
496 vtkGetMacro(SliceResolutionMode,
int);
523 double FieldOfView[3];
529 double UVWExtents[3];
530 int UVWDimensions[3];
531 int UVWMaximumDimensions[3];
542 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 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.
std::vector< OrientationPresetType > OrientationMatrices
MRML node for representing a volume (image stack).
vtkSmartPointer< vtkMatrix4x4 > XYToSlice
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 PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
std::string OrientationString