Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

mitk::SegmentationsProcessingTool Class Reference

Batch processing of all selected segmentations/data. More...

#include <mitkSegmentationsProcessingTool.h>

Inheritance diagram for mitk::SegmentationsProcessingTool:
Inheritance graph
[legend]
Collaboration diagram for mitk::SegmentationsProcessingTool:
Collaboration graph
[legend]

List of all members.

Public Types

typedef SegmentationsProcessingTool Self
typedef Tool Superclass
typedef itk::SmartPointer< SelfPointer
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

Detailed Description

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.


Member Typedef Documentation

typedef itk::SmartPointer<const Self> mitk::SegmentationsProcessingTool::ConstPointer

Constructor & Destructor Documentation

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.

{
}

Member Function Documentation

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]
virtual const char* mitk::SegmentationsProcessingTool::GetClassName (  ) const [virtual]
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.

See also:
ProcessAllObjects

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.

void mitk::SegmentationsProcessingTool::StartProcessingAllData (  ) [protected, virtual]

Subclasses should override this method.

See also:
ProcessAllObjects

Reimplemented in mitk::CalculateGrayValueStatisticsTool.

Definition at line 84 of file mitkSegmentationsProcessingTool.cpp.

{
}

Member Data Documentation

Definition at line 96 of file mitkSegmentationsProcessingTool.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines