Ejemplo n.º 1
0
        public AlignmentViewModel(AlignmentData alignment)
        {
            this.WindowTitle = string.Format("{0} Alignment Data", alignment.AligneeDataset);

            var plots = new AlignmentPlotCreator(alignment);

            this.HeatmapImage  = ImageConverter.ConvertImage(PlotImageUtility.CreateImage(plots.Heatmap));
            this.NetScanImage  = ImageConverter.ConvertImage(PlotImageUtility.CreateImage(plots.NetResidual));
            this.MassHistogram = ImageConverter.ConvertImage(PlotImageUtility.CreateImage(plots.MassHistogram));
            this.NetHistogram  = ImageConverter.ConvertImage(PlotImageUtility.CreateImage(plots.NetHistogram));
            this.MassMzImage   = ImageConverter.ConvertImage(PlotImageUtility.CreateImage(plots.MassMzResidual));
            this.MassScanImage = ImageConverter.ConvertImage(PlotImageUtility.CreateImage(plots.MassScanResidual));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Save alignment plots for the selected datasets.
        /// </summary>
        private void SaveAlignmentPlots()
        {
            foreach (var file in (this.Datasets.Where(x => x.IsSelected && x.IsAligned))) //x => x.IsAligned && !x.Dataset.IsBaseline
            {
                var alignment = this.alignmentInformation.Find(x => x.DatasetID == file.DatasetId);
                if (alignment != null)
                {
                    var plots = new AlignmentPlotCreator(alignment);

                    var dirPath = System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), file.Name);
                    if (!System.IO.Directory.Exists(dirPath))
                    {
                        System.IO.Directory.CreateDirectory(dirPath);
                    }
                    var path = System.IO.Path.Combine(dirPath, "Alignment_");

                    plots.SavePlots(path, this.ImageWidth, this.ImageHeight, this.ImageDpi);
                }
                else
                {
                    MessageBox.Show(String.Format("No alignment plots to save for {0}", file.Dataset.DatasetName));
                }
            }
        }