EIMInterfaceDLL.h 5.2 KB

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