using AI.DiagSystem; using AI.Reconstruction; using System; using System.Collections.Generic; using System.Text; using System.Drawing; namespace Reconstruction3DHelper { public struct ReportInfos { // 内中膜前壁结果 public IntimaProperty AntIntima; // 内中膜后壁结果 public IntimaProperty PostIntima; // 内中膜切面中的三维点 public List IntimaClipPoints; // 斑块结果 public PlaqueResult PlaqueResult; } /// /// 颈动脉识别,斑块与内膜的结果,用于出报告 /// public class CarotidReportHelper { public CarotidReportHelper() { } public ReportInfos GetCarotidReportInfos(RawVolumeData carotidData, SliceHelper sliceHelper, float physicalPerPixel) { // 检测模型中的颈动脉管壁和斑块,并返回最优长轴切面信息 PlaqueDetectHelper plaqueDetectorHelper = new PlaqueDetectHelper(EnumPerformance.Low); var vesselsAndPlaques = plaqueDetectorHelper.DetectPlaquesInVolumeData(carotidData.DataBuffer, carotidData.Width, carotidData.Depth, carotidData.ImageCount, carotidData.ColorType); var planePoint3D = plaqueDetectorHelper.GetClipPoints(vesselsAndPlaques, sliceHelper.GetModelSize()); //计算斑块特征 PlaquePostProcessHelper plaqueHelper = new PlaquePostProcessHelper(); var plaqueResult = plaqueHelper.CalcPlaqueProperty(sliceHelper.GetModelData(), sliceHelper.GetModelSize(), physicalPerPixel, vesselsAndPlaques); //计算内中膜厚度 bool enableAnt = true; //上内膜使能 bool enablePost = true; //下内膜使能 var clipImage = sliceHelper.GetMeasureImage(planePoint3D, out int imageWidth, out int imageHeight); IntimaHelper intimaHelper = new IntimaHelper(); var intimaResult = intimaHelper.DetectIntima(clipImage, imageWidth, imageHeight, physicalPerPixel, enableAnt, enablePost); ReportInfos reportInfos = new ReportInfos(); reportInfos.AntIntima = intimaResult.AntIntima; reportInfos.PostIntima = intimaResult.PostIntima; reportInfos.IntimaClipPoints = planePoint3D; reportInfos.PlaqueResult = plaqueResult; return reportInfos; } } }