15#ifndef __vtkMRMLSliceLogic_h
16#define __vtkMRMLSliceLogic_h
37class vtkAlgorithmOutput;
40class vtkImageMathematics;
64 void PrintSelf(ostream& os, vtkIndent indent)
override;
128 double& rangeLow,
double& rangeHigh,
bool& autoWindowLevel);
132 double& rangeLow,
double& rangeHigh);
140 double& rangeLow,
double& rangeHigh,
bool& autoWindowLevel);
144 double& rangeLow,
double& rangeHigh);
396 void * callData) override;
411 const
char* layoutName);
413 const
char* layoutName);
422 double& rangeLow,
double& rangeHigh,
bool& autoWindowLevel);
429 static
bool UpdateBlendLayers(vtkImageBlend* blend, const std::deque<SliceLayerInfo> &layers,
bool clipToBackgroundVolume);
438 static
bool UpdateFractions(BlendPipeline* pipeline, const std::vector<vtkAlgorithmOutput*>& imagePorts, const std::vector<
double>& opacities);
455 vtkWarningMacro(
"vtkMRMLSliceLogic::VolumeWindowLevelEditable method is deprecated. Volume Window Level is always editable. Use the interaction node to check if in editing mode. "
456 "e.g. slicer.app.applicationLogic().GetInteractionNode().GetCurrentInteractionMode() == slicer.vtkMRMLInteractionNode.AdjustWindowLevel");
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.
vtkAlgorithmOutput * GetNthLayerImageDataConnectionUVW(int layerIndex)
void GetBackgroundSliceBounds(double sliceBounds[6])
std::vector< LayerListItem >::iterator LayerListIterator
void UpdateSliceNode()
Manage and synchronize the SliceNode.
void OnMRMLSceneEndRestore() override
void GetBackgroundSliceDimensions(double sliceDimensions[3], double sliceCenter[3])
Get the size of the volume, transformed to slice space.
void SetNthLayer(int layerIndex, vtkMRMLSliceLayerLogic *layer)
void OnMRMLSceneNodeRemoved(vtkMRMLNode *node) override
vtkMRMLVolumeNode * GetNthLayerVolumeNode(int layerIndex)
vtkMRMLSliceLayerLogic * GetForegroundLayer()
void FitSliceToBackground(int width=-1, int height=-1)
void PrintSelf(ostream &os, vtkIndent indent) override
void SetSliceCompositeNode(vtkMRMLSliceCompositeNode *SliceCompositeNode)
void StartSliceCompositeNodeInteraction(unsigned int parameters)
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.
void OnMRMLSceneStartClose() override
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.
void GetSliceBounds(double sliceBounds[6])
Get the largest slice bounding box for all volumes in layers.
void SnapSliceOffsetToIJK()
vtkMRMLSliceLayerLogic * GetBackgroundLayer()
bool GetSliceOffsetRangeResolution(double range[2], double &resolution)
void OnMRMLNodeModified(vtkMRMLNode *node) override
bool IsEventInsideVolume(bool background, double worldPos[3])
double * GetBackgroundSliceSpacing() VTK_SIZEHINT(3)
static bool UpdateBlendLayers(vtkImageBlend *blend, const std::deque< SliceLayerInfo > &layers, bool clipToBackgroundVolume)
void OnMRMLSceneEndImport() override
void FitSliceToVolumes(vtkCollection *volumeNodes, int width, int height)
adjust the node's field of view to match the extent of the volume
vtkMRMLModelNode * SliceModelNode
void UpdateFromMRMLScene() override
bool AddingSliceModelNodes
void SetBackgroundWindowLevel(double window, double level)
Helper to set the background layer Window/Level.
bool VolumeWindowLevelEditable(const char *vtkNotUsed(volumeNodeID))
Deprecated. Returns true if the volume's window/level values are editable on the GUI.
vtkMRMLSliceLayerLogic * GetNthLayer(int layerIndex)
void SetSliceNode(vtkMRMLSliceNode *newSliceNode)
static bool IsSliceModelNode(vtkMRMLNode *mrmlNode)
BlendPipeline * PipelineUVW
void GetBackgroundWindowLevelAndRange(double &window, double &level, double &rangeLow, double &rangeHigh)
Helper to get the background layer Window/Level and intensity range.
static const int SLICE_INDEX_NO_VOLUME
void FitFOVToBackground(double fov)
static vtkMRMLSliceLogic * New()
The Usual VTK class functions.
void GetBackgroundWindowLevelAndRange(double &window, double &level, double &rangeLow, double &rangeHigh, bool &autoWindowLevel)
std::vector< LayerListItem > LayerList
vtkSmartPointer< vtkMRMLSliceLayerLogic > LayerListItem
vtkAlgorithmOutput * GetNthLayerImageDataConnection(int layerIndex)
void FitSliceToVolume(vtkMRMLVolumeNode *volumeNode, int width, int height)
adjust the node's field of view to match the extent of the volume
void GetWindowLevelAndRange(int layer, double &window, double &level, double &rangeLow, double &rangeHigh, bool &autoWindowLevel)
static bool UpdateAddSubOperation(vtkImageMathematics *addSubMath, int compositing)
Helper to update the operation to perform based on compositing mode.
void StartSliceNodeInteraction(unsigned int parameters)
std::vector< LayerListItem >::const_iterator LayerListConstIterator
vtkMRMLVolumeNode * GetLayerVolumeNode(int layer)
double * GetLowestVolumeSliceSpacing() VTK_SIZEHINT(3)
void SetWindowLevel(int layer, double window, double level)
vtkImageBlend * GetBlend()
void ResizeSliceNode(double newWidth, double newHeight)
static bool IsSliceModelDisplayNode(vtkMRMLDisplayNode *mrmlDisplayNode)
static bool UpdateFractions(vtkImageMathematics *fraction, double opacity)
Helper to update layer opacity when adding/subtracting the background layer.
void SetLabelLayer(vtkMRMLSliceLayerLogic *LabelLayer)
vtkMRMLSliceCompositeNode * SliceCompositeNode
static void UpdateReconstructionSlab(vtkMRMLSliceLogic *sliceLogic, vtkMRMLSliceLayerLogic *sliceLayerLogic)
Helper to update reconstruction slab settings for a given layer.
void OnMRMLSceneNodeAdded(vtkMRMLNode *node) override
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.
static const std::string SLICE_MODEL_NODE_NAME_SUFFIX
void StartSliceOffsetInteraction()
Indicate the slice offset value is starting to change.
void SetForegroundWindowLevel(double window, double level)
Helper to set the foreground layer Window/Level.
void ProcessMRMLLogicsEvents(vtkObject *caller, unsigned long event, void *callData) override
process logic events
void SetSliceExtentsToSliceNode()
Set slice extents to all layers.
void GetVolumeSliceBounds(vtkMRMLVolumeNode *volumeNode, double sliceBounds[6], bool useVoxelCenter=false)
vtkAlgorithmOutput * GetImageDataConnection()
static const int SLICE_INDEX_ROTATED
void EndSliceCompositeNodeInteraction()
Indicate an interaction with the slice composite node has been completed.
vtkMRMLSliceLayerLogic * GetLabelLayer()
void SetMRMLSceneInternal(vtkMRMLScene *newScene) override
std::vector< vtkMRMLDisplayNode * > GetPolyDataDisplayNodes()
Get all slice displaynodes creating PolyData models like glyphs etc.
vtkImageReslice * ExtractModelTexture
double * GetVolumeSliceSpacing(vtkMRMLVolumeNode *volumeNode) VTK_SIZEHINT(3)
void SetSliceOffset(double offset)
void SetBackgroundLayer(vtkMRMLSliceLayerLogic *BackgroundLayer)
static const int SLICE_INDEX_OUT_OF_VOLUME
virtual vtkMRMLSliceNode * GetSliceNode()
The MRML slice node for this slice logic.
vtkAlgorithmOutput * ImageDataConnection
vtkMRMLSliceNode * SliceNode
void UpdateSliceNodeFromLayout()
Update slicer node given a layout name.
void FitSliceToAll(int width=-1, int height=-1)
adjust the node's field of view to match the extent of all volume layers
void GetForegroundWindowLevelAndRange(double &window, double &level, double &rangeLow, double &rangeHigh, bool &autoWindowLevel)
int GetEditableLayerAtWorldPosition(double worldPos[3], bool backgroundVolumeEditable=true, bool foregroundVolumeEditable=true)
void RotateSliceToLowestVolumeAxes(bool forceSlicePlaneToSingleSlice=true)
vtkMRMLVolumeNode * GetFirstVolumeNode()
void UpdatePipeline()
update the pipeline to reflect the current state of the nodes
virtual bool EnterMRMLCallback() const
void GetLowestVolumeSliceBounds(double sliceBounds[6], bool useVoxelCenter=false)
void SetNthLayerVolumeNode(int layerIndex, vtkMRMLVolumeNode *volumeNode)
Set volume associated with a layer.
int GetSliceIndexFromOffset(double sliceOffset, vtkMRMLVolumeNode *volumeNode)
void EndSliceOffsetInteraction()
Indicate the slice offset value has completed its change.
virtual vtkMRMLSliceCompositeNode * GetSliceCompositeNode()
void SetupCrosshairNode()
void FitSliceToFirst(int width=-1, int height=-1)
adjust the node's field of view to match the extent of the first selected volume (background,...
vtkMRMLModelDisplayNode * SliceModelDisplayNode
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.
void EndSliceNodeInteraction()
Indicate an interaction with the slice node has been completed.
MRML node for storing a slice through RAS space.
MRML node for representing a volume (image stack).