| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- #ifndef _EIMinterfaceDLL_h_
- #define _EIMinterfaceDLL_h_
- #include "EIMResult.h"
- #ifdef WIN32
- #ifdef MATH_DLL_EXPORTS
- #define IMPORTEXPORT __declspec(dllexport)
- #else
- #define IMPORTEXPORT __declspec(dllimport)
- #endif
- #else
- #define IMPORTEXPORT
- #endif
- namespace imt
- {
- extern "C"
- {
- //========================================================
- // ========= Loading the image into memory ===================
- //========================================================
- /** @brief Loads an ultrasound image from a DICOM file.
- Files must conform to Dicom 3 Part 10. Currently only one B-mode region per Dicom file is supported.
-
- @param fileName A zero-terminated string containing the absolute file path.
- @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.
- @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.
- @return TRUE on success and FALSE if the file could not be loaded.
- @throws No exception are thrown.
- **/
- IMPORTEXPORT bool initializeFromFile( const char* fileName, double mmPerPixelX = -1.0, double mmPerPixelY = -1.0 );
- /** @brief Loads an image from a pixel array.
- When dealing with bitmaps, the calling application needs to load the image using an appropriate GUI library
- (e.g. CImage object from ATL/MFC on Windows, QImage object from Qt on Linux).
- @param pixelArray The pixel array containing the image to load.
- @param width Width of the image (in pixels).
- @param height Height of the image (in pixels).
- @param bitsPerPixel Number of bits used per pixel in the array. The only supported values are 8, 24 and 32.
- @param upsideDown TRUE if the array defines a bottom-up image, otherwise FALSE.
- @param mmPerPixelX The pixel size in X coordinates (in mm) used for image calibration.
- @param mmPerPixelY The pixel size in Y coordinates (in mm) used for image calibration.
- @return TRUE on success and FALSE if calibrations are not valid or bitsPerPixel has unsupported value.
- @throws No exception are thrown.
- **/
- IMPORTEXPORT bool initializeFromRaw( const char* pixelArray, int width, int height, int bitsPerPixel, bool upsideDown, double mmPerPixelX, double mmPerPixelY );
- //========================================================
- // ========= Performing the measurement=====================
- //========================================================
- /**
- @brief Sets the first delimiter point specifying the measurement segment.
- @param x Pixel X coordinates of the point in the image (generally a mouse click position).
- @param y Pixel Y coordinates of the point in the image (generally a mouse click position).
- @return TRUE if there’s a valid loaded image – otherwise FALSE.
- @throws No exception are thrown.
- **/
- IMPORTEXPORT bool setFirstPoint( int x, int y );
- /**
- @brief Returns the distance (in mm) between the first segment point and a specified point.
- @param x Pixel X coordinates of the point in the image (generally a mouse click position).
- @param y Pixel Y coordinates of the point in the image (generally a mouse click position).
- @return The current distance between the two points in millimeters.
- @throws No exception are thrown.
- **/
- IMPORTEXPORT float getDistanceToFirstPoint( int x, int y );
- /**
- @brief Sets the second point of the user defined segment, triggers the calculation and fills parameter result with the measurement results.
- @param x Pixel X coordinates of the point in the image (generally a mouse click position).
- @param y Pixel Y coordinates of the point in the image (generally a mouse click position).
- @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.
- @return TRUE if there’s a valid loaded image – otherwise FALSE.
- @throws No exception are thrown.
- **/
- IMPORTEXPORT bool setSecondPoint( int x, int y, IMTResult* result );
-
- //========================================================
- // ========= Retrieving the loaded image from memory ==========
- //========================================================
- /**
- @brief Returns the width of the loaded image in pixels.
- @throws No exception are thrown.
- **/
- IMPORTEXPORT int getImageWidth();
- /**
- @brief Returns the height of the loaded image in pixels.
- @throws No exception are thrown.
- **/
- IMPORTEXPORT int getImageHeight();
- /**
- @brief Returns the number of bits each pixel of the loaded Image occupies.
- @throws No exception are thrown.
- **/
- IMPORTEXPORT int getImageBitsPerPixel();
- /**
- @brief Returns pointer to the pixel array of the image contained in the library.
- It may be used to display the ultrasound image in the user’s application.
- @return Depending on the initialization method used, this pointer either points to the DICOM pixel array allocated internally, or to the bitmap pixel array allocated by the calling application.
- @throws No exception are thrown.
- **/
- IMPORTEXPORT char* getPixelArray();
- }
- }
- #endif
|