当前位置: 首页>>代码示例>>C#>>正文


C# Structure.IsPointInsideSegment方法代码示例

本文整理汇总了C#中Structure.IsPointInsideSegment方法的典型用法代码示例。如果您正苦于以下问题:C# Structure.IsPointInsideSegment方法的具体用法?C# Structure.IsPointInsideSegment怎么用?C# Structure.IsPointInsideSegment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Structure的用法示例。


在下文中一共展示了Structure.IsPointInsideSegment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetSliceArea

 /// <summary>
 /// Calculates the slice area inside of a contour definition for a given slice Z
 /// </summary>
 private static double GetSliceArea(Image image, int sliceZ, Structure psoas)
 {
     var area = double.NaN;
     var contour = psoas.GetContoursOnImagePlane(sliceZ);
     if (contour.Count() > 0)
     {
         var inside = 0;
         for (int x = 0; x < image.XSize; x++)
         {
             for (int y = 0; y < image.XSize; y++)
             {
                 var dx = (x * image.XRes * image.XDirection + image.Origin).x;
                 var dy = (y * image.YRes * image.YDirection + image.Origin).y;
                 var dz = (sliceZ * image.ZRes * image.ZDirection + image.Origin).z;
                 if (psoas.IsPointInsideSegment(new VVector(dx, dy, dz)))
                 {
                     inside++;
                 }
             }
         }
         var vxArea = image.XRes / 10 * image.YRes / 10;
         var contourArea = inside * vxArea;
         area = contourArea;
     }
     return area;
 }
开发者ID:rexcardan,项目名称:AverageHU_ESAPI,代码行数:29,代码来源:PlaneStatisticsPlugin.cs

示例2: GetSliceHUAvg

 /// <summary>
 /// For a given slice, and structure this will return the average hounsfield unit inside the contour
 /// </summary>
 private static double GetSliceHUAvg(Image image, int sliceZ, Structure structr)
 {
     var contour = structr.GetContoursOnImagePlane(sliceZ);
     if (contour.Count() > 0)
     {
         int[,] buffer = new int[image.XSize, image.YSize];
         List<double> hus = new List<double>();
         image.GetVoxels(sliceZ, buffer);
         for (int x = 0; x < image.XSize; x++)
         {
             for (int y = 0; y < image.XSize; y++)
             {
                 var dx = (x * image.XRes * image.XDirection + image.Origin).x;
                 var dy = (y * image.YRes * image.YDirection + image.Origin).y;
                 var dz = (sliceZ * image.ZRes * image.ZDirection + image.Origin).z;
                 if (structr.IsPointInsideSegment(new VVector(dx, dy, dz)))
                 {
                     var voxel = buffer[x, y];
                     hus.Add(image.VoxelToDisplayValue(voxel));
                 }
             }
         }
         return hus.Average();
     }
     return double.NaN;
 }
开发者ID:rexcardan,项目名称:AverageHU_ESAPI,代码行数:29,代码来源:PlaneStatisticsPlugin.cs


注:本文中的Structure.IsPointInsideSegment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。