Exemple #1
0
        static void DrawDVH(DVHPlot.ViewModel.MainWindowModel viewModel, VMS.TPS.Common.Model.API.PlanSetup curps)
        {
            StructureSet structureSet = curps.StructureSet;

            foreach (var structure in structureSet.Structures)
            {
                DVHData dvhData = curps.GetDVHCumulativeData(structure,
                                                             DoseValuePresentation.Absolute,
                                                             VolumePresentation.Relative, 1);
                OxyPlot.OxyColor   color  = new OxyPlot.OxyColor();
                OxyPlot.MarkerType marker = new OxyPlot.MarkerType();
                viewModel.AddData(dvhData, structure.Id, color, marker);
            }
        }
        internal void AddSeries(OxyPlot.MarkerType showType, OxyPlot.OxyColor color, string title, List <double> X, List <double> Y)
        {
            OxyPlot.Series.LineSeries seriesPoints = new OxyPlot.Series.LineSeries
            {
                MarkerType   = showType,
                MarkerSize   = 9,
                MarkerStroke = chartColors[1],
                Title        = title
            };

            for (int n = 0; n < X.Count; n++)
            {
                seriesPoints.Points.Add(new OxyPlot.DataPoint(X[n], Y[n]));
            }

            plotModel.Series.Add(seriesPoints);
        }
        public PlotWindow(List <List <double> > results)
        {
            var plotModel = new OxyPlot.PlotModel();

            plotModel.Title          = "Cats And Dogs";
            plotModel.LegendPosition = OxyPlot.LegendPosition.BottomRight;

            plotModel.Axes.Add(new OxyPlot.Axes.LinearAxis()
            {
                Position = OxyPlot.Axes.AxisPosition.Left,
                Title    = "Accuracy",
                Minimum  = 0,
                Maximum  = 1,
            });
            plotModel.Axes.Add(new OxyPlot.Axes.LinearAxis()
            {
                Position = OxyPlot.Axes.AxisPosition.Bottom,
                Minimum  = 0,
                Maximum  = results[0].Count + 1,
                Title    = "Epochs"
            });

            var labels      = new string[] { "Train Set", "Validation Set" };
            var markerTypes = new OxyPlot.MarkerType[] { OxyPlot.MarkerType.Plus, OxyPlot.MarkerType.Circle };

            for (int row = 0; row < results.Count; row++)
            {
                var scatterSeries = new OxyPlot.Series.ScatterSeries()
                {
                    MarkerType   = markerTypes[row],
                    MarkerStroke = OxyPlot.OxyColors.Blue,
                    MarkerFill   = OxyPlot.OxyColors.Black
                };
                scatterSeries.ItemsSource = results[row].Select((value, index) => new OxyPlot.Series.ScatterPoint(index + 1, value));
                scatterSeries.Title       = labels[row];
                plotModel.Series.Add(scatterSeries);
            }

            var plotView = new OxyPlot.Wpf.PlotView();

            plotView.Model = plotModel;

            Title   = "Chart";
            Content = plotView;
        }
Exemple #4
0
        public PlotWindow(List <List <double> > results)
        {
            var plotModel = new OxyPlot.PlotModel();

            plotModel.Title = "Overfitting and Underfitting";

            plotModel.Axes.Add(new OxyPlot.Axes.LinearAxis()
            {
                Position = OxyPlot.Axes.AxisPosition.Left,
                Title    = "Validation Loss",
                Minimum  = 0,
                Maximum  = 1,
            });
            plotModel.Axes.Add(new OxyPlot.Axes.LinearAxis()
            {
                Position = OxyPlot.Axes.AxisPosition.Bottom,
                Minimum  = 0,
                Maximum  = results[0].Count + 1,
                Title    = "Epochs"
            });

            var labels      = new string[] { "Original Model", "Dropout-regularized model" };
            var markerTypes = new OxyPlot.MarkerType[] { OxyPlot.MarkerType.Plus, OxyPlot.MarkerType.Circle };

            for (int row = 0; row < results.Count; row++)
            {
                var scatterSeries = new OxyPlot.Series.ScatterSeries()
                {
                    MarkerType   = markerTypes[row],
                    MarkerStroke = OxyPlot.OxyColors.Blue,
                    MarkerFill   = OxyPlot.OxyColors.Blue
                };
                scatterSeries.ItemsSource = results[row].Select((value, index) => new OxyPlot.Series.ScatterPoint(index + 1, value));
                scatterSeries.Title       = labels[row];
                plotModel.Series.Add(scatterSeries);
            }

            var plotView = new OxyPlot.Wpf.PlotView();

            plotView.Model = plotModel;

            Title   = "Chart";
            Content = plotView;
        }