Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions

mitk::CreateSurfaceTool Class Reference
[Classes related to InteractiveSegmentation]

Creates surface models from segmentations. More...

#include <mitkCreateSurfaceTool.h>

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

List of all members.

Public Types

typedef CreateSurfaceTool Self
typedef SegmentationsProcessingTool Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
virtual const char ** GetXPM () const
 Returns an icon in the XPM format.
virtual const char * GetName () const
 Returns the name of this tool. Make it short!
void OnSurfaceCalculationDone ()

Static Public Member Functions

static Pointer New ()

Protected Member Functions

virtual bool ProcessOneWorkingData (DataNode *node)
 Subclasses should override this method.
virtual std::string GetErrorMessage ()
 Describes the error (if one occurred during processing).
 CreateSurfaceTool ()
virtual ~CreateSurfaceTool ()

Detailed Description

Creates surface models from segmentations.

See also:
mitk::Tool
QmitkInteractiveSegmentation

Last contributor: $Author$

Definition at line 36 of file mitkCreateSurfaceTool.h.


Member Typedef Documentation

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

Reimplemented from mitk::SegmentationsProcessingTool.

Definition at line 40 of file mitkCreateSurfaceTool.h.

typedef itk::SmartPointer<Self> mitk::CreateSurfaceTool::Pointer

Reimplemented from mitk::SegmentationsProcessingTool.

Definition at line 40 of file mitkCreateSurfaceTool.h.

Reimplemented from mitk::SegmentationsProcessingTool.

Definition at line 40 of file mitkCreateSurfaceTool.h.

Reimplemented from mitk::SegmentationsProcessingTool.

Definition at line 40 of file mitkCreateSurfaceTool.h.


Constructor & Destructor Documentation

mitk::CreateSurfaceTool::CreateSurfaceTool (  ) [protected]

Definition at line 33 of file mitkCreateSurfaceTool.cpp.

{
}
mitk::CreateSurfaceTool::~CreateSurfaceTool (  ) [protected, virtual]

Definition at line 37 of file mitkCreateSurfaceTool.cpp.

{
}

Member Function Documentation

virtual const char* mitk::CreateSurfaceTool::GetClassName (  ) const [virtual]

Reimplemented from mitk::SegmentationsProcessingTool.

std::string mitk::CreateSurfaceTool::GetErrorMessage (  ) [protected, virtual]

Describes the error (if one occurred during processing).

Reimplemented from mitk::SegmentationsProcessingTool.

Definition at line 51 of file mitkCreateSurfaceTool.cpp.

{
  return "No surfaces created for these segmentations:";
}
const char * mitk::CreateSurfaceTool::GetName (  ) const [virtual]

Returns the name of this tool. Make it short!

This name has to fit into some kind of button in most applications, so take some time to think of a good name!

Implements mitk::Tool.

Definition at line 46 of file mitkCreateSurfaceTool.cpp.

{
  return "Surface";
}
const char ** mitk::CreateSurfaceTool::GetXPM (  ) const [virtual]

Returns an icon in the XPM format.

This icon has to fit into some kind of button in most applications, so make it smaller than 25x25 pixels.

XPM is e.g. supported by The Gimp. But if you open any XPM file in your text editor, you will see that you could also "draw" it with an editor.

Implements mitk::Tool.

Definition at line 41 of file mitkCreateSurfaceTool.cpp.

{
  return mitkCreateSurfaceTool_xpm;
}
static Pointer mitk::CreateSurfaceTool::New (  ) [static]
void mitk::CreateSurfaceTool::OnSurfaceCalculationDone (  )

Definition at line 95 of file mitkCreateSurfaceTool.cpp.

References mitk::ProgressBar::GetInstance(), and mitk::ProgressBar::Progress().

Referenced by ProcessOneWorkingData().

{
  ProgressBar::GetInstance()->Progress();
  m_ToolManager->NewNodesGenerated();
}
bool mitk::CreateSurfaceTool::ProcessOneWorkingData ( DataNode node ) [protected, virtual]

Subclasses should override this method.

See also:
ProcessAllObjects

Reimplemented from mitk::SegmentationsProcessingTool.

Definition at line 56 of file mitkCreateSurfaceTool.cpp.

References mitk::ProgressBar::AddStepsToDo(), mitk::StatusBar::DisplayText(), mitk::DataNode::GetData(), mitk::StatusBar::GetInstance(), mitk::ProgressBar::GetInstance(), mitk::ShowSegmentationAsSurface::New(), and OnSurfaceCalculationDone().

{
  if (node)
  {
    Image::Pointer image = dynamic_cast<Image*>( node->GetData() );
    if (image.IsNull()) return false;
      
    try
    {
      mitk::ShowSegmentationAsSurface::Pointer surfaceFilter = mitk::ShowSegmentationAsSurface::New();

      // attach observer to get notified about result
      itk::SimpleMemberCommand<CreateSurfaceTool>::Pointer goodCommand = itk::SimpleMemberCommand<CreateSurfaceTool>::New();
      goodCommand->SetCallbackFunction(this, &CreateSurfaceTool::OnSurfaceCalculationDone);
      surfaceFilter->AddObserver(mitk::ResultAvailable(), goodCommand);
      itk::SimpleMemberCommand<CreateSurfaceTool>::Pointer badCommand = itk::SimpleMemberCommand<CreateSurfaceTool>::New();
      badCommand->SetCallbackFunction(this, &CreateSurfaceTool::OnSurfaceCalculationDone);
      surfaceFilter->AddObserver(mitk::ProcessingError(), badCommand);

      DataNode::Pointer nodepointer = node;
      surfaceFilter->SetPointerParameter("Input", image);
      surfaceFilter->SetPointerParameter("Group node", nodepointer);
      surfaceFilter->SetParameter("Show result", true );
      surfaceFilter->SetParameter("Sync visibility", false );
      surfaceFilter->SetDataStorage( *m_ToolManager->GetDataStorage() );
      
      ProgressBar::GetInstance()->AddStepsToDo(1);
      StatusBar::GetInstance()->DisplayText("Surface creation started in background...");
      surfaceFilter->StartAlgorithm();
    }
    catch(...)
    {
      return false;
    }
  }

  return true;
}

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