21#ifndef __vtkMRMLApplicationLogic_h
22#define __vtkMRMLApplicationLogic_h
27#include "vtkMRMLLogicExport.h"
56 void PrintSelf(ostream& os, vtkIndent indent)
override;
120 ForegroundLayer = 0x2,
121 BackgroundLayer = 0x4,
122 AllLayers = LabelLayer | ForegroundLayer | BackgroundLayer
134 void FitSliceToAll(
bool onlyIfPropagateVolumeSelectionAllowed=
false,
bool resetOrientation=
true);
153 bool Zip(
const char* zipFileName,
const char* directoryToZip);
157 bool Unzip(
const char* zipFileName,
const char* destinationDirectory);
190 const std::vector<std::string>& directories);
201 RequestInvokeEvent = vtkCommand::UserEvent + 1,
202 PauseRenderEvent = vtkCommand::UserEvent + 101,
211 unsigned int Delay{100};
213 vtkObject* Caller{
nullptr};
215 unsigned long EventID{vtkCommand::ModifiedEvent};
217 void* CallData{
nullptr};
222 unsigned long eventID = vtkCommand::ModifiedEvent,
223 void* callData =
nullptr);
314 void FitSliceToContent(
bool all,
bool onlyIfPropagateVolumeSelectionAllowed=
false,
bool resetOrientation=
true);
329 vtkInternal* Internal;
Superclass for MRML logic classes.
static std::string PercentEncode(std::string s)
void FitSliceToContent(bool all, bool onlyIfPropagateVolumeSelectionAllowed=false, bool resetOrientation=true)
void SetIntersectingSlicesLineThicknessMode(int mode)
void PropagateBackgroundVolumeSelection(int fit=1)
void OnMRMLSceneStartBatchProcess() override
void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData) override
vtkMRMLSliceLogic * GetSliceLogic(vtkMRMLSliceNode *sliceNode) const
Events
List of custom events fired by the class.
@ ShowViewContextMenuEvent
vtkMRMLViewLogic * GetViewLogic(vtkMRMLViewNode *viewNode) const
void OnMRMLSceneEndRestore() override
void SetIntersectingSlicesIntersectionMode(int mode)
void SetModuleLogic(const char *moduleName, vtkMRMLAbstractLogic *moduleLogic)
vtkMRMLColorLogic * GetColorLogic() const
bool Unzip(const char *zipFileName, const char *destinationDirectory)
bool OpenSlicerDataBundle(const char *sdbFilePath, const char *temporaryDirectory, vtkMRMLMessageCollection *userMessages=nullptr)
vtkCollection * GetSliceLogics() const
vtkMRMLApplicationLogic()
vtkMRMLSliceLogic * GetSliceLogicByLayoutName(const char *layoutName) const
void UseCustomFontFile(vtkTextProperty *textProperty)
void SetInteractionNode(vtkMRMLInteractionNode *)
void SetViewLogics(vtkCollection *viewLogics)
All the view logics in the application.
bool Zip(const char *zipFileName, const char *directoryToZip)
virtual void ResumeRender()
std::string GetFontFileName(int fontFamily)
void OnMRMLSceneEndImport() override
std::string GetFontsDirectory()
Get folder where font files are stored ("Fonts" subfolder in application share folder).
void SetSelectionNode(vtkMRMLSelectionNode *)
void SaveSceneScreenshot(vtkImageData *screenshot)
void PropagateTableSelection()
Propagate selected table in the SelectionNode to table view nodes.
bool GetIntersectingSlicesEnabled(IntersectingSlicesOperation operation)
vtkCollection * GetViewLogics() const
void InvokeEventWithDelay(unsigned int delayInMs, vtkObject *caller, unsigned long eventID=vtkCommand::ModifiedEvent, void *callData=nullptr)
Conveniently calls an InvokeEvent on an object with a delay.
void PropagateVolumeSelection(int layer, int fit)
virtual void PauseRender()
void PropagateVolumeSelection(int fit=1)
virtual void EditNode(vtkMRMLNode *node)
Requests the application to show user interface for editing a node.
void SetSliceLogics(vtkCollection *sliceLogics)
All the slice logics in the application.
bool SaveSceneToSlicerDataBundleDirectory(const char *sdbDir, vtkImageData *screenShot=nullptr, vtkMRMLMessageCollection *userMessages=nullptr)
void PropagateLabelVolumeSelection(int fit=1)
static std::string CreateUniqueFileName(const std::string &filename, const std::string &knownExtension="")
void SetTemporaryPath(const char *path)
Set the temporary path the logics can use. The path should be set by the application.
void PropagatePlotChartSelection()
Propagate selected PlotChart in the SelectionNode to Plot view nodes.
void SetColorLogic(vtkMRMLColorLogic *newColorLogic)
std::string GetFontFilePath(const std::string &fontFileName)
Get full path to custom font file for rendering views from font file name.
void OnMRMLSceneEndBatchProcess() override
void PropagateForegroundVolumeSelection(int fit=1)
void FitSliceToBackground(bool onlyIfPropagateVolumeSelectionAllowed=false, bool resetOrientation=true)
vtkMRMLViewLogic * GetViewLogicByLayoutName(const char *layoutName) const
void PrintSelf(ostream &os, vtkIndent indent) override
IntersectingSlicesOperation
@ IntersectingSlicesThickSlabInteractive
@ IntersectingSlicesInteractive
@ IntersectingSlicesTranslation
@ IntersectingSlicesVisibility
@ IntersectingSlicesRotation
void OnMRMLSceneStartRestore() override
void OnMRMLSceneStartImport() override
const char * GetTemporaryPath()
Return the temporary path that was set by the application.
vtkMRMLInteractionNode * GetInteractionNode() const
Get default Interaction node.
void SetFontFileName(int fontFamily, const std::string &fontFileName)
vtkMRMLSliceLogic * GetSliceLogicByModelDisplayNode(vtkMRMLModelDisplayNode *displayNode) const
Get slice logic from slice model display node.
std::string UnpackSlicerDataBundle(const char *sdbFilePath, const char *temporaryDirectory)
int GetIntersectingSlicesLineThicknessMode()
vtkMRMLAbstractLogic * GetModuleLogic(const char *moduleName) const
void FitSliceToAll(bool onlyIfPropagateVolumeSelectionAllowed=false, bool resetOrientation=true)
void SetMRMLSceneInternal(vtkMRMLScene *newScene) override
static int LoadDefaultParameterSets(vtkMRMLScene *scene, const std::vector< std::string > &directories)
int GetIntersectingSlicesIntersectionMode()
void SetIntersectingSlicesEnabled(IntersectingSlicesOperation operation, bool enabled)
~vtkMRMLApplicationLogic() override
static vtkMRMLApplicationLogic * New()
vtkMRMLSelectionNode * GetSelectionNode() const
Get default Selection node.
MRML logic class for color manipulation.
MRML node to represent a display property of 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 information about the active nodes in the scene.
Slicer logic class for slice manipulation.
MRML node for storing a slice through RAS space.
MRML node to represent a 3D surface model.
A superclass for other storage nodes.
Slicer logic class for view manipulation.
MRML node to represent a 3D view.
Structure passed as calldata pointer in the RequestEvent invoked event.