StenoseInterfaceDLL.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #include "StenoseInterfaceDLL.h"
  2. #include "StenoseInterface.h"
  3. #include "CStenoseResult.h"
  4. #include "StenoseResult.h"
  5. #include "../Object/point.h"
  6. bool stenose::initializeFromFile( const char* fileName, double mmPerPixelX, double mmPerPixelY )
  7. {
  8. return StenoseInterface::getInstance().initialize( fileName, mmPerPixelX, mmPerPixelY );
  9. }
  10. bool stenose::initializeFromRaw( const char* pixelArray, int width, int height, int bitsPerPixel, bool upsideDown, double mmPerPixelX, double mmPerPixelY )
  11. {
  12. return StenoseInterface::getInstance().initialize( pixelArray, width, height, bitsPerPixel, upsideDown, mmPerPixelX, mmPerPixelY );
  13. }
  14. bool stenose::Threshold_2(int iMax, int left, int top, int right, int bottom, int ptx, int pty, stenose::StenoseNBResult* result )
  15. {
  16. bool status;
  17. if ( !result )
  18. {
  19. return false;
  20. }
  21. CStenoseResult stenose_result;
  22. status = StenoseInterface::getInstance().Threshold_2( iMax, left, top, right, bottom, ptx, pty, &stenose_result );
  23. status = stenose_result.fillNB( result );
  24. return status;
  25. }
  26. bool stenose::Measure( int left, int top, int right, int bottom, stenose::StenoseResult* result )
  27. {
  28. if ( !result )
  29. {
  30. return false;
  31. }
  32. CStenoseResult stenose_result;
  33. bool status = StenoseInterface::getInstance().Measure( left, top, right, bottom, &stenose_result );
  34. stenose_result.fill( result );
  35. return status;
  36. }
  37. int stenose::getImageWidth()
  38. {
  39. return StenoseInterface::getInstance().getImageWidth();
  40. }
  41. int stenose::getImageHeight()
  42. {
  43. return StenoseInterface::getInstance().getImageHeight();
  44. }
  45. int stenose::getImageBitsPerPixel()
  46. {
  47. return StenoseInterface::getInstance().getImageBitsPerPixel();
  48. }
  49. char* stenose::getPixelArray()
  50. {
  51. return StenoseInterface::getInstance().getPixelArray();
  52. }