15#ifndef __vtkMRMLSliceLogic_h
16#define __vtkMRMLSliceLogic_h
37class vtkAlgorithmOutput;
40class vtkImageMathematics;
64 void PrintSelf(ostream& os, vtkIndent indent)
override;
69 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);
250 void GetBackgroundSliceBounds(
double sliceBounds[6]);
256 void RotateSliceToLowestVolumeAxes(
bool forceSlicePlaneToSingleSlice = true);
260 void FitSliceToFirst(
int width = -1,
int height = -1);
267 void FitSliceToBackground(
int width = -1,
int height = -1);
271 void FitSliceToAll(
int width = -1,
int height = -1);
275 void FitFOVToBackground(
double fov);
282 void ResizeSliceNode(
double newWidth,
double newHeight);
290 double* GetLowestVolumeSliceSpacing() VTK_SIZEHINT(3);
299 void GetLowestVolumeSliceBounds(
double sliceBounds[6],
bool useVoxelCenter=false);
303 double GetSliceOffset();
304 void SetSliceOffset(
double offset);
308 void GetSliceBounds(
double sliceBounds[6]);
312 void SetSliceExtentsToSliceNode();
317 void StartSliceNodeInteraction(
unsigned int parameters);
320 void EndSliceNodeInteraction();
325 void StartSliceCompositeNodeInteraction(
unsigned int parameters);
328 void EndSliceCompositeNodeInteraction();
331 void StartSliceOffsetInteraction();
334 void EndSliceOffsetInteraction();
339 void SnapSliceOffsetToIJK();
341 static const
int SLICE_INDEX_ROTATED;
342 static const
int SLICE_INDEX_OUT_OF_VOLUME;
343 static const
int SLICE_INDEX_NO_VOLUME;
360 int GetSliceIndexFromOffset(
double sliceOffset);
364 void CreateSliceModel();
365 void DeleteSliceModel();
378 static const std::
string SLICE_MODEL_NODE_NAME_SUFFIX;
394 int GetEditableLayerAtWorldPosition(
double worldPos[3],
bool backgroundVolumeEditable = true,
bool foregroundVolumeEditable = true);
398 bool GetSliceOffsetRangeResolution(
double range[2],
double& resolution);
409 void ProcessMRMLLogicsEvents(vtkObject * caller,
411 void * callData) override;
412 void ProcessMRMLLogicsEvents();
416 void UpdateFromMRMLScene() override;
417 void OnMRMLSceneStartClose() override;
418 void OnMRMLSceneEndImport() override;
419 void OnMRMLSceneEndRestore() override;
421 void UpdateSliceNodes();
422 void SetupCrosshairNode();
426 const
char* layoutName);
428 const
char* layoutName);
432 void SetWindowLevel(
int layer,
double window,
double level);
433 void GetWindowLevelAndRange(
int layer,
double& window,
double& level,
434 double& rangeLow,
double& rangeHigh,
bool& autoWindowLevel);
441 bool UpdateBlendLayers(vtkImageBlend* blend, const std::deque<SliceLayerInfo> &layers,
bool clipToBackgroundVolume);
444 bool UpdateFractions(vtkImageMathematics* fraction,
double opacity);
451 bool IsEventInsideVolume(
bool background,
double worldPos[3]);
459 bool VolumeWindowLevelEditable(const
char* vtkNotUsed(volumeNodeID))
461 vtkWarningMacro(
"vtkMRMLSliceLogic::VolumeWindowLevelEditable method is deprecated. Volume Window Level is always editable. Use the interaction node to check if in editing mode. "
462 "e.g. slicer.app.applicationLogic().GetInteractionNode().GetCurrentInteractionMode() == slicer.vtkMRMLInteractionNode.AdjustWindowLevel");
482 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)
void FitSliceToVolumes(vtkCollection *volumeNodes, int width, int height)
adjust the node's field of view to match the extent of the volume
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 the 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).