15 #ifndef __vtkMRMLSliceLogic_h 16 #define __vtkMRMLSliceLogic_h 34 class vtkAlgorithmOutput;
39 class vtkImageReslice;
42 struct SliceLayerInfo;
63 void PrintSelf(ostream& os, vtkIndent indent)
override;
68 CompositeModifiedEvent = 18000
112 void SetBackgroundWindowLevel(
double window,
double level);
117 void GetBackgroundWindowLevelAndRange(
double& window,
double& level,
118 double& rangeLow,
double& rangeHigh,
bool& autoWindowLevel);
122 void GetBackgroundWindowLevelAndRange(
double& window,
double& level,
123 double& rangeLow,
double& rangeHigh);
127 void SetForegroundWindowLevel(
double window,
double level);
132 void GetForegroundWindowLevelAndRange(
double& window,
double& level,
133 double& rangeLow,
double& rangeHigh,
bool& autoWindowLevel);
137 void GetForegroundWindowLevelAndRange(
double& window,
double& level,
138 double& rangeLow,
double& rangeHigh);
154 vtkImageBlend* GetBlend();
155 vtkImageBlend* GetBlendUVW();
160 vtkGetObjectMacro(ExtractModelTexture, vtkImageReslice);
165 vtkAlgorithmOutput *GetImageDataConnection();
169 void UpdatePipeline();
172 void UpdateImageData();
176 virtual bool EnterMRMLCallback()
const;
180 void UpdateSliceNode();
184 void UpdateSliceNodeFromLayout();
188 void UpdateSliceCompositeNode();
197 static void GetVolumeRASBox(
vtkMRMLVolumeNode *volumeNode,
double rasDimensions[3],
double rasCenter[3]);
201 void GetVolumeSliceDimensions(
vtkMRMLVolumeNode *volumeNode,
double sliceDimensions[3],
double sliceCenter[3]);
215 void GetVolumeSliceBounds(
vtkMRMLVolumeNode *volumeNode,
double sliceBounds[6],
bool useVoxelCenter=
false);
223 void GetBackgroundRASBox(
double rasDimensions[3],
double rasCenter[3]);
227 void GetBackgroundSliceDimensions(
double sliceDimensions[3],
double sliceCenter[3]);
233 double *GetBackgroundSliceSpacing();
239 void GetBackgroundSliceBounds(
double sliceBounds[6]);
245 void RotateSliceToLowestVolumeAxes(
bool forceSlicePlaneToSingleSlice =
true);
249 void FitSliceToBackground(
int width,
int height);
254 void FitSliceToAll(
int width = -1,
int height = -1);
258 void FitFOVToBackground(
double fov);
265 void ResizeSliceNode(
double newWidth,
double newHeight);
273 double *GetLowestVolumeSliceSpacing();
282 void GetLowestVolumeSliceBounds(
double sliceBounds[6],
bool useVoxelCenter=
false);
286 double GetSliceOffset();
287 void SetSliceOffset(
double offset);
291 void GetSliceBounds(
double sliceBounds[6]);
295 void SetSliceExtentsToSliceNode();
300 void StartSliceNodeInteraction(
unsigned int parameters);
303 void EndSliceNodeInteraction();
308 void StartSliceCompositeNodeInteraction(
unsigned int parameters);
311 void EndSliceCompositeNodeInteraction();
314 void StartSliceOffsetInteraction();
317 void EndSliceOffsetInteraction();
322 void SnapSliceOffsetToIJK();
343 int GetSliceIndexFromOffset(
double sliceOffset);
347 void CreateSliceModel();
348 void DeleteSliceModel();
352 std::vector< vtkMRMLDisplayNode*> GetPolyDataDisplayNodes();
366 static bool IsSliceModelNode(
vtkMRMLNode *mrmlNode);
384 void * callData)
override;
394 void UpdateSliceNodes();
395 void SetupCrosshairNode();
399 const char* layoutName);
401 const char* layoutName);
405 void SetWindowLevel(
double window,
double level,
int layer);
411 bool UpdateBlendLayers(vtkImageBlend* blend,
const std::deque<SliceLayerInfo> &layers);
430 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 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()
vtkTransform * ActiveSliceTransform
BlendPipeline * PipelineUVW
Slicer logic class for slice manipulation.
vtkMRMLSliceNode * SliceNode