7 #include "PlusConfigure.h" 12 #ifdef PLUS_USE_tesseract 24 , ImageToTransducerTransformName(
"")
45 os << indent <<
"Imaging parameters: " << std::endl;
54 if (deviceConfig == NULL)
56 LOG_ERROR(
"Unable to continue configuration of " << this->
GetClassName() <<
". Could not find corresponding element.");
63 LOG_ERROR(
"Transform name is not properly formatted. It should be of the format <From>ToTransducer.");
64 this->SetImageToTransducerTransformName(NULL);
68 if (imagingParams != NULL)
74 LOG_ERROR(
"Failed to change imaging parameters in the device");
97 LOG_ERROR(
"Unable to deep copy new imaging parameters");
103 LOG_ERROR(
"Failed to change imaging parameters in the device");
113 igsioFieldMapType localCustomFields;
116 if (customFields != NULL)
118 localCustomFields = *customFields;
123 return videoSource.
AddItem(&frame, frameNumber, unfilteredTimestamp, filteredTimestamp, &localCustomFields);
127 PlusStatus vtkPlusUsDevice::AddVideoItemToVideoSource(
vtkPlusDataSource& videoSource,
void* imageDataPtr, US_IMAGE_ORIENTATION usImageOrientation,
const FrameSizeType& frameSizeInPx,
igsioCommon::VTKScalarPixelType pixelType,
unsigned int numberOfScalarComponents, US_IMAGE_TYPE imageType,
int numberOfBytesToSkip,
long frameNumber,
double unfilteredTimestamp ,
double filteredTimestamp ,
const igsioFieldMapType* customFields )
129 igsioFieldMapType localCustomFields;
132 if (customFields != NULL)
134 localCustomFields = *customFields;
139 return videoSource.
AddItem(imageDataPtr, usImageOrientation, frameSizeInPx, pixelType, numberOfScalarComponents, imageType, numberOfBytesToSkip, frameNumber, unfilteredTimestamp, filteredTimestamp, customFields);
145 igsioFieldMapType localCustomFields;
148 localCustomFields = *customFields;
156 PlusStatus vtkPlusUsDevice::AddVideoItemToVideoSources(
const std::vector<vtkPlusDataSource*>& videoSources,
void* imageDataPtr, US_IMAGE_ORIENTATION usImageOrientation,
const FrameSizeType& frameSizeInPx,
igsioCommon::VTKScalarPixelType pixelType,
unsigned int numberOfScalarComponents, US_IMAGE_TYPE imageType,
int numberOfBytesToSkip,
long frameNumber,
double unfilteredTimestamp ,
double filteredTimestamp ,
const igsioFieldMapType* customFields )
158 igsioFieldMapType localCustomFields;
159 if (customFields != NULL)
161 localCustomFields = *customFields;
168 return Superclass::AddVideoItemToVideoSources(videoSources, imageDataPtr, usImageOrientation, frameSizeInPx, pixelType, numberOfScalarComponents, imageType, numberOfBytesToSkip, frameNumber, unfilteredTimestamp, filteredTimestamp, &localCustomFields);
241 return std::vector<double>();
247 return std::vector<double>();
253 return std::vector<double>();
259 return std::vector<double>();
277 std::ostringstream imageToTransducerName;
280 std::ostringstream imageToTransducerTransformStr;
282 imageToTransducerTransformStr <<
" 0 " << this->CurrentPixelSpacingMm[1] <<
" 0 " << -1.0 * this->
CurrentTransducerOriginPixels[1]*this->CurrentPixelSpacingMm[1];
283 imageToTransducerTransformStr <<
" 0 0 " << this->CurrentPixelSpacingMm[2] <<
" " << -1.0 * this->
CurrentTransducerOriginPixels[2]*this->CurrentPixelSpacingMm[2];
284 imageToTransducerTransformStr <<
" 0 0 0 1";
285 customFields[imageToTransducerName.str()].first = FRAMEFIELD_NONE;
286 customFields[imageToTransducerName.str()].second = imageToTransducerTransformStr.str();
287 imageToTransducerName <<
"Status";
288 customFields[imageToTransducerName.str()].first = FRAMEFIELD_NONE;
289 customFields[imageToTransducerName.str()].second =
"OK";
static const char * KEY_DYNRANGE
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
static const char * KEY_IMAGESIZE
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *deviceConfig)
int CurrentTransducerOriginPixels[3]
Values used in calculation of image to transducer matrix.
Abstract interface for tracker and video devices.
static const char * KEY_DEPTH
This class is used to store a configuration of the imaging parameters of an ultrasound video device....
bool IsKnownKey(const std::string &queryKey) const
static const char * KEY_FREQUENCY
virtual PlusStatus SetParameter(const std::string &key, const std::string &value)
virtual PlusStatus AddItem(vtkImageData *frame, US_IMAGE_ORIENTATION usImageOrientation, US_IMAGE_TYPE imageType, long frameNumber, double unfilteredTimestamp=UNDEFINED_TIMESTAMP, double filteredTimestamp=UNDEFINED_TIMESTAMP, const igsioFieldMapType *customFields=NULL)
PlusStatus GetValue(const std::string ¶mName, T &outputValue) const
virtual std::string GetParameter(const std::string &key) const
vtkPlusUsImagingParameters * ImagingParameters
Store the current imaging parameters.
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) override
double CurrentPixelSpacingMm[3]
Values used in calculation of image to transducer matrix.
static const char * KEY_GAIN
std::string ImageToTransducerTransformName
virtual PlusStatus SetNewImagingParameters(const vtkPlusUsImagingParameters &newImagingParameters)
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *)
static const char * KEY_INTENSITY
virtual PlusStatus AddVideoItemToVideoSource(vtkPlusDataSource &videoSource, const igsioVideoFrame &frame, long frameNumber, double unfilteredTimestamp=UNDEFINED_TIMESTAMP, double filteredTimestamp=UNDEFINED_TIMESTAMP, const igsioFieldMapType *customFields=NULL)
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *)
virtual std::vector< double > CalculateAngles()
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual std::vector< double > CalculateOrigin()
vtkXMLDataElement * FindThisDeviceElement(vtkXMLDataElement *rootXMLElement)
virtual std::vector< double > CalculateBoundingBox()
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *)
virtual const char * GetClassName()
static const char * KEY_SECTOR
vtkStandardNewMacro(vtkPlusUsDevice)
static const char * KEY_CONTRAST
static const char * KEY_SOUNDVELOCITY
static const char * KEY_VOLTAGE
const char const char * value
virtual std::string GetParameter(const std::string &key) const
static const char * KEY_ZOOM
igsioTransformName ImageToTransducerTransform
PlusStatus SetValue(const std::string ¶mName, T aValue)
void CalculateImageToTransducer(igsioFieldMapType &customFields)
virtual PlusStatus InternalApplyImagingParameterChange()
virtual std::vector< double > CalculateDepths()
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)
virtual double CalculateLinearWidth()
virtual ~vtkPlusUsDevice()
Abstract interface for ultrasound video devices.
virtual PlusStatus SetParameter(const std::string &key, const std::string &value)
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual IGTLIO_PROBE_TYPE GetProbeType()
virtual PlusStatus DeepCopy(const vtkPlusUsImagingParameters &otherParameters)
static const char * KEY_TGC
static const char * XML_ELEMENT_TAG
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *deviceConfig)
Interface to a 3D positioning tool, video source, or generalized data stream.