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

mitk::TrackingVolume Class Reference

An instance of this class represents the tracking volume of a tracking device. More...

#include <mitkTrackingVolume.h>

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

List of all members.

Public Types

typedef TrackingVolume Self
typedef mitk::Surface Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
bool SetTrackingDeviceType (TrackingDeviceType type)
 Sets the tracking device of the volume. After doing this the volume is set to the correct dimensions in the correct coordinate system.
void SetVolumeManually (vtkPolyData *volume)
 Sets the trackingvolume explicitly. Only use this method if your specific trackingvolume is not supported by this class. The type is set to TrackingSystemNotSpecified if doing this.

Static Public Member Functions

static Pointer New ()

Protected Member Functions

 TrackingVolume ()

Protected Attributes

TrackingDeviceType m_TrackingDeviceType
 The current type of the corresponding tracking device is hold here. If the type is unknown the value is set to TrackingSystemNotSpecified.

Detailed Description

An instance of this class represents the tracking volume of a tracking device.

Documentation As it inherits from mitk::Surface it can be displayed in the 3D-window of MITK. The coordinate system is the same as the coordination system of the tracking device. To have the specific dimensions of the tracking volume of a tracking device the method SetTrackingDeviceType() needs to be called. For tracking devices that have a modifiable tracking volume (e.g. VirtualTrackingDevice, this class produces a tracking volume with default values (e.g. that are set in the class' constructor

Definition at line 45 of file mitkTrackingVolume.h.


Member Typedef Documentation

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

Reimplemented from mitk::Surface.

Definition at line 48 of file mitkTrackingVolume.h.

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

Reimplemented from mitk::Surface.

Definition at line 48 of file mitkTrackingVolume.h.

Reimplemented from mitk::Surface.

Definition at line 48 of file mitkTrackingVolume.h.

Reimplemented from mitk::Surface.

Definition at line 48 of file mitkTrackingVolume.h.


Constructor & Destructor Documentation

mitk::TrackingVolume::TrackingVolume (  ) [protected]

Definition at line 25 of file mitkTrackingVolume.cpp.

References mitk::StandardFileLocations::AddDirectoryForSearch(), mitk::StandardFileLocations::GetInstance(), m_TrackingDeviceType, MITK_ROOT, and mitk::TrackingSystemNotSpecified.

{
  m_TrackingDeviceType = mitk::TrackingSystemNotSpecified;

  //####### initialize file locations for the volume-STL-files #########
  std::string m_VolumeDir = MITK_ROOT;
  m_VolumeDir += "Modules/IGT/IGTTrackingDevices/TrackingVolumeData";
  mitk::StandardFileLocations::GetInstance()->AddDirectoryForSearch( m_VolumeDir.c_str(), false );
  //####################################################################

}

Member Function Documentation

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

Reimplemented from mitk::Surface.

static Pointer mitk::TrackingVolume::New (  ) [static]
bool mitk::TrackingVolume::SetTrackingDeviceType ( TrackingDeviceType  type )

Sets the tracking device of the volume. After doing this the volume is set to the correct dimensions in the correct coordinate system.

Parameters:
typeThe type of the tracking device (something like NDIAurora or NDIPolaris).
Returns:
Returns true if the type was set successfull, false if not.

Definition at line 50 of file mitkTrackingVolume.cpp.

References mitk::ClaronMicron, mitk::StandardFileLocations::FindFile(), mitk::StandardFileLocations::GetInstance(), mitk::IntuitiveDaVinci, mitk::NDIAurora, mitk::NDIPolaris, mitk::STLFileReader::New(), and mitk::VirtualTracker.

{
  // get filename / perform custom initiation
  std::string filename = "";

  switch(type)
  {
  case mitk::ClaronMicron:
    filename = mitk::StandardFileLocations::GetInstance()->FindFile("ClaronMicron.stl");
    break;
  case mitk::IntuitiveDaVinci:
    filename = mitk::StandardFileLocations::GetInstance()->FindFile("IntuitiveDaVinci.stl");
    break;
  case mitk::NDIAurora:
    filename = mitk::StandardFileLocations::GetInstance()->FindFile("NDIAurora.stl");
    break;
  case mitk::NDIPolaris:
    filename = mitk::StandardFileLocations::GetInstance()->FindFile("NDIPolaris.stl");
    break;
  case mitk::VirtualTracker:
    {
      vtkCubeSource* cs = vtkCubeSource::New();
      double bounds[6];
       bounds[0] = bounds[2] = bounds[4] = -400.0;  // initialize bounds to -400 ... +400 cube. This is the default value of the 
       bounds[1] = bounds[3] = bounds[5] =  400.0;  // virtual tracking device, but it can be changed. In that case, 
      // the tracking volume polydata has be updated manually
      cs->SetBounds(bounds);
      cs->GetOutput()->Update();
      this->SetVtkPolyData(cs->GetOutput());
      cs->Delete();
      return true;
    }
  default:
    return false;
  }

  if (filename.empty())
    return false;

  mitk::STLFileReader::Pointer stlReader = mitk::STLFileReader::New();
  try
  {
    stlReader->SetFileName( filename.c_str() );
    stlReader->Update();
  }
  catch (...)
  {
        return false;
  }
  if ( stlReader->GetOutput() == NULL )
    return false;

  this->SetVtkPolyData( stlReader->GetOutput()->GetVtkPolyData());
  stlReader = NULL;
  return true;  
}
void mitk::TrackingVolume::SetVolumeManually ( vtkPolyData *  volume )

Sets the trackingvolume explicitly. Only use this method if your specific trackingvolume is not supported by this class. The type is set to TrackingSystemNotSpecified if doing this.

Parameters:
volumeThe new tracking volume as vtkPolyData.

Definition at line 45 of file mitkTrackingVolume.cpp.

{
  this->SetVtkPolyData(volume);
}

Member Data Documentation

The current type of the corresponding tracking device is hold here. If the type is unknown the value is set to TrackingSystemNotSpecified.

Definition at line 84 of file mitkTrackingVolume.h.

Referenced by TrackingVolume().


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