SliceHelper.h 820 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #pragma once
  2. #include "Common.h"
  3. enum SurfacePicType
  4. {
  5. Right,
  6. Left,
  7. Behind,
  8. Front,
  9. Top,
  10. Bottom,
  11. };
  12. typedef struct
  13. {
  14. SurfacePicType surfaceType;
  15. ImageInfo imgInfo;
  16. }SurfacePicInfo;
  17. enum AxisName
  18. {
  19. X,
  20. Y,
  21. Z,
  22. };
  23. class SliceHelper
  24. {
  25. public:
  26. SliceHelper();
  27. ~SliceHelper();
  28. void LoadVolumeData(UniformVolumeDataInfo volumeDataInfo);
  29. bool VolumeDataLoaded();
  30. int GetMaximumImgByteCounts();
  31. void GetSlicePlaneImage(Plane plane,ImageInfo& imageInfo);
  32. void GetVerticalToAxisSlicePlaneImage(AxisName axisName,int intersectionVal,ImageInfo& imageInfo);
  33. void ImgFlipAndRotate(ImageInfo srcImgInfo, const int srcDataSize, cv::Mat& imgDst);
  34. private:
  35. bool _dataLoaded;
  36. uint8_t* _volumeData;
  37. int _x;
  38. int _y;
  39. int _z;
  40. float _spacing;
  41. ColorType _colorType;
  42. int _dataByteCounts;
  43. int _bytesPerPixel;
  44. };