public static GeometricShuttersGraphic CreateGeometricShuttersGraphic(DisplayShutterMacroIod shutterModule, int imageRows, int imageColumns) { GeometricShuttersGraphic shuttersGraphic = new GeometricShuttersGraphic(imageRows, imageColumns); if ((shutterModule.ShutterShape & ShutterShape.Circular) == ShutterShape.Circular) { Point?center = shutterModule.CenterOfCircularShutter; int? radius = shutterModule.RadiusOfCircularShutter; if (center != null && radius != null) { shuttersGraphic.AddDicomShutter(new CircularShutter(center.Value, radius.Value)); } } if ((shutterModule.ShutterShape & ShutterShape.Rectangular) == ShutterShape.Rectangular) { int?left = shutterModule.ShutterLeftVerticalEdge; int?right = shutterModule.ShutterRightVerticalEdge; int?top = shutterModule.ShutterUpperHorizontalEdge; int?bottom = shutterModule.ShutterLowerHorizontalEdge; if (left != null && right != null && top != null && bottom != null) { shuttersGraphic.AddDicomShutter(new RectangularShutter(left.Value, right.Value, top.Value, bottom.Value)); } } if ((shutterModule.ShutterShape & ShutterShape.Polygonal) == ShutterShape.Polygonal) { Point[] points = shutterModule.VerticesOfThePolygonalShutter; shuttersGraphic.AddDicomShutter(new PolygonalShutter(points)); } return(shuttersGraphic); }
public static GeometricShuttersGraphic CreateGeometricShuttersGraphic(Frame frame) { //TODO: you can actually have shutters defined per-frame, but right now we don't support per-frame data. DisplayShutterMacroIod shutterIod = new DisplayShutterMacroIod(frame.ParentImageSop.DataSource); return(CreateGeometricShuttersGraphic(shutterIod, frame.Rows, frame.Columns)); }
public static GeometricShuttersGraphic CreateGeometricShuttersGraphic(Frame frame) { DisplayShutterMacroIod shutterIod = new DisplayShutterMacroIod(frame); return(CreateGeometricShuttersGraphic(shutterIod, frame.Rows, frame.Columns)); }