Ejemplo n.º 1
0
        /// <summary>
        /// Demonstrates the DVH mining capabilities of ESAPIX. Writes DVH data to file.
        /// </summary>
        public static void DVHMinerDemo()
        {
            var sac = new StandAloneContext(() => V.Application.CreateApplication());

            var miner = new Miner();

            miner.Logger.LogRequested += (msg) => { Console.WriteLine(msg); };
            miner.IncludePlanSums      = true;
            miner.IncludeDVH(new DVHParams());
            //Find the structure set with the closest string match to the input (doesn't have to be exact)
            miner.SetStructureSetFilter("RSCH_Brain Dos", MatchType.CLOSEST_MATCH);

            //Add ids to miner
            CsvFile.Read(@"..\Desktop\patientIds.csv")
            .Column <string>("PatientId")
            .ToList()
            .ForEach(id => miner.AddPatientId(id));

            //Creates a CSV file containing the metrics requested
            var csv = miner.GetMetrics(sac.Application,
                                       new SQ("BRAIN", "Mean[Gy]", "D99%[Gy]"),
                                       new SQ("Cerebellum_ANT", "Mean[Gy]"),
                                       new SQ("Cerebellum_POST", "Mean[Gy]"),
                                       new SQ("Temporal_Inf Gy", "Mean[Gy]"),
                                       new SQ("Temporal_Mid Gy", "Mean[Gy]"),
                                       new SQ("Temporal_Sup Gy", "Mean[Gy]"),
                                       new SQ("TemporalLobe_MED", "Mean[Gy]"),
                                       new SQ("Vermis", "Mean[Gy]"));

            sac.Dispose();
            //Write CSV to file
            csv.Write(@"\\MyDesktop\patientData.csv");
        }