private void FormatRoiAccordingToGroup(Roi roi, RoiCollection collection)
 {
     roi.FillColor   = collection.FillColor;
     roi.BorderColor = collection.BorderColor;
     if (collection.CurrentUiBorderThickness > 0)
     {
         roi.BorderThickness = collection.CurrentUiBorderThickness;
     }
     else
     {
         roi.BorderThickness = collection.BorderThickness;
     }
 }
        public void AddRoisToMaskBitmapSource(RoiCollection rois)
        {
            DrawingVisual  drawingVisual  = new DrawingVisual();
            DrawingContext drawingContext = drawingVisual.RenderOpen();

            foreach (var roi in rois)
            {
                System.Windows.Rect rotated = GetRotatedRect(roi);

                drawingContext.DrawRectangle(new SolidColorBrush(roi.FillColor), null, rotated);
            }

            drawingContext.Close();
            this.MaskBitmapSource.Render(drawingVisual);
        }
 private void ResizeBorderThicknessRoiAccordingToGroup(Roi roi, RoiCollection collection, double scale)
 {
     collection.CurrentUiBorderThickness = collection.BorderThickness / scale;
     roi.BorderThickness = collection.CurrentUiBorderThickness;
 }