StenoseInterfaceDLL.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #ifndef _StenoseinterfaceDLL_h_
  2. #define _StenoseinterfaceDLL_h_
  3. #include "StenoseResult.h"
  4. #ifdef WIN32
  5. #ifdef MATH_DLL_EXPORTS
  6. #define IMPORTEXPORT __declspec(dllexport)
  7. #else
  8. #define IMPORTEXPORT __declspec(dllimport)
  9. #endif
  10. #else
  11. #define IMPORTEXPORT
  12. #endif
  13. namespace stenose
  14. {
  15. extern "C"
  16. {
  17. //========================================================
  18. // ========= Loading the image into memory ===================
  19. //========================================================
  20. /** @brief Loads image from a DICOM file.
  21. TODO - Specify which type of Dicom files may be used here (2D ultrasound bmode single image?).
  22. @param fileName A zero-terminated string containing the absolute file path.
  23. @param mmPerPixelX The pixel size in X coordinates (in mm) used for image calibration. Optional parameter - if you use the default value (-1.0) then the calibration information provided in the DICOM file is applied.
  24. @param mmPerPixelY The pixel size in Y coordinates (in mm) used for image calibration. Optional parameter - if you use the default value (-1.0) then the calibration information provided in the DICOM file is applied.
  25. @return TRUE on success and FALSE if the file could not be loaded.
  26. @throws TODO - add info on possible exceptions here
  27. **/
  28. IMPORTEXPORT bool initializeFromFile( const char* fileName, double mmPerPixelX = -1.0, double mmPerPixelY = -1.0 ); // For Dicom files only
  29. /** @brief Loads an image from a pixel array.
  30. TODO - Specify the structure of the array!
  31. @param pixelArray The pixel array containing the image to load.
  32. @param width Width of the image (in pixels).
  33. @param height Height of the image (in pixels).
  34. @param bitsPerPixel Number of bits used per pixel in the array. The only supported values are 8, 24 and 32.
  35. @param upsideDown TRUE if the array defines a bottom-up image, otherwise FALSE.
  36. @param mmPerPixelX The pixel size in X coordinates (in mm) used for image calibration.
  37. @param mmPerPixelY The pixel size in Y coordinates (in mm) used for image calibration.
  38. @return TRUE on success and FALSE if calibrations are not valid or bitsPerPixel has unsupported value.
  39. @throws TODO - add info on possible exceptions here
  40. **/
  41. IMPORTEXPORT bool initializeFromRaw( const char* pixelArray, int width, int height, int bitsPerPixel, bool upsideDown, double mmPerPixelX, double mmPerPixelY );
  42. //========================================================
  43. // ========= Performing the measurement=====================
  44. //========================================================
  45. /**
  46. @brief Sets the first point of the user defined segment.
  47. @param x Pixel X coordinates of the point in the image (generally a mouse click position).
  48. @param y Pixel Y coordinates of the point in the image (generally a mouse click position).
  49. @return TRUE if there’s a valid loaded image – otherwise FALSE.
  50. @throws TODO - add info on possible exceptions here
  51. **/
  52. IMPORTEXPORT bool Threshold_2( int iMax, int left, int top, int right, int bottom, int ptx, int pty, StenoseNBResult* result );
  53. /**
  54. @brief Returns the distance (in mm) between the first segment point and a specified point.
  55. @param x Pixel X coordinates of the point in the image (generally a mouse click position).
  56. @param y Pixel Y coordinates of the point in the image (generally a mouse click position).
  57. @return The current distance between the two points in millimeters.
  58. @throws TODO - add info on possible exceptions here
  59. **/
  60. IMPORTEXPORT bool Measure( int left, int top, int right, int bottom, StenoseResult* result );
  61. //========================================================
  62. // ========= Retrieving the loaded image from memory ==========
  63. //========================================================
  64. /**
  65. @brief Returns the width of the loaded image in pixels.
  66. @throws TODO - add info on possible exceptions here
  67. **/
  68. IMPORTEXPORT int getImageWidth();
  69. /**
  70. @brief Returns the height of the loaded image in pixels.
  71. @throws TODO - add info on possible exceptions here
  72. **/
  73. IMPORTEXPORT int getImageHeight();
  74. /**
  75. @brief Returns the number of bits each pixel of the loaded Image occupies.
  76. @throws TODO - add info on possible exceptions here
  77. **/
  78. IMPORTEXPORT int getImageBitsPerPixel();
  79. /**
  80. @brief Returns a pixel array representing the loaded image (e.g. via. call to imt::initializeFromFile).
  81. @return TODO - Specify the structure of the array!
  82. @throws TODO - add info on possible exceptions here
  83. **/
  84. IMPORTEXPORT char* getPixelArray(); // to retrieve pixel array of Dicom files ; or equal to pixelArray passed to initializeFromRaw()
  85. }
  86. }
  87. #endif