7 #ifndef __vtkPlusLineSegmentationAlgo_h 8 #define __vtkPlusLineSegmentationAlgo_h 11 #include "vtkPlusCalibrationExport.h" 12 #include "vtkObject.h" 29 double lineOriginPoint_Image[2];
30 double lineDirectionVector_Image[2];
32 double Slope()
const {
return lineDirectionVector_Image[1] / lineDirectionVector_Image[0]; }
40 virtual void PrintSelf(ostream& os, vtkIndent indent)
VTK_OVERRIDE;
46 PlusStatus ReadConfiguration(vtkXMLDataElement* aConfig);
49 void SetTrackedFrameList(vtkIGSIOTrackedFrameList& aTrackedFrameList);
50 void SetTrackedFrame(igsioTrackedFrame& aTrackedFrame);
53 void SetSignalTimeRange(
double rangeMin,
double rangeMax);
56 void SetClipRectangle(
int clipRectangleOriginPix[2],
int clipRectangleSizePix[2]);
65 void GetDetectedTimestamps(std::deque<double>& timestamps);
68 void GetDetectedPositions(std::deque<double>& positions);
71 void GetDetectedLineParameters(std::vector<LineParameters>& parameters);
74 void SetSaveIntermediateImages(
bool saveIntermediateImages);
76 void SetIntermediateFilesOutputDirectory(
const std::string& outputDirectory);
81 vtkGetMacro(PlotIntensityProfile,
bool);
82 vtkSetMacro(PlotIntensityProfile,
bool);
92 PlusStatus FindPeakStart(std::deque<int>& intensityProfile,
int maxFromLargestArea,
int startOfMaxArea,
double& startOfPeak);
94 PlusStatus FindLargestPeak(std::deque<int>& intensityProfile,
int& maxFromLargestArea,
int& maxFromLargestAreaIndex,
int& startOfMaxArea);
96 PlusStatus ComputeCenterOfGravity(std::deque<int>& intensityProfile,
int startOfMaxArea,
double& centerOfGravity);
98 void ComputeLineParameters(std::vector<itk::Point<double, 2> >&
data,
LineParameters& outputParameters);
100 void PlotIntArray(
const std::deque<int>& intensityValues);
102 void PlotDoubleArray(
const std::deque<double>& intensityValues);
104 void SaveIntermediateImage(
int frameNumber, CharImageType::Pointer scanlineImage,
double x_0,
double y_0,
double r_x,
double r_y,
int numOfValidScanlines,
const std::vector<itk::Point<double, 2> >& intensityPeakPositions);
107 void LimitToClipRegion(CharImageType::RegionType& region);
129 CharImageType::IndexValueType m_ClipRectangleOrigin[2];
132 CharImageType::SizeValueType m_ClipRectangleSize[2];
139 #endif // __vtkPlusLineSegmentationAlgo_h double m_SignalTimeRangeMin
itk::Image< CharPixelType, 2 > CharImageType
bool PlotIntensityProfile
std::vector< LineParameters > m_LineParameters
std::deque< double > m_SignalTimestamps
unsigned char CharPixelType
double m_SignalTimeRangeMax
bool m_SaveIntermediateImages
vtkSmartPointer< vtkIGSIOTrackedFrameList > m_TrackedFrameList
std::string IntermediateFilesOutputDirectory
std::deque< double > m_SignalValues
Detect the position of a line (image of a plane) in an US image sequence.