CarotidReportHelper.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using AI.DiagSystem;
  2. using AI.Reconstruction;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. using System.Drawing;
  7. namespace Reconstruction3DHelper
  8. {
  9. public struct ReportInfos
  10. {
  11. // 内中膜前壁结果
  12. public IntimaProperty AntIntima;
  13. // 内中膜后壁结果
  14. public IntimaProperty PostIntima;
  15. // 内中膜切面中的三维点
  16. public List<Point3DF> IntimaClipPoints;
  17. // 斑块结果
  18. public PlaqueResult PlaqueResult;
  19. }
  20. /// <summary>
  21. /// 颈动脉识别,斑块与内膜的结果,用于出报告
  22. /// </summary>
  23. public class CarotidReportHelper
  24. {
  25. public CarotidReportHelper()
  26. {
  27. }
  28. public ReportInfos GetCarotidReportInfos(RawVolumeData carotidData, SliceHelper sliceHelper, float physicalPerPixel)
  29. {
  30. // 检测模型中的颈动脉管壁和斑块,并返回最优长轴切面信息
  31. PlaqueDetectHelper plaqueDetectorHelper = new PlaqueDetectHelper(EnumPerformance.Low);
  32. var vesselsAndPlaques = plaqueDetectorHelper.DetectPlaquesInVolumeData(carotidData.DataBuffer, carotidData.Width,
  33. carotidData.Depth, carotidData.ImageCount, carotidData.ColorType);
  34. var planePoint3D = plaqueDetectorHelper.GetClipPoints(vesselsAndPlaques, sliceHelper.GetModelSize());
  35. //计算斑块特征
  36. PlaquePostProcessHelper plaqueHelper = new PlaquePostProcessHelper();
  37. var plaqueResult = plaqueHelper.CalcPlaqueProperty(sliceHelper.GetModelData(),
  38. sliceHelper.GetModelSize(),
  39. physicalPerPixel,
  40. vesselsAndPlaques);
  41. //计算内中膜厚度
  42. bool enableAnt = true; //上内膜使能
  43. bool enablePost = true; //下内膜使能
  44. var clipImage = sliceHelper.GetMeasureImage(planePoint3D, out int imageWidth, out int imageHeight);
  45. IntimaHelper intimaHelper = new IntimaHelper();
  46. var intimaResult = intimaHelper.DetectIntima(clipImage, imageWidth, imageHeight, physicalPerPixel, enableAnt, enablePost);
  47. ReportInfos reportInfos = new ReportInfos();
  48. reportInfos.AntIntima = intimaResult.AntIntima;
  49. reportInfos.PostIntima = intimaResult.PostIntima;
  50. reportInfos.IntimaClipPoints = planePoint3D;
  51. reportInfos.PlaqueResult = plaqueResult;
  52. return reportInfos;
  53. }
  54. }
  55. }