PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusUsDevice.h
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2 Program: Plus
3 Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4 See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 #ifndef __vtkPlusUsDevice_h
8 #define __vtkPlusUsDevice_h
9 
10 #include "igsioCommon.h"
11 #include "PlusConfigure.h"
12 #include "vtkPlusDataCollectionExport.h"
13 #include "vtkPlusDevice.h"
14 #include <igtlioUsSectorDefinitions.h>
15 
17 class vtkPlusChannel;
18 
28 class vtkPlusDataCollectionExport vtkPlusUsDevice : public vtkPlusDevice
29 {
30 public:
31  static vtkPlusUsDevice* New();
33  virtual void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
34 
36  virtual PlusStatus ReadConfiguration(vtkXMLDataElement*);
37 
39  virtual PlusStatus WriteConfiguration(vtkXMLDataElement*);
40 
46  virtual PlusStatus SetNewImagingParameters(const vtkPlusUsImagingParameters& newImagingParameters);
47 
49  virtual PlusStatus AddVideoItemToVideoSource(vtkPlusDataSource& videoSource, const igsioVideoFrame& frame, long frameNumber, double unfilteredTimestamp = UNDEFINED_TIMESTAMP,
50  double filteredTimestamp = UNDEFINED_TIMESTAMP, const igsioFieldMapType* customFields = NULL);
52  virtual PlusStatus AddVideoItemToVideoSource(vtkPlusDataSource& videoSource, void* imageDataPtr, US_IMAGE_ORIENTATION usImageOrientation, const FrameSizeType& frameSizeInPx, igsioCommon::VTKScalarPixelType pixelType,
53  unsigned int numberOfScalarComponents, US_IMAGE_TYPE imageType, int numberOfBytesToSkip, long frameNumber, double unfilteredTimestamp = UNDEFINED_TIMESTAMP,
54  double filteredTimestamp = UNDEFINED_TIMESTAMP, const igsioFieldMapType* customFields = NULL);
55 
57  virtual PlusStatus AddVideoItemToVideoSources(const std::vector<vtkPlusDataSource*>& videoSources, const igsioVideoFrame& frame, long frameNumber, double unfilteredTimestamp = UNDEFINED_TIMESTAMP,
58  double filteredTimestamp = UNDEFINED_TIMESTAMP, const igsioFieldMapType* customFields = NULL) override;
59 
61  virtual PlusStatus AddVideoItemToVideoSources(const std::vector<vtkPlusDataSource*>& videoSources, void* imageDataPtr, US_IMAGE_ORIENTATION usImageOrientation, const FrameSizeType& frameSizeInPx,
62  igsioCommon::VTKScalarPixelType pixelType, unsigned int numberOfScalarComponents, US_IMAGE_TYPE imageType, int numberOfBytesToSkip, long frameNumber, double unfilteredTimestamp = UNDEFINED_TIMESTAMP,
63  double filteredTimestamp = UNDEFINED_TIMESTAMP, const igsioFieldMapType* customFields = NULL) override;
64 
72  vtkGetStdStringMacro(ImageToTransducerTransformName);
73  vtkSetStdStringMacro(ImageToTransducerTransformName);
74 
76  vtkGetObjectMacro(ImagingParameters, vtkPlusUsImagingParameters);
77 
79  virtual PlusStatus SetParameter(const std::string& key, const std::string& value);
80  virtual std::string GetParameter(const std::string& key) const;
81  virtual PlusStatus GetParameter(const std::string& key, std::string& outValue) const;
82 
84  bool IsKnownKey(const std::string& queryKey) const;
85 
86  // Virtual functions for creating the OpenIGTLinkIO ultrasound parameters.
87  // Implement these in all US devices that should support ultrasound sector information
88 
90  virtual IGTLIO_PROBE_TYPE GetProbeType();
91 
93  virtual std::vector<double> CalculateOrigin();
94 
98  virtual std::vector<double> CalculateAngles();
99 
102  virtual std::vector<double> CalculateBoundingBox();
103 
105  virtual std::vector<double> CalculateDepths();
106 
108  virtual double CalculateLinearWidth();
109 
110 protected:
112  virtual PlusStatus InternalApplyImagingParameterChange();
113 
114  void CalculateImageToTransducer(igsioFieldMapType& customFields);
115 
116  vtkPlusUsDevice();
117  virtual ~vtkPlusUsDevice();
118 
119 protected:
122 
124  double CurrentPixelSpacingMm[3];
126  int CurrentTransducerOriginPixels[3];
127 
128  igsioTransformName ImageToTransducerTransform;
130 
131 private:
132  vtkPlusUsDevice(const vtkPlusUsDevice&); // Not implemented.
133  void operator=(const vtkPlusUsDevice&); // Not implemented.
134 };
135 
136 #endif
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
const char * key
Definition: phidget22.h:5111
Abstract interface for tracker and video devices.
Definition: vtkPlusDevice.h:60
This class is used to store a configuration of the imaging parameters of an ultrasound video device....
virtual PlusStatus SetParameter(const std::string &key, const std::string &value)
igsioStatus PlusStatus
Definition: PlusCommon.h:40
virtual std::string GetParameter(const std::string &key) const
vtkPlusUsImagingParameters * ImagingParameters
Store the current imaging parameters.
std::string ImageToTransducerTransformName
#define VTK_OVERRIDE
Definition: PlusCommon.h:49
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *)
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *)
const char const char * value
Definition: phidget22.h:5111
int VTKScalarPixelType
Definition: PlusCommon.h:55
igsioTransformName ImageToTransducerTransform
Contains an optional timestamped circular buffer containing the video images and a number of timestam...
virtual PlusStatus AddVideoItemToVideoSources(const std::vector< vtkPlusDataSource * > &videoSources, const igsioVideoFrame &frame, long frameNumber, double unfilteredTimestamp=UNDEFINED_TIMESTAMP, double filteredTimestamp=UNDEFINED_TIMESTAMP, const igsioFieldMapType *customFields=NULL)
Abstract interface for ultrasound video devices.
static vtkPlusDevice * New()
Interface to a 3D positioning tool, video source, or generalized data stream.