WPOCT Software Developer's Kit (SDK)
SDK For using Wasatch Photonics OCT Spectrometers
IWPOCTConverter.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 // Forward declarations.
9 struct IWPOCTInOutData;
10 
56 {
60  enum ErrorCode
61  {
62  NoError = 0,
63  NullPointer = 1,
64  FileReadError = 2,
65  FileWriteError = 3,
66  FileOrDirNotFound = 4,
67  InvalidFileOrDirName = 5,
68  InvalidArgumentValue = 6,
69  MemoryAllocationError = 7,
70  BackgroundUpdateError = 8,
71  ConversionError = 9,
72  CompatibleGraphicsCardNotFound = 10,
73  StartOpenCLError = 11,
74  ScanProcessorInitError = 12,
75  DongleNotFound = 13,
76  NumErrors = 14
77  };
78 
79  virtual ~IWPOCTConverter() { }
80 
81  // Getters
82 
85  virtual const char* GetQualifiedInputFileName () const = 0;
86 
89  virtual const char* GetOutputIntensityName () const = 0;
90 
93  virtual const char* GetOutputPhaseName () const = 0;
94 
97  virtual const char* GetOutputDirectory () const = 0;
98 
101  virtual const char* GetCalibrationFringeFile () const = 0;
102 
105  virtual bool GetOutputIntensity () const = 0;
106 
109  virtual bool GetOutputPhase () const = 0;
110 
114  virtual bool GetDeleteInputFileAfterConversion() const = 0;
115 
119  virtual bool GetOutputTiffFormat () const = 0;
120 
124  virtual bool GetOutputLogOfData () const = 0;
125 
129  virtual bool GetUseScaling () const = 0;
130 
134  virtual bool GetUseContrast () const = 0;
135 
138  virtual int GetAScansPerBScan () const = 0;
139 
143  virtual int GetAScanSize () const = 0;
144 
149  virtual int GetAScanAverage () const = 0;
150 
155  virtual bool GetScanDimensions (int* width, int* height) const = 0;
156 
161  virtual bool GetDispersionCoefficients (float* coefficients, int length) const = 0;
162 
169  virtual bool GetNumberOfLinesToIgnore (int* top, int* bottom) const = 0;
170 
176  virtual bool GetMinMaxScaling (float* min, float* max) const = 0;
177 
181  virtual int GetNumScanProcessors () const = 0;
182 
185  virtual bool GetUseMovingAverage () const = 0;
186 
189  virtual int GetMovingAverageWindowSize () const = 0;
190 
192  // Setters
194 
199  virtual bool SetQualifiedInputFileName (const char* name) = 0;
200 
203  virtual bool SetOutputIntensityName (const char* name) = 0;
204 
207  virtual bool SetOutputPhaseName (const char* name) = 0;
208 
211  virtual bool SetOutputDirectory (const char* name) = 0;
212 
215  virtual bool SetCalibrationFringeFile (const char* name) = 0;
216 
222  virtual bool UpdateBackgroundImage () = 0;
223 
224  // Gets the background image, which is the size of AscanSize. It can be the
225  // result of averaging an input image or it can be an image specified by the
226  // user by calling SetBackgroundImage.
228  virtual bool GetBackgroundImage (float* buffer, int size) = 0;
229 
235  virtual bool SetBackgroundImage (float* buffer, int size) = 0;
236 
239  virtual bool SetOutputIntensity (bool value) = 0;
240 
243  virtual bool SetOutputPhase (bool value) = 0;
244 
248  virtual bool SetDeleteInputFileAfterConversion(bool value) = 0;
249 
253  virtual bool SetOutputTiffFormat (bool value) = 0;
254 
258  virtual bool SetOutputLogOfData (bool value) = 0;
259 
266  virtual bool SetUseScaling (bool value) = 0;
267 
273  virtual bool SetUseContrast (bool value) = 0;
274 
278  virtual bool SetAScansPerBScan (int value) = 0;
279 
284  virtual bool SetAScanSize (int value) = 0;
285 
288  virtual bool SetAScanAverage (int value) = 0;
289 
295  virtual bool SetScanDimensions (int aScansPerBScan , int aScanSize) = 0;
296 
301  virtual bool SetDispersionCoefficients (const float* coefficients, int length) = 0;
302 
314  virtual bool SetDispersionOptimizationParameters(int numCoefficients, int maxIterations,
315  float* initialGuesses, int startLine,
316  int stopLine, int offset) = 0;
317 
320  virtual bool SetNumberOfLinesToIgnore (int top, int bottom) = 0;
321 
328  virtual bool SetMinMaxScaling (float min, float max) = 0;
329 
341  virtual bool SetNumScanProcessors(int value) = 0;
342 
347  virtual bool SetUseMovingAverage (bool value) = 0;
348 
351  virtual bool SetMovingAverageWindowSize (int value) = 0;
352 
355  virtual bool ResetMovingAverage () = 0;
356 
358  // Conversion Commands
360 
366  virtual bool ConvertSpectralDataToIntensity (IWPOCTInOutData* inOutData) = 0;
367 
374  virtual bool ConvertSpectralDataToIntensity (const unsigned short* inData, float* outIntensity) = 0;
375 
382 
388  virtual bool ConvertSpectralDataToPhaseIntensity (const unsigned short* inData,
389  float* outIntensity, float* outPhase) = 0;
390 
395 
399  virtual bool ConvertSpectralFileToPhaseIntensity (const char* qualifiedFileName) = 0;
400 
407 
415  virtual bool ConvertFloatToUnsignedChar (const float* inData, unsigned char* outData,
416  int size) const = 0;
417 
425  virtual bool ConvertFloatToUnsignedShort (const float* inData, unsigned short* outData,
426  int size) const = 0;
428  // Transformation Commands
430 
437  virtual bool TransposeArray (const float *inData, float *outData, int inWidth, int inHeight) const = 0;
438 
445  virtual bool TransposeArray (const unsigned short* inData, unsigned short* outData, int inWidth,
446  int inHeight) const = 0;
447 
454  virtual bool TransposeArray (const unsigned char* src, unsigned char* dst, int inWidth,
455  int inHeight) const = 0;
456 
462  virtual bool FlipVertical (unsigned short* data, int width, int height) const = 0;
463 
469  virtual bool FlipHorizontal (unsigned short* data, int width, int height) const = 0;
470 
479  virtual bool RotateImage (const unsigned short* inData, unsigned short* outData, int width,
480  int height, unsigned int cw90Multiplier) const = 0;
481 
483  // Calculation Commands
485 
493  virtual bool CalcDispersionCoefficients (const unsigned short* inData, int width,
494  int height, float* coefficients) = 0;
496  // Status Commands
498 
502 
503 // Include the section below when compiling with Swig.
504 #ifdef _RUNSWIG
507  static IWPOCTConverter* GetOCTConverter();
508 
511  static bool DestroyOCTConverter();
512 };
513 
514 // Include the section below when compiling in Visual Studio.
515 #else
516 };
517 #ifdef __cplusplus
518 extern "C" {
519 #endif
520 
523 __declspec(dllexport) IWPOCTConverter* GetOCTConverter ();
524 
527 __declspec(dllexport) bool DestroyOCTConverter ();
528 
529 #ifdef __cplusplus
530 }
531 #endif
532 #endif
__declspec(dllexport) IWPOCTConverter *GetOCTConverter()
Gets the instance of the scan converter object.
Definition: IWPOCTController.cpp:13
Class to convert data obtained from a line scan camera into meaningful 2D OCT image data.
Definition: IWPOCTConverter.h:56
virtual bool UpdateBackgroundImage()=0
Updates a flag so that the background image used for background subtraction is updated with the avera...
virtual bool TransposeArray(const unsigned short *inData, unsigned short *outData, int inWidth, int inHeight) const =0
Transpose an array of shorts.
virtual bool SetUseMovingAverage(bool value)=0
Enables or disables the output moving average.
virtual bool SetOutputPhase(bool value)=0
Set the flag that determines if phase is output.
virtual bool FlipVertical(unsigned short *data, int width, int height) const =0
Flips an array (image) around its horizontal axis.
virtual bool ConvertSpectralFileToPhaseIntensity()=0
Converts raw spectral data contained in a file to intensity and/or phase files.
virtual int GetAScanSize() const =0
Get the size of an A-scan.
virtual bool SetNumberOfLinesToIgnore(int top, int bottom)=0
Sets the top and bottom number of lines to ignore in the processed image.
virtual const char * GetOutputIntensityName() const =0
Get the output intensity file name (no path).
virtual bool TransposeArray(const float *inData, float *outData, int inWidth, int inHeight) const =0
Transpose an array of floats.
virtual IWPOCTConverter::ErrorCode GetLastError() const =0
Gets the result of the most current operation.
virtual bool SetAScansPerBScan(int value)=0
Sets the number of A-scans per B-scan.
virtual bool SetCalibrationFringeFile(const char *name)=0
Set the calibration fringe file name.
virtual bool GetOutputLogOfData() const =0
Get the flag that determines if the log of the output data is taken/used.
ErrorCode
The following are error codes that are used within the converter object.
Definition: IWPOCTConverter.h:61
virtual bool SetUseContrast(bool value)=0
Sets the flag that determines if the contrast is adjusted on the output.
virtual bool SetNumScanProcessors(int value)=0
Set the number of scan processors currently in use.
virtual const char * GetCalibrationFringeFile() const =0
Get the calibration fringe file name.
virtual bool RotateImage(const unsigned short *inData, unsigned short *outData, int width, int height, unsigned int cw90Multiplier) const =0
Rotates an image by 0, 90, 180, or 270 degrees.
virtual int GetAScanAverage() const =0
Gets the number of averages in an A-scan.
virtual int GetAScansPerBScan() const =0
Get the number of A-scans per B-scan.
virtual bool SetOutputLogOfData(bool value)=0
Set the flag that determines if the log of the output data is computed.
virtual bool SetDeleteInputFileAfterConversion(bool value)=0
Set the flag that determines if the RAW input file is deleted after data is converted.
virtual bool SetOutputIntensityName(const char *name)=0
Set the intensity file name (no path).
virtual const char * GetQualifiedInputFileName() const =0
Get the fully qualified input file name (includes path and file name).
virtual bool CalcDispersionCoefficients(const unsigned short *inData, int width, int height, float *coefficients)=0
Calculates the optimal dispersion coefficients.
virtual bool SetOutputDirectory(const char *name)=0
Sets the output directory (including the drive letter) where processed data is written.
virtual bool ConvertSpectralDataToIntensity(const unsigned short *inData, float *outIntensity)=0
Convert raw spectral data to intensity array.
virtual bool ConvertSpectralDirToPhaseIntensity()=0
Converts raw spectral data files contained in a directory to intensity and/or phase files.
virtual bool GetMinMaxScaling(float *min, float *max) const =0
Gets the min and max scaling values.
virtual bool GetDeleteInputFileAfterConversion() const =0
Get the flag that determines if the RAW spectral input file is deleted after data is converted.
virtual const char * GetOutputPhaseName() const =0
Get the output phase file name (no path).
virtual bool ConvertSpectralFileToPhaseIntensity(const char *qualifiedFileName)=0
Converts raw spectral data contained in a file to intensity and/or phase files.
virtual bool SetOutputTiffFormat(bool value)=0
Set the flag that determines if the output files will be in Tiff format.
virtual const char * GetOutputDirectory() const =0
Get the output directory.
virtual bool SetBackgroundImage(float *buffer, int size)=0
Updates the background image to the buffer passed in.
virtual bool ConvertSpectralDataToPhaseIntensity(const unsigned short *inData, float *outIntensity, float *outPhase)=0
Converts raw spectral data to intensity and phase arrays.
virtual bool TransposeArray(const unsigned char *src, unsigned char *dst, int inWidth, int inHeight) const =0
Transpose an array of bytes.
virtual bool SetOutputIntensity(bool value)=0
Set the flag that determines if intensity is output.
virtual bool GetUseMovingAverage() const =0
Gets the flag that indicates if a moving average is being output by conversions.
virtual bool SetScanDimensions(int aScansPerBScan, int aScanSize)=0
Sets the width and height of a scan.
virtual bool GetBackgroundImage(float *buffer, int size)=0
virtual bool GetNumberOfLinesToIgnore(int *top, int *bottom) const =0
Get the top and bottom number of lines to ignore.
virtual int GetNumScanProcessors() const =0
Get the number of scan processors currently in use.
virtual bool SetAScanAverage(int value)=0
Sets the number of A-scans that are averaged together in the output.
virtual bool SetOutputPhaseName(const char *name)=0
Set the phase file name (no path).
virtual bool SetUseScaling(bool value)=0
Sets the flag that determines if scaling is used to adjust the output.
virtual bool ConvertFloatToUnsignedShort(const float *inData, unsigned short *outData, int size) const =0
Converts an array of float data to unsigned short data.
virtual bool GetDispersionCoefficients(float *coefficients, int length) const =0
Get the dispersion coefficients.
virtual bool GetOutputTiffFormat() const =0
Get the flag that determines if the output files will be in Tiff format.
virtual bool GetOutputIntensity() const =0
Get the flag that determines if intensity is output.
virtual bool ResetMovingAverage()=0
Resets the moving average by clearing the buffers.
virtual bool SetMovingAverageWindowSize(int value)=0
Sets the window size of the moving average.
virtual bool SetDispersionOptimizationParameters(int numCoefficients, int maxIterations, float *initialGuesses, int startLine, int stopLine, int offset)=0
Set the values that are used to calculate the optimal dispersion coefficients.
virtual bool SetAScanSize(int value)=0
Sets the size of an A-scan.
virtual bool GetScanDimensions(int *width, int *height) const =0
Gets the width and height of the input data to be converted.
virtual bool SetMinMaxScaling(float min, float max)=0
Sets the min and max scaling values.
virtual bool ConvertSpectralDataToIntensity(IWPOCTInOutData *inOutData)=0
Convert raw spectral data to intensity array.
virtual bool GetOutputPhase() const =0
Get the flag that determines if phase is output.
virtual bool SetDispersionCoefficients(const float *coefficients, int length)=0
Set the dispersion coefficients.
virtual bool FlipHorizontal(unsigned short *data, int width, int height) const =0
Flips an array (image) around its vertical axis.
virtual bool ConvertSpectralDataToPhaseIntensity(IWPOCTInOutData *inOutData)=0
Converts raw spectral data to intensity and phase arrays.
virtual bool GetUseContrast() const =0
Get the flag that determines if contrast is used on the output.
virtual int GetMovingAverageWindowSize() const =0
Gets the window size of the moving average.
virtual bool SetQualifiedInputFileName(const char *name)=0
Sets the fully qualified file name (includes path) of the raw spectral data to be converted.
virtual bool GetUseScaling() const =0
Get the flag that determines if scaling is used on the output.
virtual bool ConvertFloatToUnsignedChar(const float *inData, unsigned char *outData, int size) const =0
Converts an array of float data to unsigned char data.
The data object contains pointers to input and output data.
Definition: IWPOCTInOutData.h:14