PlaqueInterfaceDLL - Copie.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #ifndef _PlaqueinterfaceDLL_h_
  2. #define _PlaqueinterfaceDLL_h_
  3. #include "PlaqueResult.h"
  4. #include "../Object/point.h"
  5. #include <vector>
  6. using namespace std;
  7. #ifdef WIN32
  8. #ifdef MATH_DLL_EXPORTS
  9. #define IMPORTEXPORT __declspec(dllexport)
  10. #else
  11. #define IMPORTEXPORT __declspec(dllimport)
  12. #endif
  13. #else
  14. #define IMPORTEXPORT
  15. #endif
  16. namespace plaque
  17. {
  18. extern "C"
  19. {
  20. //========================================================
  21. // ========= Loading the image into memory ===================
  22. //========================================================
  23. /** @brief Loads image from a DICOM file.
  24. TODO - Specify which type of Dicom files may be used here (2D ultrasound bmode single image?).
  25. @param fileName A zero-terminated string containing the absolute file path.
  26. @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.
  27. @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.
  28. @return TRUE on success and FALSE if the file could not be loaded.
  29. @throws TODO - add info on possible exceptions here
  30. **/
  31. IMPORTEXPORT bool initializeFromFile( const char* fileName, double mmPerPixelX = -1.0, double mmPerPixelY = -1.0 ); // For Dicom files only
  32. /** @brief Loads an image from a pixel array.
  33. TODO - Specify the structure of the array!
  34. @param pixelArray The pixel array containing the image to load.
  35. @param width Width of the image (in pixels).
  36. @param height Height of the image (in pixels).
  37. @param bitsPerPixel Number of bits used per pixel in the array. The only supported values are 8, 24 and 32.
  38. @param upsideDown TRUE if the array defines a bottom-up image, otherwise FALSE.
  39. @param mmPerPixelX The pixel size in X coordinates (in mm) used for image calibration.
  40. @param mmPerPixelY The pixel size in Y coordinates (in mm) used for image calibration.
  41. @return TRUE on success and FALSE if calibrations are not valid or bitsPerPixel has unsupported value.
  42. @throws TODO - add info on possible exceptions here
  43. **/
  44. IMPORTEXPORT bool initializeFromRaw( const char* pixelArray, int width, int height, int bitsPerPixel, bool upsideDown, double mmPerPixelX, double mmPerPixelY );
  45. //========================================================
  46. // ========= Performing the measurement=====================
  47. //========================================================
  48. /**
  49. @brief Sets the second point of the user defined segment, triggers the calculation and fills parameter result with the measurement results.
  50. @param x Pixel X coordinates of the point in the image (generally a mouse click position).
  51. @param y Pixel Y coordinates of the point in the image (generally a mouse click position).
  52. @param result Pointer to a result container provided by the calling application. The memory allocated for this pointer needs to be free’d by the calling application.
  53. @return TRUE if there’s a valid loaded image – otherwise FALSE.
  54. @throws TODO - add info on possible exceptions here
  55. **/
  56. IMPORTEXPORT bool OnLButtonUp( int x, int y, PlaqueResult* result );
  57. IMPORTEXPORT int computePlaque( int x, int y, int nbPts, unsigned char *points, PlaqueResult* result, int seuil1, int seuil2 );
  58. IMPORTEXPORT int fonctionDebug( PlaqueResult* result );
  59. IMPORTEXPORT int CalculerPlaqueManuelle( int nbPts, unsigned char *points, PlaqueResult* result );
  60. /**
  61. @brief Returns the distance (in mm) between the first segment point and a specified point.
  62. @param x Pixel X coordinates of the point in the image (generally a mouse click position).
  63. @param y Pixel Y coordinates of the point in the image (generally a mouse click position).
  64. @return The current distance between the two points in millimeters.
  65. @throws TODO - add info on possible exceptions here
  66. **/
  67. IMPORTEXPORT float getDistanceToFirstPoint( int x, int y, int x0, int y0 );
  68. //========================================================
  69. // ========= Retrieving the loaded image from memory ==========
  70. //========================================================
  71. /**
  72. @brief Returns the width of the loaded image in pixels.
  73. @throws TODO - add info on possible exceptions here
  74. **/
  75. IMPORTEXPORT int getImageWidth();
  76. /**
  77. @brief Returns the height of the loaded image in pixels.
  78. @throws TODO - add info on possible exceptions here
  79. **/
  80. IMPORTEXPORT int getImageHeight();
  81. /**
  82. @brief Returns the number of bits each pixel of the loaded Image occupies.
  83. @throws TODO - add info on possible exceptions here
  84. **/
  85. IMPORTEXPORT int getImageBitsPerPixel();
  86. /**
  87. @brief Returns a pixel array representing the loaded image (e.g. via. call to imt::initializeFromFile).
  88. @return TODO - Specify the structure of the array!
  89. @throws TODO - add info on possible exceptions here
  90. **/
  91. IMPORTEXPORT char* getPixelArray(); // to retrieve pixel array of Dicom files ; or equal to pixelArray passed to initializeFromRaw()
  92. }
  93. }
  94. #endif