Batch processing of all selected segmentations/data. More...
#include <mitkSegmentationsProcessingTool.h>
Public Types | |
typedef SegmentationsProcessingTool | Self |
typedef Tool | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer < const Self > | ConstPointer |
Public Member Functions | |
virtual const char * | GetClassName () const |
Protected Member Functions | |
SegmentationsProcessingTool () | |
virtual | ~SegmentationsProcessingTool () |
virtual const char * | GetGroup () const |
Name of a group. | |
virtual void | Activated () |
Called when the tool gets activated. | |
virtual void | Deactivated () |
Called when the tool gets deactivated (unregistered from mitk::GlobalInteraction). | |
virtual void | ProcessAllObjects () |
Loop over all working data items. | |
virtual void | StartProcessingAllData () |
Subclasses should override this method. | |
virtual bool | ProcessOneWorkingData (DataNode *node) |
Subclasses should override this method. | |
virtual void | FinishProcessingAllData () |
Subclasses should override this method. | |
virtual void | SendErrorMessageIfAny () |
Sends an error message if there was an error during processing. | |
virtual std::string | GetErrorMessage () |
Describes the error (if one occurred during processing). | |
Protected Attributes | |
std::string | m_FailedNodes |
Batch processing of all selected segmentations/data.
This class is undocumented. Ask the creator ($Author$) to supply useful comments.
Definition at line 34 of file mitkSegmentationsProcessingTool.h.
typedef itk::SmartPointer<const Self> mitk::SegmentationsProcessingTool::ConstPointer |
Reimplemented from mitk::Tool.
Reimplemented in mitk::AutoCropTool, mitk::CalculateGrayValueStatisticsTool, mitk::CalculateVolumetryTool, and mitk::CreateSurfaceTool.
Definition at line 38 of file mitkSegmentationsProcessingTool.h.
typedef itk::SmartPointer<Self> mitk::SegmentationsProcessingTool::Pointer |
Reimplemented from mitk::Tool.
Reimplemented in mitk::AutoCropTool, mitk::CalculateGrayValueStatisticsTool, mitk::CalculateVolumetryTool, and mitk::CreateSurfaceTool.
Definition at line 38 of file mitkSegmentationsProcessingTool.h.
Reimplemented from mitk::Tool.
Reimplemented in mitk::AutoCropTool, mitk::CalculateGrayValueStatisticsTool, mitk::CalculateVolumetryTool, and mitk::CreateSurfaceTool.
Definition at line 38 of file mitkSegmentationsProcessingTool.h.
Reimplemented from mitk::Tool.
Reimplemented in mitk::AutoCropTool, mitk::CalculateGrayValueStatisticsTool, mitk::CalculateVolumetryTool, and mitk::CreateSurfaceTool.
Definition at line 38 of file mitkSegmentationsProcessingTool.h.
mitk::SegmentationsProcessingTool::SegmentationsProcessingTool | ( | ) | [protected] |
Definition at line 22 of file mitkSegmentationsProcessingTool.cpp.
:Tool("dummy") { }
mitk::SegmentationsProcessingTool::~SegmentationsProcessingTool | ( | ) | [protected, virtual] |
Definition at line 27 of file mitkSegmentationsProcessingTool.cpp.
{ }
void mitk::SegmentationsProcessingTool::Activated | ( | ) | [protected, virtual] |
Called when the tool gets activated.
Will just call ProcessAllObjects and then deactivate this tool again.
Reimplemented from mitk::Tool.
Definition at line 36 of file mitkSegmentationsProcessingTool.cpp.
{ ProcessAllObjects(); m_ToolManager->ActivateTool(-1); }
void mitk::SegmentationsProcessingTool::Deactivated | ( | ) | [protected, virtual] |
Called when the tool gets deactivated (unregistered from mitk::GlobalInteraction).
Derived tools should call their parents implementation.
Reimplemented from mitk::Tool.
Definition at line 42 of file mitkSegmentationsProcessingTool.cpp.
{ }
void mitk::SegmentationsProcessingTool::FinishProcessingAllData | ( | ) | [protected, virtual] |
Subclasses should override this method.
Reimplemented in mitk::CalculateGrayValueStatisticsTool, and mitk::CalculateVolumetryTool.
Definition at line 93 of file mitkSegmentationsProcessingTool.cpp.
Referenced by mitk::CalculateGrayValueStatisticsTool::FinishProcessingAllData().
{ SendErrorMessageIfAny(); }
virtual const char* mitk::SegmentationsProcessingTool::GetClassName | ( | ) | const [virtual] |
Reimplemented from mitk::Tool.
Reimplemented in mitk::AutoCropTool, mitk::CalculateGrayValueStatisticsTool, mitk::CalculateVolumetryTool, and mitk::CreateSurfaceTool.
std::string mitk::SegmentationsProcessingTool::GetErrorMessage | ( | ) | [protected, virtual] |
Describes the error (if one occurred during processing).
Reimplemented in mitk::AutoCropTool, mitk::CalculateGrayValueStatisticsTool, mitk::CalculateVolumetryTool, and mitk::CreateSurfaceTool.
Definition at line 106 of file mitkSegmentationsProcessingTool.cpp.
{ return "Processing of these nodes failed:"; }
const char * mitk::SegmentationsProcessingTool::GetGroup | ( | ) | const [protected, virtual] |
Name of a group.
You can group several tools by assigning a group name. Graphical tool selectors might use this information to group tools. (What other reason could there be?)
Reimplemented from mitk::Tool.
Definition at line 31 of file mitkSegmentationsProcessingTool.cpp.
{ return "segmentationProcessing"; }
void mitk::SegmentationsProcessingTool::ProcessAllObjects | ( | ) | [protected, virtual] |
Loop over all working data items.
Will call the following methods in turn
Subclasses should override these methods as needed and provide meaningful implementations.
Definition at line 46 of file mitkSegmentationsProcessingTool.cpp.
References mitk::ProgressBar::AddStepsToDo(), mitk::ProgressBar::GetInstance(), and mitk::ProgressBar::Progress().
{ m_FailedNodes.clear(); StartProcessingAllData(); ToolManager::DataVectorType nodes = m_ToolManager->GetWorkingData(); ProgressBar::GetInstance()->AddStepsToDo(nodes.size() + 2); // for all selected nodes for ( ToolManager::DataVectorType::iterator nodeiter = nodes.begin(); nodeiter != nodes.end(); ++nodeiter ) { DataNode::Pointer node = *nodeiter; if ( !ProcessOneWorkingData(node) ) { std::string nodeName; m_FailedNodes += " '"; if ( node->GetName( nodeName ) ) { m_FailedNodes += nodeName.c_str(); } else { m_FailedNodes += "(no name)"; } m_FailedNodes += "'"; } ProgressBar::GetInstance()->Progress(); } FinishProcessingAllData(); ProgressBar::GetInstance()->Progress(2); }
bool mitk::SegmentationsProcessingTool::ProcessOneWorkingData | ( | DataNode * | node ) | [protected, virtual] |
Subclasses should override this method.
Reimplemented in mitk::AutoCropTool, mitk::CalculateGrayValueStatisticsTool, mitk::CalculateVolumetryTool, and mitk::CreateSurfaceTool.
Definition at line 88 of file mitkSegmentationsProcessingTool.cpp.
{ return true; }
void mitk::SegmentationsProcessingTool::SendErrorMessageIfAny | ( | ) | [protected, virtual] |
Sends an error message if there was an error during processing.
Definition at line 98 of file mitkSegmentationsProcessingTool.cpp.
References mitk::Tool::ErrorMessage.
{ if ( !m_FailedNodes.empty() ) { Tool::ErrorMessage( GetErrorMessage() + m_FailedNodes ); } }
void mitk::SegmentationsProcessingTool::StartProcessingAllData | ( | ) | [protected, virtual] |
Subclasses should override this method.
Reimplemented in mitk::CalculateGrayValueStatisticsTool.
Definition at line 84 of file mitkSegmentationsProcessingTool.cpp.
{ }
std::string mitk::SegmentationsProcessingTool::m_FailedNodes [protected] |
Definition at line 96 of file mitkSegmentationsProcessingTool.h.