Public Types | Public Member Functions | Protected Member Functions

mitk::NavigationDataSource Class Reference

Navigation Data source. More...

#include <mitkNavigationDataSource.h>

Inheritance diagram for mitk::NavigationDataSource:
Inheritance graph
[legend]

List of all members.

Public Types

typedef NavigationDataSource Self
typedef itk::ProcessObject Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
NavigationDataGetOutput (void)
 return the output (output with id 0) of the filter
NavigationDataGetOutput (unsigned int idx)
 return the output with id idx of the filter
NavigationDataGetOutput (std::string navDataName)
 return the output with name navDataName of the filter
DataObjectPointerArraySizeType GetOutputIndex (std::string navDataName)
 return the index of the output with name navDataName, -1 if no output with that name was found
virtual void GraftNthOutput (unsigned int idx, itk::DataObject *graft)
 Graft the specified DataObject onto this ProcessObject's output.
virtual void GraftOutput (itk::DataObject *graft)
 Graft the specified DataObject onto this ProcessObject's output.
virtual DataObjectPointer MakeOutput (unsigned int idx)
 Make a DataObject of the correct type to used as the specified output.
virtual void SetParameters (const mitk::PropertyList *)
 Set all filter parameters as the PropertyList p.
virtual
mitk::PropertyList::ConstPointer 
GetParameters () const
 Get all filter parameters as a PropertyList.

Protected Member Functions

 NavigationDataSource ()
virtual ~NavigationDataSource ()

Detailed Description

Navigation Data source.

Documentation Base class for all navigation filters that produce NavigationData objects as output. This class defines the output-interface for NavigationDataFilters.

Warning:
: if Update() is called on any output object, all NavigationData filters will generate new output data for all outputs, not just the one on which Update() was called.

Definition at line 38 of file mitkNavigationDataSource.h.


Member Typedef Documentation

typedef itk::SmartPointer<const Self> mitk::NavigationDataSource::ConstPointer
typedef itk::SmartPointer<Self> mitk::NavigationDataSource::Pointer
typedef itk::ProcessObject mitk::NavigationDataSource::Superclass

Constructor & Destructor Documentation

mitk::NavigationDataSource::NavigationDataSource (  ) [protected]

Definition at line 22 of file mitkNavigationDataSource.cpp.

: itk::ProcessObject()
{
}
mitk::NavigationDataSource::~NavigationDataSource (  ) [protected, virtual]

Definition at line 28 of file mitkNavigationDataSource.cpp.

{
}

Member Function Documentation

virtual const char* mitk::NavigationDataSource::GetClassName (  ) const [virtual]
mitk::NavigationData * mitk::NavigationDataSource::GetOutput ( void   )

return the output (output with id 0) of the filter

Definition at line 33 of file mitkNavigationDataSource.cpp.

{
  if (this->GetNumberOfOutputs() < 1)
    return NULL;

  return static_cast<NavigationData*>(this->ProcessObject::GetOutput(0));
}
mitk::NavigationData * mitk::NavigationDataSource::GetOutput ( std::string  navDataName )

return the output with name navDataName of the filter

Definition at line 50 of file mitkNavigationDataSource.cpp.

{
  DataObjectPointerArray& outputs = this->GetOutputs();
  for (DataObjectPointerArray::iterator it = outputs.begin(); it != outputs.end(); ++it)
    if (navDataName == (static_cast<NavigationData*>(it->GetPointer()))->GetName())
      return static_cast<NavigationData*>(it->GetPointer());
  return NULL;
}
mitk::NavigationData * mitk::NavigationDataSource::GetOutput ( unsigned int  idx )

return the output with id idx of the filter

Definition at line 42 of file mitkNavigationDataSource.cpp.

{
  if (this->GetNumberOfOutputs() < 1)
    return NULL;
  return static_cast<NavigationData*>(this->ProcessObject::GetOutput(idx));
}
itk::ProcessObject::DataObjectPointerArraySizeType mitk::NavigationDataSource::GetOutputIndex ( std::string  navDataName )

return the index of the output with name navDataName, -1 if no output with that name was found

Warning:
if a subclass has outputs that have different data type than mitk::NavigationData, they have to overwrite this method

Definition at line 59 of file mitkNavigationDataSource.cpp.

{
  DataObjectPointerArray& outputs = this->GetOutputs();
  for (DataObjectPointerArray::size_type i = 0; i < outputs.size(); ++i)
    if (navDataName == (static_cast<NavigationData*>(outputs.at(i).GetPointer()))->GetName())
      return i;
  throw std::invalid_argument("output name does not exist");
}
mitk::PropertyList::ConstPointer mitk::NavigationDataSource::GetParameters (  ) const [virtual]

Get all filter parameters as a PropertyList.

This method allows to get all parameters of a filter with one method call. The returned PropertyList must be assigned to a SmartPointer immediately, or else it will get destroyed. Every filter must overwrite this method to create a filter-specific PropertyList. Note that property names must be unique over all MITK-IGT filters. Therefore each filter should use its name as a prefix for each property name. Secondly, each filter should list the property names and data types in the method documentation.

Reimplemented in mitk::CameraVisualization, and mitk::NavigationDataDisplacementFilter.

Definition at line 104 of file mitkNavigationDataSource.cpp.

References mitk::PropertyList::New().

{
  mitk::PropertyList::Pointer p = mitk::PropertyList::New();
  // add properties to p like this:
  //p->SetProperty("MyFilter_MyParameter", mitk::PropertyDataType::New(m_MyParameter));
  return mitk::PropertyList::ConstPointer(p);
}
void mitk::NavigationDataSource::GraftNthOutput ( unsigned int  idx,
itk::DataObject *  graft 
) [virtual]

Graft the specified DataObject onto this ProcessObject's output.

See itk::ImageSource::GraftNthOutput for details

Definition at line 74 of file mitkNavigationDataSource.cpp.

{
  if ( idx >= this->GetNumberOfOutputs() )
  {
    itkExceptionMacro(<<"Requested to graft output " << idx << 
      " but this filter only has " << this->GetNumberOfOutputs() << " Outputs.");
  }  

  if ( !graft )
  {
    itkExceptionMacro(<<"Requested to graft output with a NULL pointer object" );
  }

  itk::DataObject* output = this->GetOutput(idx);
  if ( !output )
  {
    itkExceptionMacro(<<"Requested to graft output that is a NULL pointer" );
  }
  // Call Graft on NavigationData to copy member data
  output->Graft( graft );
}
void mitk::NavigationDataSource::GraftOutput ( itk::DataObject *  graft ) [virtual]

Graft the specified DataObject onto this ProcessObject's output.

See itk::ImageSource::Graft Output for details

Definition at line 68 of file mitkNavigationDataSource.cpp.

{
  this->GraftNthOutput(0, graft);
}
itk::ProcessObject::DataObjectPointer mitk::NavigationDataSource::MakeOutput ( unsigned int  idx ) [virtual]

Make a DataObject of the correct type to used as the specified output.

This method is automatically called when DataObject::DisconnectPipeline() is called. DataObject::DisconnectPipeline, disconnects a data object from being an output of its current source. When the data object is disconnected, the ProcessObject needs to construct a replacement output data object so that the ProcessObject is in a valid state. Subclasses of NavigationDataSource that have outputs of different data types must overwrite this method so that proper output objects are created.

Definition at line 97 of file mitkNavigationDataSource.cpp.

References mitk::NavigationData::New().

Referenced by MyNavigationDataSourceTest::CreateOutput().

{
  mitk::NavigationData::Pointer p = mitk::NavigationData::New();
  return static_cast<itk::DataObject*>(p.GetPointer());
}
virtual void mitk::NavigationDataSource::SetParameters ( const mitk::PropertyList  ) [inline, virtual]

Set all filter parameters as the PropertyList p.

This method allows to set all parameters of a filter with one method call. For the names of the parameters, take a look at the GetParameters method of the filter This method has to be overwritten by each MITK-IGT filter.

Reimplemented in mitk::CameraVisualization, and mitk::NavigationDataDisplacementFilter.

Definition at line 101 of file mitkNavigationDataSource.h.

{};

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