NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
Public Member Functions | |
BaseSegmentorController (IBaseView *view) | |
virtual | ~BaseSegmentorController () |
virtual void | SetupGUI (QWidget *parent) override |
Sets up the GUI. This function has to be called from the CreateQtPartControl function of the view. More... | |
mitk::ToolManager * | GetToolManager () const |
Returns the segmentation tool manager used by the segmentor. More... | |
template<class ToolType > | |
ToolType * | GetToolByType () |
virtual bool | EventFilter (const mitk::StateEvent *stateEvent) const override |
Returns true if the event should be filtered, i.e. not processed, otherwise false. More... | |
virtual bool | EventFilter (mitk::InteractionEvent *event) const override |
Returns true if the event should be filtered, i.e. not processed, otherwise false. More... | |
const QColor & | GetDefaultSegmentationColour () const |
Default colour to be displayed in the new segmentation dialog box. More... | |
void | SetDefaultSegmentationColour (const QColor &defaultSegmentationColour) |
Default colour to be displayed in the new segmentation dialog box. More... | |
virtual void | OnViewGetsActivated () override |
Called when the BlueBerry view that hosts the GUI for this controller gets activated. More... | |
Public Member Functions inherited from niftk::BaseController | |
BaseController (IBaseView *view) | |
Constructs a BaseController object. More... | |
virtual | ~BaseController () |
Destructs the BaseController object. More... | |
ImageOrientation | GetOrientation () const |
Returns the orientation of the selected render window. Returns IMAGE_ORIENTATION_UNKNOWN if no window is selected or the selected window is a 3D window. More... | |
int | GetSliceIndex () const |
Returns the index of the displayed slice in the currently selected window. Returns -1 if no window is selected or the selected window is a 3D window. More... | |
mitk::Point3D | GetSelectedPosition () const |
Returns the selected position in the current editor (render window part). The selected position is the voxel at the intersection of the crosshair planes. More... | |
virtual void | OnViewGetsDeactivated () |
Called when the BlueBerry view that hosts the GUI for this controller gets deactivated. More... | |
virtual void | OnViewGetsVisible () |
Called when the BlueBerry view that hosts the GUI for this controller becomes visible. More... | |
virtual void | OnViewGetsHidden () |
Called when the BlueBerry view that hosts the GUI for this controller becomes hidden. More... | |
Public Member Functions inherited from niftk::StateMachineEventFilter | |
mitkClassMacroNoParent (StateMachineEventFilter) StateMachineEventFilter() | |
virtual | ~StateMachineEventFilter () |
Protected Slots | |
virtual void | OnNewSegmentationButtonClicked ()=0 |
Called from niftkSegmentationSelectorWidget when the 'Start/restart segmentation' button is clicked. More... | |
Protected Member Functions | |
virtual void | OnActiveToolChanged () |
Called from niftkToolSelectorWidget when a tool changes. More... | |
std::vector< mitk::DataNode * > | GetWorkingData () |
Gets a vector of the working data nodes registered with the tool manager. The data nodes normally hold image, but could be surfaces etc. Empty list is returned if this can't be found. More... | |
mitk::Image * | GetWorkingImage (int index) |
Gets a single binary image registered with the ToolManager. Returns nullptr if it can't be found or is not an image. More... | |
mitk::DataNode * | GetReferenceNode () |
Gets the reference node from the tool manager or nullptr if it can't be found. More... | |
mitk::Image * | GetReferenceImage () |
Gets the reference image from the tool manager, or nullptr if this doesn't yet exist or is not an image. Assumes that a reference (grey scale) image is always registered with the tool manager. More... | |
mitk::DataNode * | FindReferenceNodeFromSegmentationNode (const mitk::DataNode::Pointer segmentationNode) |
Gets the reference node that the segmentation node belongs to. Assumes that the reference (grey scale) node is always the direct parent of the segmentation (binary) node, so we simply search for a non binary parent. More... | |
void | SetReferenceImageSelected () |
Makes sure the reference image is the selected one. More... | |
virtual bool | IsAReferenceImage (const mitk::DataNode::Pointer node) |
Returns true if node represent an image that is non binary, and false otherwise. More... | |
virtual bool | IsASegmentationImage (const mitk::DataNode::Pointer node) |
Returns true if node represents an image that is binary, and false otherwise. More... | |
virtual bool | IsAWorkingImage (const mitk::DataNode::Pointer node) |
Returns true if node represents an image that is binary, and false otherwise. More... | |
virtual std::vector < mitk::DataNode * > | GetWorkingDataFromSegmentationNode (const mitk::DataNode::Pointer node) |
Assumes that a Working Node == a Segmentation Node, so simply returns the input node. More... | |
virtual mitk::DataNode * | GetSegmentationNodeFromWorkingData (const mitk::DataNode::Pointer node) |
Assumes that a Working Node == a Segmentation Node, so simply returns the input node. More... | |
virtual bool | CanStartSegmentationForBinaryNode (const mitk::DataNode::Pointer node)=0 |
Subclasses decide if they can restart the segmentation for a binary node. More... | |
virtual void | ApplyDisplayOptions (mitk::DataNode *node) |
Decorates a DataNode according to the user preference settings, or requirements for binary images. More... | |
int | GetReferenceImageSliceAxis () |
Returns which image coordinate corresponds to the currently selected orientation. Retrieves the currently active QmitkRenderWindow, and the reference image registered with the ToolManager, and returns the Image axis that the current view is looking along, or -1 if it can not be worked out. More... | |
int | GetReferenceImageSliceAxis (ImageOrientation orientation) |
Returns which image coordinate corresponds to the given orientation. Looks up the ReferenceImage registered with ToolManager and returns the axis [0,1,2] that corresponds to the given orientation, or -1 if it can't be found. More... | |
int | GetReferenceImageSliceIndex () |
Returns the slice index in the reference image that corresponds to the currently displayed slice. This might be different to the slice displayed in the viewer, depending on the up direction. More... | |
int | GetReferenceImageSliceUpDirection () |
Returns the "Up" direction which is the anterior, superior or right direction depending on which orientation you are interested in. More... | |
virtual mitk::DataNode * | CreateNewSegmentation () |
Creates from derived classes when the the user hits the "New segmentation", producing a dialog box, and on successful completion of the dialog box, will create a new segmentation image. More... | |
BaseSegmentorGUI * | GetSegmentorGUI () const |
Gets the segmentor widget that holds the GUI components of the view. More... | |
bool | HasInitialisedWorkingData () |
Utility method to check that we have initialised all the working data such as contours, region growing images etc. More... | |
virtual void | OnDataManagerSelectionChanged (const QList< mitk::DataNode::Pointer > &nodes) |
Called when the selection changes in the data manager. More... | |
Protected Member Functions inherited from niftk::BaseController | |
mitk::DataStorage * | GetDataStorage () const |
void | RequestRenderWindowUpdate () const |
QList< mitk::DataNode::Pointer > | GetDataManagerSelection () const |
mitk::SliceNavigationController * | GetSliceNavigationController () const |
virtual void | OnSelectedSliceChanged (niftk::ImageOrientation orientation, int sliceIndex) |
Called when the selected slice changes. This happens when selected window changes in the current editor (render window part) or when the focus is on a 2D render window in the current editor and the selected slice changes, either through interaction (e.g. by scrolling with the mouse wheel) or through an API call. More... | |
virtual BaseGUI * | CreateGUI (QWidget *parent)=0 |
Creates the widget that holds the GUI components of the view. This function is called from CreateQtPartControl. Derived classes should provide their implementation that returns an object whose class derives from niftk::BaseGUI. More... | |
BaseGUI * | GetGUI () const |
Gets the widget that holds the GUI components of the view. More... | |
IBaseView * | GetView () const |
Gets the segmentor BlueBerry view. More... | |
virtual void | OnFocusChanged () |
Called when the window focus changes, and tracks the current mitk::BaseRenderer*. More... | |
virtual mitk::BaseRenderer * | GetFocused2DRenderer () const |
Returns the currently focused renderer, as this class is tracking the focus changes. More... | |
virtual void | OnNodeAdded (const mitk::DataNode *node) |
Called when a data node is added to the data storage. Empty implementation. Derived classes can override it. More... | |
virtual void | OnNodeChanged (const mitk::DataNode *node) |
Called when a data node in the data storage has changed. Empty implementation. Derived classes can override it. More... | |
virtual void | OnNodeRemoved (const mitk::DataNode *node) |
Called when a data node has been removed from the data storage. Empty implementation. Derived classes can override it. More... | |
virtual void | OnNodeDeleted (const mitk::DataNode *node) |
Called when a data node has been deleted that has previously been in the data storage. Empty implementation. Derived classes can override it. More... | |
virtual void | OnNodeVisibilityChanged (const mitk::DataNode *node, const mitk::BaseRenderer *renderer) |
Called when the visibility of a data node in the data storage has changed. The renderer is nullptr if the global visibility has changed. Empty implementation. Derived classes can override it. More... | |
void | WaitCursorOn () |
Convenient method to set and reset a wait cursor ("hourglass") More... | |
void | WaitCursorOff () |
Convenient method to restore the standard cursor. More... | |
void | BusyCursorOn () |
Convenient method to set and reset a busy cursor. More... | |
void | BusyCursorOff () |
Convenient method to restore the standard cursor. More... | |
Friends | |
class | BaseSegmentorView |
niftk::BaseSegmentorController::BaseSegmentorController | ( | IBaseView * | view | ) |
|
virtual |
|
protectedvirtual |
Decorates a DataNode according to the user preference settings, or requirements for binary images.
|
protectedpure virtual |
Subclasses decide if they can restart the segmentation for a binary node.
Implemented in niftk::GeneralSegmentorController, and niftk::MorphologicalSegmentorController.
|
protectedvirtual |
Creates from derived classes when the the user hits the "New segmentation", producing a dialog box, and on successful completion of the dialog box, will create a new segmentation image.
NULL
if the user cancels the dialog box.
|
overridevirtual |
Returns true if the event should be filtered, i.e. not processed, otherwise false.
Reimplemented from niftk::StateMachineEventFilter.
|
overridevirtual |
Returns true if the event should be filtered, i.e. not processed, otherwise false.
Reimplemented from niftk::StateMachineEventFilter.
|
protected |
Gets the reference node that the segmentation node belongs to. Assumes that the reference (grey scale) node is always the direct parent of the segmentation (binary) node, so we simply search for a non binary parent.
const QColor & niftk::BaseSegmentorController::GetDefaultSegmentationColour | ( | ) | const |
Default colour to be displayed in the new segmentation dialog box.
|
protected |
Gets the reference image from the tool manager, or nullptr if this doesn't yet exist or is not an image. Assumes that a reference (grey scale) image is always registered with the tool manager.
|
protected |
Returns which image coordinate corresponds to the currently selected orientation. Retrieves the currently active QmitkRenderWindow, and the reference image registered with the ToolManager, and returns the Image axis that the current view is looking along, or -1 if it can not be worked out.
|
protected |
Returns which image coordinate corresponds to the given orientation. Looks up the ReferenceImage registered with ToolManager and returns the axis [0,1,2] that corresponds to the given orientation, or -1 if it can't be found.
|
protected |
Returns the slice index in the reference image that corresponds to the currently displayed slice. This might be different to the slice displayed in the viewer, depending on the up direction.
|
protected |
Returns the "Up" direction which is the anterior, superior or right direction depending on which orientation you are interested in.
|
protected |
Gets the reference node from the tool manager or nullptr if it can't be found.
|
protectedvirtual |
Assumes that a Working Node == a Segmentation Node, so simply returns the input node.
Reimplemented in niftk::MorphologicalSegmentorController.
|
protected |
Gets the segmentor widget that holds the GUI components of the view.
ToolType * niftk::BaseSegmentorController::GetToolByType | ( | ) |
mitk::ToolManager * niftk::BaseSegmentorController::GetToolManager | ( | ) | const |
Returns the segmentation tool manager used by the segmentor.
|
protected |
Gets a vector of the working data nodes registered with the tool manager. The data nodes normally hold image, but could be surfaces etc. Empty list is returned if this can't be found.
|
protectedvirtual |
Assumes that a Working Node == a Segmentation Node, so simply returns the input node.
Reimplemented in niftk::GeneralSegmentorController, and niftk::MorphologicalSegmentorController.
|
protected |
Gets a single binary image registered with the ToolManager. Returns nullptr if it can't be found or is not an image.
|
protected |
Utility method to check that we have initialised all the working data such as contours, region growing images etc.
|
protectedvirtual |
Returns true if node represent an image that is non binary, and false otherwise.
|
protectedvirtual |
Returns true if node represents an image that is binary, and false otherwise.
Reimplemented in niftk::GeneralSegmentorController, and niftk::MorphologicalSegmentorController.
|
protectedvirtual |
Returns true if node represents an image that is binary, and false otherwise.
Reimplemented in niftk::MorphologicalSegmentorController.
|
protectedvirtual |
Called from niftkToolSelectorWidget when a tool changes.
Note: The view is not created when the GUI is set up, therefore we cannot initialise this variable at another place.
Set the focus back to the main window. This is needed so that the keyboard shortcuts (like 'a' and 'z' for changing slice) keep on working.
|
protectedvirtual |
Called when the selection changes in the data manager.
It is not allowed to work on several segmentation at a time, simultaneously. If you are already working on a segmentation, you have to finalise it (OK) or discard it (Cancel) before you can start segmenting another image. (Or making another segmentation of the same image.)
Reimplemented in niftk::MorphologicalSegmentorController.
|
protectedpure virtualslot |
Called from niftkSegmentationSelectorWidget when the 'Start/restart segmentation' button is clicked.
|
overridevirtual |
Called when the BlueBerry view that hosts the GUI for this controller gets activated.
Reimplemented from niftk::BaseController.
void niftk::BaseSegmentorController::SetDefaultSegmentationColour | ( | const QColor & | defaultSegmentationColour | ) |
Default colour to be displayed in the new segmentation dialog box.
|
protected |
Makes sure the reference image is the selected one.
|
overridevirtual |
Sets up the GUI. This function has to be called from the CreateQtPartControl function of the view.
Reimplemented from niftk::BaseController.
Reimplemented in niftk::GeneralSegmentorController, and niftk::MorphologicalSegmentorController.
|
friend |