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

mitk::ContourSetToPointSetFilter Class Reference
[Process Classes]

Converts a contour set to a point set. More...

#include <mitkContourSetToPointSetFilter.h>

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

List of all members.

Public Types

typedef ContourSetToPointSetFilter Self
typedef PointSetSource Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
virtual void SetFrequency (unsigned int _arg)
virtual unsigned int GetFrequency ()
virtual void GenerateOutputInformation ()
virtual void GenerateData ()
const mitk::ContourSetGetInput (void)
virtual void SetInput (const mitk::ContourSet *contourSet)

Static Public Member Functions

static Pointer New ()

Protected Member Functions

 ContourSetToPointSetFilter ()
virtual ~ContourSetToPointSetFilter ()

Protected Attributes

unsigned int m_Frequency

Detailed Description

Converts a contour set to a point set.

The resulting pointset consists of sample points of all the contours

Definition at line 38 of file mitkContourSetToPointSetFilter.h.


Member Typedef Documentation

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

Definition at line 41 of file mitkContourSetToPointSetFilter.h.

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

Definition at line 41 of file mitkContourSetToPointSetFilter.h.

Definition at line 41 of file mitkContourSetToPointSetFilter.h.

Definition at line 41 of file mitkContourSetToPointSetFilter.h.


Constructor & Destructor Documentation

mitk::ContourSetToPointSetFilter::ContourSetToPointSetFilter (  ) [protected]

Definition at line 23 of file mitkContourSetToPointSetFilter.cpp.

References m_Frequency, mitk::PointSetSource::MakeOutput(), and mitk::BaseProcess::SetNthOutput().

{
  OutputType::Pointer output = dynamic_cast<OutputType*> ( this->MakeOutput( 0 ).GetPointer() );
  this->SetNumberOfRequiredInputs(1);
  this->SetNumberOfOutputs( 1 );
  this->SetNthOutput(0, output.GetPointer());
  m_Frequency = 5;
}
mitk::ContourSetToPointSetFilter::~ContourSetToPointSetFilter (  ) [protected, virtual]

Definition at line 32 of file mitkContourSetToPointSetFilter.cpp.

{
}

Member Function Documentation

void mitk::ContourSetToPointSetFilter::GenerateData (  ) [virtual]

Definition at line 41 of file mitkContourSetToPointSetFilter.cpp.

References mitk::Contour::GetContourPath(), mitk::ContourSet::GetContours(), mitk::OpDESELECTPOINT, and mitk::OpINSERT.

{
  mitk::ContourSet* input =  (mitk::ContourSet*) (this->GetInput());
  mitk::PointSet::Pointer output = this->GetOutput();

  mitk::ContourSet::ContourVectorType contourVec = input->GetContours();
  mitk::ContourSet::ContourIterator contourIt = contourVec.begin();
  unsigned int pointId = 0;

  while ( contourIt != contourVec.end() )
  {
    mitk::Contour* nextContour = (mitk::Contour*) (*contourIt).second;

    mitk::Contour::InputType idx = nextContour->GetContourPath()->StartOfInput();
    mitk::Contour::OutputType point;
    mitk::Contour::InputType end = nextContour->GetContourPath()->EndOfInput();
    if (end > 50000) end = 0;

    while ( idx <= end )
    {
      point = nextContour->GetContourPath()->Evaluate(idx);
      Contour::BoundingBoxType::PointType p;
      p.CastFrom(point);
      mitk::PointOperation popInsert( mitk::OpINSERT, p, pointId++ );
      mitk::PointOperation popDeactivate( mitk::OpDESELECTPOINT, p , pointId++ );
      output->ExecuteOperation( &popInsert );
      output->ExecuteOperation( &popDeactivate );

      idx+=m_Frequency;
    }
    contourIt++;
  }
}
void mitk::ContourSetToPointSetFilter::GenerateOutputInformation ( void   ) [virtual]

Definition at line 36 of file mitkContourSetToPointSetFilter.cpp.

{

}
virtual const char* mitk::ContourSetToPointSetFilter::GetClassName (  ) const [virtual]
virtual unsigned int mitk::ContourSetToPointSetFilter::GetFrequency (  ) [virtual]
const mitk::ContourSet * mitk::ContourSetToPointSetFilter::GetInput ( void   )

Definition at line 76 of file mitkContourSetToPointSetFilter.cpp.

{
  if (this->GetNumberOfInputs() < 1)
  {
    return 0;
  }

  return static_cast<const mitk::ContourSet * >
    ( this->BaseProcess::GetInput(0) );
}
static Pointer mitk::ContourSetToPointSetFilter::New (  ) [static]

Reimplemented from mitk::PointSetSource.

virtual void mitk::ContourSetToPointSetFilter::SetFrequency ( unsigned int  _arg ) [virtual]
void mitk::ContourSetToPointSetFilter::SetInput ( const mitk::ContourSet contourSet ) [virtual]

Definition at line 87 of file mitkContourSetToPointSetFilter.cpp.

{
  // Process object is not const-correct so the const_cast is required here
  this->BaseProcess::SetNthInput(0, 
    const_cast< mitk::ContourSet * >( input ) );
}

Member Data Documentation

Definition at line 63 of file mitkContourSetToPointSetFilter.h.

Referenced by ContourSetToPointSetFilter().


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