18 #ifndef __igstkPivotCalibration_h
19 #define __igstkPivotCalibration_h
61 void RequestInitialize(
unsigned int n,
127 void PrintSelf( std::ostream& os, itk::Indent indent )
const;
132 igstkDeclareStateMacro( Idle );
133 igstkDeclareStateMacro( AttemptingToInitialize );
134 igstkDeclareStateMacro( Initialized );
135 igstkDeclareStateMacro( AttemptingToComputeCalibration );
136 igstkDeclareStateMacro( CalibrationComputed );
140 igstkDeclareInputMacro( Initialize );
141 igstkDeclareInputMacro( Failed );
142 igstkDeclareInputMacro( Succeeded );
143 igstkDeclareInputMacro( ComputeCalibration );
144 igstkDeclareInputMacro( GetTransform );
145 igstkDeclareInputMacro( GetPivotPoint );
146 igstkDeclareInputMacro( GetRMSE );
149 void ReportInvalidRequestProcessing();
150 void InitializeProcessing();
151 void ReportInitializationFailureProcessing();
152 void ReportInitializationSuccessProcessing();
153 void ComputeCalibrationProcessing();
154 void ReportCalibrationComputationSuccessProcessing();
155 void ReportCalibrationComputationFailureProcessing();
156 void GetTransformProcessing();
157 void GetPivotPointProcessing();
158 void GetRMSEProcessing();
159 void EmptyCallBack( itk::Object * itkNotUsed(caller),
160 const itk::EventObject & itkNotUsed(event)){};
163 typedef itk::MemberCommand<PivotCalibration> TransformAcquiredCommand;
164 TransformAcquiredCommand::Pointer m_TransformAcquiredObserver;
166 igstkObserverMacro( TransformToTracker,
167 igstk::CoordinateSystemTransformToEvent,
169 TransformToTrackerObserver::
Pointer m_TransformObserver;
170 unsigned long m_TransformToTrackerObserverID;
172 void AcquireTransformsAndCalibrate(itk::
Object *caller,
173 const itk::EventObject & event);
175 class ErrorObserver : public itk::Command
179 typedef ErrorObserver
Self;
181 typedef ::itk::SmartPointer<Self>
Pointer;
189 virtual
void Execute(itk::
Object *caller,
190 const itk::EventObject & event) throw (std::exception);
194 virtual
void Execute(const itk::
Object *caller,
195 const itk::EventObject & event) throw (std::exception);
198 void ClearError() {this->m_ErrorOccured =
false;
199 this->m_ErrorMessage.clear();}
202 bool ErrorOccured() {
return this->m_ErrorOccured;}
204 void GetErrorMessage(std::string &errorMessage)
206 errorMessage = this->m_ErrorMessage;
214 virtual ~ErrorObserver(){}
219 std::string m_ErrorMessage;
220 std::map<std::string,std::string> m_ErrorEvent2ErrorMessage;
223 ErrorObserver(
const Self&);
224 void operator=(
const Self&);
229 igstkObserverMacro( CalibrationTransform,
230 CoordinateSystemTransformToEvent,
231 CoordinateSystemTransformToResult )
233 igstkObserverMacro( PivotPoint, PointEvent, EventHelperType::
PointType )
235 igstkObserverMacro( CalibrationRMSE,
240 CalibrationTransformObserver::Pointer m_GetCalibrationTransformObserver;
241 PivotPointObserver::Pointer m_GetPivotPointObserver;
242 CalibrationRMSEObserver::Pointer m_GetCalibrationRMSEObserver;
244 ErrorObserver::Pointer m_ErrorObserver;
245 std::
string m_ReasonForCalibrationFailure;
248 std::vector< PivotCalibrationAlgorithm::TransformType > m_Transforms;
251 TrackerTool::Pointer m_TmpTrackerTool;
252 TrackerTool::Pointer m_TrackerTool;
254 unsigned int m_TmpRequiredNumberOfTransformations;
255 unsigned int m_RequiredNumberOfTransformations;
258 PivotCalibrationAlgorithm::Pointer m_PivotCalibrationAlgorithm;
263 #endif //__igstkPivotCalibration_h
void RequestPivotPoint()
This method is used to request the pivot point, given in the coordinate system in which the user supp...
#define igstkTypeMacro(thisClass, superclass)
Type Macro defines the GetNameOfClass() method for every class where it is invoked.
igstkEventMacro(InitializationSuccessEvent, IGSTKEvent)
This event is generated if the initialization succeeds.
igstkStandardClassTraitsMacro(PivotCalibration, Object) void RequestInitialize(unsigned int n
Macro with standard traits declarations (Self, SuperClass, State Machine etc.).
igstkLoadedEventMacro(CalibrationFailureEvent, IGSTKEvent, EventHelperType::StringType)
This event is generated if the pivot calibration fails, either due to data acquisition problems or co...
Base class for all the IGSTK classes.
Object Self
General Typedefs.
void RequestComputeCalibration()
This method performs the data acquisition and calibration.
void PrintSelf(std::ostream &os, itk::Indent indent) const
Print the object information in a stream.
defines standard system-wide macros, constants, and other common parameters in the IGSTK Library...
#define igstkNewMacro(x)
New Macro creates a new object of a class that is using SmartPointers.
::itk::SmartPointer< Self > Pointer
This class encapsulates the pivot calibration algorithm and tracking data acquistion for performing t...
itk::Point< double, 3 > PointType
void RequestCalibrationRMSE()
This method is used to request the Root Mean Square Error (RMSE) of the overdetermined equation syste...
igstk::TrackerTool::Pointer trackerTool
::itk::SmartPointer< const Self > ConstPointer
void RequestCalibrationTransform()
This method is used to request the calibration transformation.