15 #ifndef __vtkMRMLSliceLogic_h 16 #define __vtkMRMLSliceLogic_h 35 class vtkAlgorithmOutput;
40 class vtkImageReslice;
43 struct SliceLayerInfo;
64 void PrintSelf(ostream& os, vtkIndent indent)
override;
69 CompositeModifiedEvent = 18000
113 void SetBackgroundWindowLevel(
double window,
double level);
118 void GetBackgroundWindowLevelAndRange(
double& window,
double& level,
119 double& rangeLow,
double& rangeHigh,
bool& autoWindowLevel);
123 void GetBackgroundWindowLevelAndRange(
double& window,
double& level,
124 double& rangeLow,
double& rangeHigh);
128 void SetForegroundWindowLevel(
double window,
double level);
133 void GetForegroundWindowLevelAndRange(
double& window,
double& level,
134 double& rangeLow,
double& rangeHigh,
bool& autoWindowLevel);
138 void GetForegroundWindowLevelAndRange(
double& window,
double& level,
139 double& rangeLow,
double& rangeHigh);
160 vtkImageBlend* GetBlend();
161 vtkImageBlend* GetBlendUVW();
166 vtkGetObjectMacro(ExtractModelTexture, vtkImageReslice);
171 vtkAlgorithmOutput *GetImageDataConnection();
175 void UpdatePipeline();
178 void UpdateImageData();
182 virtual bool EnterMRMLCallback()
const;
186 void UpdateSliceNode();
190 void UpdateSliceNodeFromLayout();
194 void UpdateSliceCompositeNode();
203 static void GetVolumeRASBox(
vtkMRMLVolumeNode *volumeNode,
double rasDimensions[3],
double rasCenter[3]);
207 void GetVolumeSliceDimensions(
vtkMRMLVolumeNode *volumeNode,
double sliceDimensions[3],
double sliceCenter[3]);
221 void GetVolumeSliceBounds(
vtkMRMLVolumeNode *volumeNode,
double sliceBounds[6],
bool useVoxelCenter=
false);
229 void GetBackgroundRASBox(
double rasDimensions[3],
double rasCenter[3]);
233 void GetBackgroundSliceDimensions(
double sliceDimensions[3],
double sliceCenter[3]);
239 double *GetBackgroundSliceSpacing();
245 void GetBackgroundSliceBounds(
double sliceBounds[6]);
251 void RotateSliceToLowestVolumeAxes(
bool forceSlicePlaneToSingleSlice =
true);
255 void FitSliceToBackground(
int width,
int height);
260 void FitSliceToAll(
int width = -1,
int height = -1);
264 void FitFOVToBackground(
double fov);
271 void ResizeSliceNode(
double newWidth,
double newHeight);
279 double *GetLowestVolumeSliceSpacing();
288 void GetLowestVolumeSliceBounds(
double sliceBounds[6],
bool useVoxelCenter=
false);
292 double GetSliceOffset();
293 void SetSliceOffset(
double offset);
297 void GetSliceBounds(
double sliceBounds[6]);
301 void SetSliceExtentsToSliceNode();
306 void StartSliceNodeInteraction(
unsigned int parameters);
309 void EndSliceNodeInteraction();
314 void StartSliceCompositeNodeInteraction(
unsigned int parameters);
317 void EndSliceCompositeNodeInteraction();
320 void StartSliceOffsetInteraction();
323 void EndSliceOffsetInteraction();
328 void SnapSliceOffsetToIJK();
349 int GetSliceIndexFromOffset(
double sliceOffset);
353 void CreateSliceModel();
354 void DeleteSliceModel();
358 std::vector< vtkMRMLDisplayNode*> GetPolyDataDisplayNodes();
372 static bool IsSliceModelNode(
vtkMRMLNode *mrmlNode);
383 int GetEditableLayerAtWorldPosition(
double worldPos[3],
bool backgroundVolumeEditable =
true,
bool foregroundVolumeEditable =
true);
396 void * callData)
override;
406 void UpdateSliceNodes();
407 void SetupCrosshairNode();
411 const char* layoutName);
413 const char* layoutName);
417 void SetWindowLevel(
double window,
double level,
int layer);
423 bool UpdateBlendLayers(vtkImageBlend* blend,
const std::deque<SliceLayerInfo> &layers);
427 bool IsEventInsideVolume(
bool background,
double worldPos[3]);
430 bool VolumeWindowLevelEditable(
const char* volumeNodeID);
448 double SliceSpacing[3];
virtual void OnMRMLSceneStartClose()
static const int SLICE_INDEX_ROTATED
vtkMRMLLinearTransformNode * SliceModelTransformNode
Superclass for MRML logic classes.
static const int SLICE_INDEX_OUT_OF_VOLUME
void PrintSelf(ostream &os, vtkIndent indent) override
vtkAlgorithmOutput * ImageDataConnection
virtual void OnMRMLSceneEndImport()
MRML node to represent a display property of 3D surface model.
MRML node to represent a 3D surface model.
static const int SLICE_INDEX_NO_VOLUME
MRML node to store display properties of slice nodes.
MRML node for storing a slice through RAS space.
MRML node for storing a slice through RAS space.
vtkMRMLSliceLayerLogic * ForegroundLayer
virtual void ProcessMRMLLogicsEvents(vtkObject *caller, unsigned long event, void *callData)
vtkMRMLModelDisplayNode * SliceModelDisplayNode
vtkMRMLModelNode * SliceModelNode
vtkImageReslice * ExtractModelTexture
vtkMRMLSliceLayerLogic * LabelLayer
vtkMRMLSliceCompositeNode * SliceCompositeNode
virtual void OnMRMLNodeModified(vtkMRMLNode *)
A set of MRML Nodes that supports serialization and undo/redo.
virtual void OnMRMLSceneNodeAdded(vtkMRMLNode *)
bool AddingSliceModelNodes
vtkMRMLSliceLayerLogic * BackgroundLayer
static const std::string SLICE_MODEL_NODE_NAME_SUFFIX
virtual void OnMRMLSceneNodeRemoved(vtkMRMLNode *)
virtual void SetMRMLSceneInternal(vtkMRMLScene *newScene)
MRML node for representing a volume (image stack).
virtual void OnMRMLSceneEndRestore()
Abstract class that contains graphical display properties for displayable nodes.
virtual void UpdateFromMRMLScene()
Abstract Superclass for all specific types of MRML nodes.
static vtkMRMLAbstractLogic * New()
BlendPipeline * PipelineUVW
Slicer logic class for slice manipulation.
vtkMRMLSliceNode * SliceNode