15#ifndef __vtkMRMLSliceLogic_h
16#define __vtkMRMLSliceLogic_h
35class vtkAlgorithmOutput;
40class vtkImageMathematics;
65 void PrintSelf(ostream& os, vtkIndent indent)
override;
70 CompositeModifiedEvent = 18000
120 double& rangeLow,
double& rangeHigh,
bool& autoWindowLevel);
125 double& rangeLow,
double& rangeHigh);
135 double& rangeLow,
double& rangeHigh,
bool& autoWindowLevel);
140 double& rangeLow,
double& rangeHigh);
167 vtkGetObjectMacro(ExtractModelTexture, vtkImageReslice);
246 void GetBackgroundSliceBounds(
double sliceBounds[6]);
252 void RotateSliceToLowestVolumeAxes(
bool forceSlicePlaneToSingleSlice = true);
256 void FitSliceToBackground(
int width,
int height);
261 void FitSliceToAll(
int width = -1,
int height = -1);
265 void FitFOVToBackground(
double fov);
272 void ResizeSliceNode(
double newWidth,
double newHeight);
280 double* GetLowestVolumeSliceSpacing() VTK_SIZEHINT(3);
289 void GetLowestVolumeSliceBounds(
double sliceBounds[6],
bool useVoxelCenter=false);
293 double GetSliceOffset();
294 void SetSliceOffset(
double offset);
298 void GetSliceBounds(
double sliceBounds[6]);
302 void SetSliceExtentsToSliceNode();
307 void StartSliceNodeInteraction(
unsigned int parameters);
310 void EndSliceNodeInteraction();
315 void StartSliceCompositeNodeInteraction(
unsigned int parameters);
318 void EndSliceCompositeNodeInteraction();
321 void StartSliceOffsetInteraction();
324 void EndSliceOffsetInteraction();
329 void SnapSliceOffsetToIJK();
331 static const
int SLICE_INDEX_ROTATED;
332 static const
int SLICE_INDEX_OUT_OF_VOLUME;
333 static const
int SLICE_INDEX_NO_VOLUME;
350 int GetSliceIndexFromOffset(
double sliceOffset);
354 void CreateSliceModel();
355 void DeleteSliceModel();
368 static const std::
string SLICE_MODEL_NODE_NAME_SUFFIX;
384 int GetEditableLayerAtWorldPosition(
double worldPos[3],
bool backgroundVolumeEditable = true,
bool foregroundVolumeEditable = true);
388 bool GetSliceOffsetRangeResolution(
double range[2],
double& resolution);
399 void ProcessMRMLLogicsEvents(vtkObject * caller,
401 void * callData) override;
402 void ProcessMRMLLogicsEvents();
406 void UpdateFromMRMLScene() override;
407 void OnMRMLSceneStartClose() override;
408 void OnMRMLSceneEndImport() override;
409 void OnMRMLSceneEndRestore() override;
411 void UpdateSliceNodes();
412 void SetupCrosshairNode();
416 const
char* layoutName);
418 const
char* layoutName);
422 void SetWindowLevel(
double window,
double level,
int layer);
428 bool UpdateBlendLayers(vtkImageBlend* blend, const std::deque<SliceLayerInfo> &layers);
431 bool UpdateFractions(vtkImageMathematics* fraction,
double opacity);
438 bool IsEventInsideVolume(
bool background,
double worldPos[3]);
441 bool VolumeWindowLevelEditable(const
char* vtkNotUsed(volumeNodeID))
443 vtkWarningMacro(
"vtkMRMLSliceLogic::VolumeWindowLevelEditable method is deprecated. Volume Window Level is always editable. Use the interaction node to check if in editing mode. "
444 "e.g. slicer.app.applicationLogic().GetInteractionNode().GetCurrentInteractionMode() == slicer.vtkMRMLInteractionNode.AdjustWindowLevel");
464 double SliceSpacing[3];
Superclass for MRML logic classes.
Abstract class that contains graphical display properties for displayable nodes.
MRML node to represent a display property of 3D surface model.
MRML node to represent a 3D surface model.
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.
MRML node to store display properties of slice nodes.
Slicer logic class for slice manipulation.
void UpdateSliceNode()
Manage and synchronize the SliceNode.
void GetBackgroundSliceDimensions(double sliceDimensions[3], double sliceCenter[3])
Get the size of the volume, transformed to slice space.
vtkMRMLSliceLayerLogic * LabelLayer
void PrintSelf(ostream &os, vtkIndent indent) override
void SetSliceCompositeNode(vtkMRMLSliceCompositeNode *SliceCompositeNode)
void SetForegroundLayer(vtkMRMLSliceLayerLogic *ForegroundLayer)
void UpdateImageData()
Internally used by UpdatePipeline.
vtkMRMLSliceNode * AddSliceNode(const char *layoutName)
Convenience function for adding a slice node and setting it in this logic.
vtkImageBlend * GetBlendUVW()
void GetVolumeSliceDimensions(vtkMRMLVolumeNode *volumeNode, double sliceDimensions[3], double sliceCenter[3])
Get the size of the volume, transformed to slice space.
vtkMRMLSliceDisplayNode * GetSliceDisplayNode()
Slice plane display properties.
double * GetBackgroundSliceSpacing() VTK_SIZEHINT(3)
vtkMRMLModelNode * SliceModelNode
bool AddingSliceModelNodes
void SetBackgroundWindowLevel(double window, double level)
Helper to set the background layer Window/Level.
void SetSliceNode(vtkMRMLSliceNode *newSliceNode)
BlendPipeline * PipelineUVW
void GetBackgroundWindowLevelAndRange(double &window, double &level, double &rangeLow, double &rangeHigh)
Helper to get the background layer Window/Level and intensity range.
static vtkMRMLSliceLogic * New()
The Usual VTK class functions.
void GetBackgroundWindowLevelAndRange(double &window, double &level, double &rangeLow, double &rangeHigh, bool &autoWindowLevel)
void FitSliceToVolume(vtkMRMLVolumeNode *volumeNode, int width, int height)
adjust the node's field of view to match the extent of current background volume
vtkMRMLVolumeNode * GetLayerVolumeNode(int layer)
vtkImageBlend * GetBlend()
void SetLabelLayer(vtkMRMLSliceLayerLogic *LabelLayer)
vtkMRMLSliceCompositeNode * SliceCompositeNode
vtkMRMLSliceLayerLogic * BackgroundLayer
void GetBackgroundRASBox(double rasDimensions[3], double rasCenter[3])
Get the size of the volume, transformed to RAS space.
vtkMRMLLinearTransformNode * SliceModelTransformNode
static void GetVolumeRASBox(vtkMRMLVolumeNode *volumeNode, double rasDimensions[3], double rasCenter[3])
Get the size of the volume, transformed to RAS space.
void SetForegroundWindowLevel(double window, double level)
Helper to set the foreground layer Window/Level.
void GetVolumeSliceBounds(vtkMRMLVolumeNode *volumeNode, double sliceBounds[6], bool useVoxelCenter=false)
vtkAlgorithmOutput * GetImageDataConnection()
vtkImageReslice * ExtractModelTexture
double * GetVolumeSliceSpacing(vtkMRMLVolumeNode *volumeNode) VTK_SIZEHINT(3)
void SetBackgroundLayer(vtkMRMLSliceLayerLogic *BackgroundLayer)
vtkAlgorithmOutput * ImageDataConnection
vtkMRMLSliceNode * SliceNode
void UpdateSliceNodeFromLayout()
Update slicer node given a layout name.
void GetForegroundWindowLevelAndRange(double &window, double &level, double &rangeLow, double &rangeHigh, bool &autoWindowLevel)
void UpdatePipeline()
update the pipeline to reflect the current state of the nodes
virtual bool EnterMRMLCallback() const
vtkMRMLModelDisplayNode * SliceModelDisplayNode
vtkMRMLSliceLayerLogic * ForegroundLayer
void UpdateSliceCompositeNode()
Manage and synchronize the SliceCompositeNode.
void GetForegroundWindowLevelAndRange(double &window, double &level, double &rangeLow, double &rangeHigh)
Helper to get the foreground layer Window/Level and intensity range.
MRML node for storing a slice through RAS space.
MRML node for representing a volume (image stack).