diff --git a/Modules/IGT/IGTToolManagement/mitkNavigationTool.cpp b/Modules/IGT/IGTToolManagement/mitkNavigationTool.cpp index 05eab9538f..0f033ae758 100644 --- a/Modules/IGT/IGTToolManagement/mitkNavigationTool.cpp +++ b/Modules/IGT/IGTToolManagement/mitkNavigationTool.cpp @@ -1,62 +1,64 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkNavigationTool.h" #include "Poco/File.h" -mitk::NavigationTool::NavigationTool() +mitk::NavigationTool::NavigationTool() : m_Type(mitk::NavigationTool::Unknown), + m_Identifier("None"), + m_TrackingDeviceType(mitk::TrackingSystemNotSpecified), + m_CalibrationFile("none"), + m_SerialNumber(""), + m_ToolRegistrationLandmarks(mitk::PointSet::New()), + m_ToolCalibrationLandmarks(mitk::PointSet::New()) { - m_Type = mitk::NavigationTool::Unknown; - m_Identifier = "None"; - m_TrackingDeviceType = mitk::TrackingSystemNotSpecified; - m_CalibrationFile = "none"; - m_SerialNumber = ""; + } mitk::NavigationTool::~NavigationTool() { } void mitk::NavigationTool::SetCalibrationFile(const std::string filename) { //check if file does exist: if (filename=="") { m_CalibrationFile = "none"; } else { Poco::File myFile(filename); if (myFile.exists()) m_CalibrationFile = filename; else m_CalibrationFile = "none"; } } std::string mitk::NavigationTool::GetToolName() { if (this->m_DataNode.IsNull()) {return "";} else {return m_DataNode->GetName();} } mitk::Surface::Pointer mitk::NavigationTool::GetToolSurface() { if (this->m_DataNode.IsNull()) {return NULL;} else if (this->m_DataNode->GetData() == NULL) {return NULL;} else {return dynamic_cast(m_DataNode->GetData());} } diff --git a/Modules/IGT/IGTToolManagement/mitkNavigationTool.h b/Modules/IGT/IGTToolManagement/mitkNavigationTool.h index 482efcdf87..a23aa4908c 100644 --- a/Modules/IGT/IGTToolManagement/mitkNavigationTool.h +++ b/Modules/IGT/IGTToolManagement/mitkNavigationTool.h @@ -1,122 +1,154 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef NAVIGATIONTOOL_H_INCLUDED #define NAVIGATIONTOOL_H_INCLUDED //itk headers #include #include //mitk headers #include #include +#include #include #include #include #include namespace mitk { /**Documentation * \brief An object of this class represents a navigation tool in the view of the software. * A few informations like an identifier, a toolname, a surface and a itk spatial * object are stored in such an object. The classes NavigationToolReader and * are availiable to write/read tools to/from the harddisc. If you need a collection * of navigation tools the class NavigationToolStorage could be used. * * \ingroup IGT */ class MitkIGT_EXPORT NavigationTool : public itk::Object { public: mitkClassMacro(NavigationTool,itk::Object); itkNewMacro(Self); enum NavigationToolType {Instrument, Fiducial, Skinmarker, Unknown}; //## getter and setter ## //NavigationToolType: itkGetMacro(Type,NavigationToolType); itkSetMacro(Type,NavigationToolType); + //Identifier: itkGetMacro(Identifier,std::string); itkSetMacro(Identifier,std::string); + //Datatreenode: itkGetMacro(DataNode,mitk::DataNode::Pointer); itkSetMacro(DataNode,mitk::DataNode::Pointer); + //SpatialObject: itkGetMacro(SpatialObject,itk::SpatialObject<3>::Pointer); itkSetMacro(SpatialObject,itk::SpatialObject<3>::Pointer); + //TrackingTool: itkGetMacro(TrackingTool,mitk::TrackingTool::Pointer); itkSetMacro(TrackingTool,mitk::TrackingTool::Pointer); + //CalibrationFile: itkGetMacro(CalibrationFile,std::string); - void SetCalibrationFile(const std::string filename); //itkSetMacro(CalibrationFile,std::string); + void SetCalibrationFile(const std::string filename); + + //Tool Landmarks: + /** @return Returns the tool registration landmarks which represent markers / special points on a + * tool that can be used for registration. The landmarks should be given in tool coordinates. + * If there are no landmarks defined for this tool the method returns an empty point set. + */ + itkGetMacro(ToolRegistrationLandmarks,mitk::PointSet::Pointer); + /** @brief Sets the tool registration landmarks which represent markers / special points on a + * tool that can be used for registration. The landmarks should be given in tool coordinates. + */ + itkSetMacro(ToolRegistrationLandmarks,mitk::PointSet::Pointer); + /** @return Returns the tool calibration landmarks for calibration of the defined points in the + * tool coordinate system, e.g. 2 landmarks for a 5DoF tool and 3 landmarks for a 6DoF tool. + */ + itkGetMacro(ToolCalibrationLandmarks,mitk::PointSet::Pointer); + /** @brief Sets the tool calibration landmarks for calibration of defined points in the + * tool coordinate system, e.g. 2 landmarks for a 5DoF tool and 3 landmarks for a 6DoF tool. + */ + itkSetMacro(ToolCalibrationLandmarks,mitk::PointSet::Pointer); + //SerialNumber: itkGetMacro(SerialNumber,std::string); itkSetMacro(SerialNumber,std::string); //TrackingDeviceType: itkGetMacro(TrackingDeviceType,mitk::TrackingDeviceType); itkSetMacro(TrackingDeviceType,mitk::TrackingDeviceType); //ToolName (only getter): /** @return Returns the name of this navigation tool. Returns an empty string if there is * no name (for example because the data node has not been set yet). * * Note: There is no setter for the name, * because the name of the corresponding data node is used as tool name. So if you * want to modify the name of this navigation tool only get the data node and modify * its name. */ std::string GetToolName(); //ToolSurface (only getter): /** @return Returns the surface of this navigation tool. Returns NULL if there is * no surface (for example because the data node has not been set yet). * * Note: There is no setter for the surface, * because the surface is the data of the corresponding data node. So if you * want to set a new surface only get the data node and modify its data. */ mitk::Surface::Pointer GetToolSurface(); //####################### protected: NavigationTool(); ~NavigationTool(); //## data structure of a navigation tool object ## std::string m_Identifier; NavigationToolType m_Type; /** @brief This DataNode holds a toolname and a tool surface */ mitk::DataNode::Pointer m_DataNode; /** @brief This member variable holds a mathamatical description of the tool */ itk::SpatialObject<3>::Pointer m_SpatialObject; /** @brief This member variable holds a pointer to the corresponding tracking tool in the hardware. */ mitk::TrackingTool::Pointer m_TrackingTool; /** @brief The path to the calibration file of the tool. */ std::string m_CalibrationFile; /** @brief A unique serial number of the tool which is needed to identify the tool correctly. This is very important * in case of the NDI Aurora System. */ std::string m_SerialNumber; /** @brief This member holds the tracking device type of the tool. */ mitk::TrackingDeviceType m_TrackingDeviceType; + /** @brief Holds landmarks for tool registration. */ + mitk::PointSet::Pointer m_ToolRegistrationLandmarks; + /** @brief Holds landmarks for calibration of the defined points in the tool coordinate system, + * e.g. 2 landmarks for a 5DoF tool and 3 landmarks for a 6DoF tool. + */ + mitk::PointSet::Pointer m_ToolCalibrationLandmarks; //################################################# }; } // namespace mitk #endif //NAVIGATIONTOOL