#ifndef _PlaqueinterfaceDLL_h_ #define _PlaqueinterfaceDLL_h_ #include "PlaqueResult.h" #include "../Object/point.h" #include using namespace std; #ifdef WIN32 #ifdef MATH_DLL_EXPORTS #define IMPORTEXPORT __declspec(dllexport) #else #define IMPORTEXPORT __declspec(dllimport) #endif #else #define IMPORTEXPORT #endif namespace plaque { extern "C" { //======================================================== // ========= Loading the image into memory =================== //======================================================== /** @brief Loads image from a DICOM file. TODO - Specify which type of Dicom files may be used here (2D ultrasound bmode single image?). @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 TODO - add info on possible exceptions here **/ IMPORTEXPORT bool initializeFromFile( const char* fileName, double mmPerPixelX = -1.0, double mmPerPixelY = -1.0 ); // For Dicom files only /** @brief Loads an image from a pixel array. TODO - Specify the structure of the array! @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 TODO - add info on possible exceptions here **/ IMPORTEXPORT bool initializeFromRaw( const char* pixelArray, int width, int height, int bitsPerPixel, bool upsideDown, double mmPerPixelX, double mmPerPixelY ); //======================================================== // ========= Performing the measurement===================== //======================================================== /** @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 TODO - add info on possible exceptions here **/ IMPORTEXPORT bool OnLButtonUp( int x, int y, PlaqueResult* result ); IMPORTEXPORT int computePlaque( int x, int y, int nbPts, unsigned char *points, PlaqueResult* result, int seuil1, int seuil2 ); IMPORTEXPORT int fonctionDebug( PlaqueResult* result ); IMPORTEXPORT int CalculerPlaqueManuelle( int nbPts, unsigned char *points, PlaqueResult* result ); /** @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 TODO - add info on possible exceptions here **/ IMPORTEXPORT float getDistanceToFirstPoint( int x, int y, int x0, int y0 ); //======================================================== // ========= Retrieving the loaded image from memory ========== //======================================================== /** @brief Returns the width of the loaded image in pixels. @throws TODO - add info on possible exceptions here **/ IMPORTEXPORT int getImageWidth(); /** @brief Returns the height of the loaded image in pixels. @throws TODO - add info on possible exceptions here **/ IMPORTEXPORT int getImageHeight(); /** @brief Returns the number of bits each pixel of the loaded Image occupies. @throws TODO - add info on possible exceptions here **/ IMPORTEXPORT int getImageBitsPerPixel(); /** @brief Returns a pixel array representing the loaded image (e.g. via. call to imt::initializeFromFile). @return TODO - Specify the structure of the array! @throws TODO - add info on possible exceptions here **/ IMPORTEXPORT char* getPixelArray(); // to retrieve pixel array of Dicom files ; or equal to pixelArray passed to initializeFromRaw() } } #endif