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

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

Calculates the segmented volumes for binary images. More...

#include <mitkCalculateVolumetryTool.h>

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

List of all members.

Public Types

typedef CalculateVolumetryTool 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!

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).
virtual void FinishProcessingAllData ()
 Subclasses should override this method.
 CalculateVolumetryTool ()
virtual ~CalculateVolumetryTool ()

Detailed Description

Calculates the segmented volumes for binary images.

See also:
mitk::Tool
QmitkInteractiveSegmentation

Last contributor: $Author$

Definition at line 37 of file mitkCalculateVolumetryTool.h.


Member Typedef Documentation

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

Reimplemented from mitk::SegmentationsProcessingTool.

Definition at line 41 of file mitkCalculateVolumetryTool.h.

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

Reimplemented from mitk::SegmentationsProcessingTool.

Definition at line 41 of file mitkCalculateVolumetryTool.h.

Reimplemented from mitk::SegmentationsProcessingTool.

Definition at line 41 of file mitkCalculateVolumetryTool.h.

Reimplemented from mitk::SegmentationsProcessingTool.

Definition at line 41 of file mitkCalculateVolumetryTool.h.


Constructor & Destructor Documentation

mitk::CalculateVolumetryTool::CalculateVolumetryTool (  ) [protected]

Definition at line 30 of file mitkCalculateVolumetryTool.cpp.

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

Definition at line 34 of file mitkCalculateVolumetryTool.cpp.

{
}

Member Function Documentation

void mitk::CalculateVolumetryTool::FinishProcessingAllData (  ) [protected, virtual]

Subclasses should override this method.

See also:
ProcessAllObjects

Reimplemented from mitk::SegmentationsProcessingTool.

Definition at line 85 of file mitkCalculateVolumetryTool.cpp.

{
  Superclass::FinishProcessingAllData();
  m_ToolManager->NodePropertiesChanged();
}
virtual const char* mitk::CalculateVolumetryTool::GetClassName (  ) const [virtual]

Reimplemented from mitk::SegmentationsProcessingTool.

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

Describes the error (if one occurred during processing).

Reimplemented from mitk::SegmentationsProcessingTool.

Definition at line 48 of file mitkCalculateVolumetryTool.cpp.

{
  return "Volume could not be calculated for these nodes:";
}
const char * mitk::CalculateVolumetryTool::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 43 of file mitkCalculateVolumetryTool.cpp.

{
  return "Volumetry";
}
const char ** mitk::CalculateVolumetryTool::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 38 of file mitkCalculateVolumetryTool.cpp.

{
  return mitkCalculateVolumetryTool_xpm;
}
static Pointer mitk::CalculateVolumetryTool::New (  ) [static]
bool mitk::CalculateVolumetryTool::ProcessOneWorkingData ( DataNode node ) [protected, virtual]

Subclasses should override this method.

See also:
ProcessAllObjects

Reimplemented from mitk::SegmentationsProcessingTool.

Definition at line 53 of file mitkCalculateVolumetryTool.cpp.

References mitk::Tool::ErrorMessage, mitk::DataNode::GetData(), mitk::FloatProperty::New(), mitk::VolumeCalculator::New(), and mitk::DataNode::SetProperty().

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

    if (image->GetDimension() == 4)
    {
      Tool::ErrorMessage("Volumetry only valid for timestep 0! Bug #1280");
    }

    VolumeCalculator::Pointer volumetryFilter = VolumeCalculator::New();
    volumetryFilter->SetImage( image );
    volumetryFilter->SetThreshold( 1 ); // comparison is >=
    try
    {
      volumetryFilter->ComputeVolume();

      float volumeInTimeStep0 = volumetryFilter->GetVolume();

      node->SetProperty( "volume", FloatProperty::New(volumeInTimeStep0) );
    }
    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