8 #include <boost/signals2.hpp>
9 #include <boost/bind.hpp>
41 boost::signals2::signal<void(
int width,
int height)> SignalWidthHeightChanged;
44 size_t GetProcessedDataSizeBytes () {
return _outputDataSize; }
45 size_t GetProcessedDataSizeNative () {
return _outputDataSize /
sizeof(float); }
47 int GetHeight () {
return _height; }
48 int GetWidth () {
return _width; }
49 int GetHalfHeight () {
return _halfHeight; }
50 int GetDepth () {
return _depth; }
52 float GetAutoScaleMin () {
return _autoScaleMin; }
53 float GetAutoScaleMax () {
return _autoScaleMax; }
54 int GetAScanAverage ();
56 static size_t GetPreFFTDataSize () {
return _preFFT1DataSize; }
58 bool IsConvertingImage ()
const {
return _convertingImage; }
61 static bool GetShiftUpLines () {
return _shiftUpLines; }
62 static int GetTopLinesToIgnore () {
return _topLinesToIgnore; }
63 static int GetBotLinesToIgnore () {
return _botLinesToIgnore; }
64 static bool GetOutputLogValues () {
return _outputLogValues; }
65 static bool GetUseAutoContrast () {
return _useAutoContrast; }
66 static bool GetUseScaling () {
return _useScaling; }
67 static bool GetUseApodization () {
return _useApodization; }
69 static float GetAutoScaleUserMin () {
return _userAutoScaleMin; }
70 static float GetAutoScaleUserMax () {
return _userAutoScaleMax; }
72 static bool GetUseMovingAverage ();
73 static int GetMovingAverageWindowSize ();
76 bool GetIsZeroPad ()
const {
return _isZeroPad; }
78 Dispersion* GetDispersion ()
const {
return _dispersion; }
79 std::vector<float> GetDispersionCoefficients ();
81 void AdjustForBackground (
const U16* raw, SGL *&inputData);
84 void SetAutoScaleMin (
float value) { _autoScaleMin = value; }
85 void SetAutoScaleMax (
float value) { _autoScaleMax = value; }
86 bool SetAScanAverage (
int value);
88 static void SetShiftUpLines (
bool value) { _shiftUpLines = value; }
89 static bool SetTopLinesToIgnore (
int value)
93 _topLinesToIgnore = value;
96 static bool SetBotLinesToIgnore (
int value)
100 _botLinesToIgnore = value;
103 static bool SetOutputLogValues (
bool value) { _outputLogValues = value;
return true; }
104 static bool SetUseAutoContrast (
bool value)
106 if (_useScaling || !value)
108 _useAutoContrast = value;
117 static bool SetUseScaling (
bool value) { _useScaling = value;
return true; }
118 static bool SetUseApodization (
bool value) { _useApodization = value;
return true; }
120 static void SetAutoScaleUserMin (
float value) { _userAutoScaleMin = value; }
121 static void SetAutoScaleUserMax (
float value) { _userAutoScaleMax = value; }
124 static bool SetUseMovingAverage (
bool value);
125 static bool SetMovingAverageWindowSize (
int value);
126 static bool ResetMovingAverage ();
128 void SetIsZeroPad (
bool value) { _isZeroPad = value; }
130 bool SetWidth (
int value)
138 OnWidthHeightChanged(_width, _height);
143 bool SetHeight (
int value)
148 if (_height != value)
151 _halfHeight = _height / 2;
154 OnWidthHeightChanged(_width, _height);
159 bool SetWidthAndHeight (
int width,
int height)
161 if (width <= 0 || height <= 0)
164 if (_width != width || _height != height)
169 _halfHeight = _height / 2;
172 OnWidthHeightChanged(width, height);
177 void SetDepth (
int value) { _depth = value; }
180 bool CalcDispersionCoefficients (
const unsigned short* inData,
int width,
int height,
181 float* coefficients);
182 bool SetDispersionOptimizationParameters(
int numCoefficients,
int maxIterations,
183 float* initialGuesses,
int startLine,
184 int stopLine,
int offset);
186 virtual GPUManager* GetGPUManager () {
return nullptr; }
189 virtual bool ComputeIntensity (
const unsigned short* inData,
float* outIntensity);
191 virtual bool ComputePhaseIntensity (
IWPOCTInOutData* inOutData,
bool outputPhase);
192 virtual bool ComputePhaseIntensity (
const unsigned short* inData,
float* outIntensity,
193 float* outPhase,
bool outputPhase);
195 virtual int GetFFTLength ()
const {
return 0; }
196 virtual void SetScaleType (
int sMethod) { }
199 bool UpdateBackgroundImage ();
200 bool GetBackgroundImage (
float* buffer,
int size);
201 bool SetBackgroundImage (
float* buffer,
int size);
211 static int _scaleType;
212 static int _refCount;
214 float _minNoise, _maxNoise, _noiseStep;
215 float _minScale, _maxScale, _scaleStep;
219 static std::atomic<int> _topLinesToIgnore;
220 static std::atomic<int> _botLinesToIgnore;
221 static std::atomic<bool> _outputLogValues;
222 static std::atomic<bool> _useAutoContrast;
223 static std::atomic<bool> _useScaling;
224 static std::atomic<bool> _useApodization;
225 static std::atomic<bool> _shiftUpLines;
233 float _autoScaleMin, _autoScaleMax;
234 std::atomic<bool> _convertingImage;
242 static std::atomic<float> _userAutoScaleMax, _userAutoScaleMin;
254 size_t _outputDataSize;
255 static size_t _preFFT1DataSize;
259 void SetScale (
float minScale,
float maxScale);
260 void SetNoiseStep ();
261 void SetScaleStep ();
262 void SetZeroPadRunFFT ();
264 void RunAssembly (
bool withPhase);
266 virtual void CalcMemoryNeeded () { }
268 virtual void CorrectDispersion () { }
269 virtual int PerformAveraging () {
return -1; }
270 virtual int ApplyHanningAndFringe () {
return 0; }
272 virtual int InitStorage ();
273 virtual void ReleaseStorage ();
275 virtual void InitInOutArrays ();
276 virtual void ReleaseInOutArrays () { }
278 virtual void InitHelpers ();
279 virtual void ReleaseHelpers ();
281 virtual int CreateAnalyticPhase () {
return 0; }
282 virtual int AssembleIntensity (
bool withPhase) {
return 0; }
283 virtual int AssembleIntensityNoiseScale () {
return 0; }
285 virtual int ZeroPad () {
return 0; }
287 virtual int ContrastScale () {
return 0; }
289 virtual int TransferOutputAndPhase (
float* outData,
float* phaseData,
bool outputPhase ) {
return 0; }
290 virtual int TransferOutputAndInterim (
float*& outData,
float* interim) {
return -1; }
292 virtual void OnWidthHeightChanged (
int width,
int height);
295 void SetupMovingAverage();
Interface of the IWPOCTConverter struct.
typedefs used across UtensilConverter
Interface of the WPFFT class.
Definition: Averager.h:17
Definition: Background.h:18
Definition: Dispersion.h:18
Definition: GPUManager.h:13
Class for calculating a moving average. The window size is configurable.
Definition: MovingAverage.h:17
Definition: Resampler.h:22
Class that processes scans.
Definition: ScanProcessor.h:32
int ComputeForDispersion(const unsigned short *inData, float *interim, float *&outData)
Use this for Dispersion Compensation.
Definition: ScanProcessor.cpp:285
virtual bool SetDispersionCoefficients(const float *dispersionCoeffients, int length)
Set the dispersion coefficients.
Definition: ScanProcessor.cpp:223
FFTType
Lists the different types of FFTs available.
Definition: WPFFT.h:22
Class to convert data obtained from a line scan camera into meaningful 2D OCT image data.
Definition: IWPOCTConverter.h:56
ErrorCode
The following are error codes that are used within the converter object.
Definition: IWPOCTConverter.h:61
The data object contains pointers to input and output data.
Definition: IWPOCTInOutData.h:14