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

mitk::PointSetToCurvedGeometryFilter Class Reference

#include <mitkPointSetToCurvedGeometryFilter.h>

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

List of all members.

Public Types

enum  ProjectionMode {
  Sphere, XYPlane, XZPlane, YZPlane,
  PCAPlane
}
typedef
PointSetToCurvedGeometryFilter 
Self
typedef
PointSetToGeometryDataFilter 
Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
virtual void SetProjectionMode (ProjectionMode _arg)
virtual ProjectionMode GetProjectionMode ()
virtual void SetImageToBeMapped (mitk::Image *_arg)
virtual mitk::ImageGetImageToBeMapped ()
virtual void SetSigma (float _arg)
virtual float GetSigma ()

Static Public Member Functions

static Pointer New ()
static void SetDefaultCurvedGeometryProperties (mitk::DataNode *node)

Protected Member Functions

 PointSetToCurvedGeometryFilter ()
virtual ~PointSetToCurvedGeometryFilter ()
virtual void GenerateOutputInformation ()
virtual void GenerateData ()
virtual
GeometryDataSource::DataObjectPointer 
MakeOutput (unsigned int idx)

Protected Attributes

ProjectionMode m_ProjectionMode
mitk::PlaneGeometry::Pointer m_XYPlane
mitk::PlaneGeometry::Pointer m_XZPlane
mitk::PlaneGeometry::Pointer m_YZPlane
mitk::PlaneFit::Pointer m_PCAPlaneCalculator
mitk::Image::Pointer m_ImageToBeMapped
mitk::PlaneLandmarkProjector::Pointer m_PlaneLandmarkProjector
mitk::SphereLandmarkProjector::Pointer m_SphereLandmarkProjector
float m_Sigma

Detailed Description

Definition at line 33 of file mitkPointSetToCurvedGeometryFilter.h.


Member Typedef Documentation

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

Reimplemented from mitk::PointSetToGeometryDataFilter.

Definition at line 39 of file mitkPointSetToCurvedGeometryFilter.h.

Reimplemented from mitk::PointSetToGeometryDataFilter.

Definition at line 39 of file mitkPointSetToCurvedGeometryFilter.h.

Standard mitk class macro

Reimplemented from mitk::PointSetToGeometryDataFilter.

Definition at line 39 of file mitkPointSetToCurvedGeometryFilter.h.

Reimplemented from mitk::PointSetToGeometryDataFilter.

Definition at line 39 of file mitkPointSetToCurvedGeometryFilter.h.


Member Enumeration Documentation

Defines the geometry, onto which the input landmarks are projected. Currently, Plane and Sphere are supported, whilest plane is differentiated into 4 different planes, the xy, xz, and yz plane, as well a plane which is calculated by a principal component analysis of the input point set.

Enumerator:
Sphere 
XYPlane 
XZPlane 
YZPlane 
PCAPlane 

Definition at line 50 of file mitkPointSetToCurvedGeometryFilter.h.


Constructor & Destructor Documentation

mitk::PointSetToCurvedGeometryFilter::PointSetToCurvedGeometryFilter (  ) [protected]

Protected constructor. Use New instead()

Definition at line 30 of file mitkPointSetToCurvedGeometryFilter.cpp.

References m_ImageToBeMapped, m_PCAPlaneCalculator, m_ProjectionMode, m_Sigma, MakeOutput(), New(), mitk::BaseProcess::SetNthOutput(), and YZPlane.

{
  m_ProjectionMode = YZPlane;
  m_PCAPlaneCalculator = mitk::PlaneFit::New();
  m_ImageToBeMapped = NULL;
  m_Sigma = 1000;
  mitk::Geometry2DData::Pointer output = static_cast<mitk::Geometry2DData*> ( this->MakeOutput ( 0 ).GetPointer() );
  output->Initialize();
  Superclass::SetNumberOfRequiredOutputs ( 1 );
  Superclass::SetNthOutput ( 0, output.GetPointer() );
}
mitk::PointSetToCurvedGeometryFilter::~PointSetToCurvedGeometryFilter (  ) [protected, virtual]

Protected destructor. Instances are destroyed when reference count is zero

Definition at line 44 of file mitkPointSetToCurvedGeometryFilter.cpp.

{}

Member Function Documentation

void mitk::PointSetToCurvedGeometryFilter::GenerateData (  ) [protected, virtual]

Definition at line 91 of file mitkPointSetToCurvedGeometryFilter.cpp.

References mitk::PlaneGeometry::Frontal, mitk::SphereLandmarkProjector::New(), mitk::PlaneLandmarkProjector::New(), mitk::PlaneGeometry::New(), mitk::PlaneGeometry::Sagittal, and mitk::PlaneGeometry::Transversal.

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

  //
  // check preconditions
  //
  if ( input.IsNull() )
    itkGenericExceptionMacro ( "Input point set is NULL!" );
  if ( output.IsNull() )
    itkGenericExceptionMacro ( "output geometry data is NULL!" );
  if ( output->GetTimeSlicedGeometry() == NULL )
    itkGenericExceptionMacro ( "Output time sliced geometry is NULL!" );
  if ( output->GetTimeSlicedGeometry()->GetGeometry3D ( 0 ) == NULL )
    itkGenericExceptionMacro ( "Output geometry3d is NULL!" );
  mitk::ThinPlateSplineCurvedGeometry::Pointer curvedGeometry = dynamic_cast<mitk::ThinPlateSplineCurvedGeometry*> ( output->GetTimeSlicedGeometry()->GetGeometry3D ( 0 ) );
  if ( curvedGeometry.IsNull() )
    itkGenericExceptionMacro ( "Output geometry3d is not an instance of mitk::ThinPlateSPlineCurvedGeometry!" );
  if ( m_ImageToBeMapped.IsNull() )
    itkGenericExceptionMacro ( "Image to be mapped is NULL!" );

  //
  // initialize members if needed
  //
  if ( m_XYPlane.IsNull()  ||  m_XZPlane.IsNull() || m_YZPlane.IsNull() )
  {
    m_ImageToBeMapped->UpdateOutputInformation();
    const mitk::Geometry3D* imageGeometry = m_ImageToBeMapped->GetUpdatedGeometry();
    imageGeometry = m_ImageToBeMapped->GetUpdatedGeometry();
    m_XYPlane = mitk::PlaneGeometry::New();
    m_XZPlane = mitk::PlaneGeometry::New();
    m_YZPlane = mitk::PlaneGeometry::New();
    m_XYPlane->InitializeStandardPlane ( imageGeometry, mitk::PlaneGeometry::Transversal );
    m_YZPlane->InitializeStandardPlane ( imageGeometry, mitk::PlaneGeometry::Sagittal );
    m_XZPlane->InitializeStandardPlane ( imageGeometry, mitk::PlaneGeometry::Frontal );
  }
  if ( m_PlaneLandmarkProjector.IsNull() )
  {
    m_PlaneLandmarkProjector = mitk::PlaneLandmarkProjector::New();
    m_SphereLandmarkProjector = mitk::SphereLandmarkProjector::New();
  }

  //
  // set up geometry according to the current settings
  //
  if ( m_ProjectionMode == Sphere )
  {
    curvedGeometry->SetLandmarkProjector ( m_SphereLandmarkProjector );
  }
  else
  {
    if ( m_ProjectionMode == XYPlane )
      m_PlaneLandmarkProjector->SetProjectionPlane ( m_XYPlane );
    else if ( m_ProjectionMode == XZPlane )
      m_PlaneLandmarkProjector->SetProjectionPlane ( m_XZPlane );
    else if ( m_ProjectionMode == YZPlane )
      m_PlaneLandmarkProjector->SetProjectionPlane ( m_YZPlane );
    else if ( m_ProjectionMode == PCAPlane )
    {
      itkExceptionMacro ( "PCAPlane not yet implemented!" );
      m_PCAPlaneCalculator->SetInput ( input );
      m_PCAPlaneCalculator->Update();
      m_PlaneLandmarkProjector->SetProjectionPlane ( dynamic_cast<mitk::PlaneGeometry*> ( m_PCAPlaneCalculator->GetOutput() ) );
    }
    else
      itkExceptionMacro ( "Unknown projection mode" );

    curvedGeometry->SetLandmarkProjector ( m_PlaneLandmarkProjector );
  }
  //curvedGeometry->SetReferenceGeometry( m_ImageToBeMapped->GetGeometry() );
  curvedGeometry->SetTargetLandmarks ( input->GetPointSet ( 0 )->GetPoints() );
  curvedGeometry->SetSigma ( m_Sigma );
  curvedGeometry->ComputeGeometry();
  curvedGeometry->SetOversampling ( 1.0 );

}
void mitk::PointSetToCurvedGeometryFilter::GenerateOutputInformation ( void   ) [protected, virtual]

Definition at line 47 of file mitkPointSetToCurvedGeometryFilter.cpp.

References mitk::ThinPlateSplineCurvedGeometry::New().

{
  mitk::PointSet::ConstPointer input  = this->GetInput();
  mitk::Geometry2DData::Pointer output  = dynamic_cast<mitk::Geometry2DData*> ( this->GetOutput() );

  if ( input.IsNull() )
    itkGenericExceptionMacro ( "Input point set is NULL!" );

  if ( input->GetTimeSlicedGeometry()->GetTimeSteps() != 1 )
    itkWarningMacro ( "More than one time step is not yet supported!" );

  if ( output.IsNull() )
    itkGenericExceptionMacro ( "Output is NULL!" );
  
  if ( m_ImageToBeMapped.IsNull() )
    itkGenericExceptionMacro ( "Image to be mapped is NULL!" );

  bool update = false;
  if ( output->GetGeometry() == NULL || output->GetGeometry2D() == NULL || output->GetTimeSlicedGeometry() == NULL )
    update = true;
  if ( ( ! update ) && ( output->GetTimeSlicedGeometry()->GetTimeSteps() != input->GetTimeSlicedGeometry()->GetTimeSteps() ) )
    update = true;
  if ( update )
  {
    mitk::ThinPlateSplineCurvedGeometry::Pointer curvedGeometry = mitk::ThinPlateSplineCurvedGeometry::New();
    output->SetGeometry(curvedGeometry);
    
    /*
    mitk::TimeSlicedGeometry::Pointer timeGeometry = mitk::TimeSlicedGeometry::New();
    mitk::ThinPlateSplineCurvedGeometry::Pointer curvedGeometry = mitk::ThinPlateSplineCurvedGeometry::New();

    timeGeometry->InitializeEvenlyTimed ( curvedGeometry, input->GetPointSetSeriesSize() );

    for ( unsigned int t = 1; t < input->GetPointSetSeriesSize(); ++t )
    {
      mitk::ThinPlateSplineCurvedGeometry::Pointer tmpCurvedGeometry = mitk::ThinPlateSplineCurvedGeometry::New();
      timeGeometry->SetGeometry3D ( tmpCurvedGeometry.GetPointer(), t );
    }
    output->SetGeometry ( timeGeometry );
    output->SetGeometry2D ( curvedGeometry ); // @FIXME SetGeometry2D of mitk::Geometry2DData reinitializes the TimeSlicedGeometry to 1 time step
    */
  }
}
virtual const char* mitk::PointSetToCurvedGeometryFilter::GetClassName (  ) const [virtual]
virtual mitk::Image* mitk::PointSetToCurvedGeometryFilter::GetImageToBeMapped (  ) [virtual]
virtual ProjectionMode mitk::PointSetToCurvedGeometryFilter::GetProjectionMode (  ) [virtual]

Sets / Gets whether the input land marks are projected onto a plane or sphere

virtual float mitk::PointSetToCurvedGeometryFilter::GetSigma (  ) [virtual]
mitk::GeometryDataSource::DataObjectPointer mitk::PointSetToCurvedGeometryFilter::MakeOutput ( unsigned int  idx ) [protected, virtual]

Reimplemented from mitk::GeometryDataSource.

Definition at line 169 of file mitkPointSetToCurvedGeometryFilter.cpp.

References mitk::Geometry2DData::New().

Referenced by PointSetToCurvedGeometryFilter().

{
  return static_cast<itk::DataObject*> ( mitk::Geometry2DData::New().GetPointer() );
}
static Pointer mitk::PointSetToCurvedGeometryFilter::New (  ) [static]
void mitk::PointSetToCurvedGeometryFilter::SetDefaultCurvedGeometryProperties ( mitk::DataNode node ) [static]

Fills a data tree node with appropriate properties for mapping the output geometry surface

Definition at line 175 of file mitkPointSetToCurvedGeometryFilter.cpp.

References mitk::BoolProperty::New(), mitk::StringProperty::New(), mitk::DataNode::SetIntProperty(), and mitk::DataNode::SetProperty().

{
  if ( node == NULL )
  {
    itkGenericOutputMacro ( "Warning: node is NULL!" );
    return;
  }
  node->SetIntProperty ( "xresolution", 50 );
  node->SetIntProperty ( "yresolution", 50 );
  node->SetProperty ( "name", mitk::StringProperty::New ( "Curved Plane" ) );
  // exclude extent of this plane when calculating DataStorage bounding box
  node->SetProperty ( "includeInBoundingBox", mitk::BoolProperty::New ( false ) );
}
virtual void mitk::PointSetToCurvedGeometryFilter::SetImageToBeMapped ( mitk::Image _arg ) [virtual]
virtual void mitk::PointSetToCurvedGeometryFilter::SetProjectionMode ( ProjectionMode  _arg ) [virtual]

Sets / Gets whether the input land marks are projected onto a plane or sphere

virtual void mitk::PointSetToCurvedGeometryFilter::SetSigma ( float  _arg ) [virtual]

Member Data Documentation

Definition at line 106 of file mitkPointSetToCurvedGeometryFilter.h.

Definition at line 94 of file mitkPointSetToCurvedGeometryFilter.h.

Referenced by PointSetToCurvedGeometryFilter().

Definition at line 108 of file mitkPointSetToCurvedGeometryFilter.h.

Definition at line 96 of file mitkPointSetToCurvedGeometryFilter.h.

Definition at line 98 of file mitkPointSetToCurvedGeometryFilter.h.

Definition at line 100 of file mitkPointSetToCurvedGeometryFilter.h.


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