Exemplo n.º 1
0
        // methods
        // the method Execute() is being released automatically when the plugin is loaded
        public void Execute(ScriptContext context, System.Windows.Window window)
        {
            CollCoursePlan = new ObservableCollection <CoursePlan>();
            IEnumerable <Course> courses = context.Patient.Courses;

            // the nested loops over courses and plans to collect all valid plans (i.e. with non-null dose) and structures sets
            foreach (Course course in courses)
            {
                IEnumerable <PlanSetup> planSetups = course.PlanSetups;
                foreach (PlanSetup planSetup in planSetups)
                {
                    if (planSetup.Dose != null & planSetup.StructureSet != null)
                    {
                        string courseplanid = course.Id + " / " + planSetup.Id;
                        CollCoursePlan.Add(new CoursePlan(course, planSetup, courseplanid, planSetup.StructureSet, false));
                    }
                }
            }
            // binding to lists shown in GUI can be done only using static variable...
            StaticCollCoursePlan      = CollCoursePlan;
            StaticCollStructureTarget = null;
            StaticCollResult          = null;

            var mainControl = new FastMPI.MainControl();

            // main window settings
            window.Content    = mainControl;
            window.Background = System.Windows.Media.Brushes.Cornsilk;
            window.Height     = 660;
            window.Width      = 820;
            window.Title      = "Multiple Planning Indices for " + context.Patient.Name;
        }
Exemplo n.º 2
0
        // METODY
        public void Execute(ScriptContext context, System.Windows.Window window)
        {
            CollCoursePlan = new ObservableCollection <CoursePlan>();
            IEnumerable <Course> courses = context.Patient.Courses;

            // PETLA PRZEBIEGAJACA PO WSZYSTKICH KURSACH I PLANACH W PACJENCIE I PRZYGOTOWUJACA
            // LISTE coursesplans ZAWIERAJACA:
            // (1) KURSY
            // (2) PLANY
            // (3) ZESTAWY STRUKTUR
            foreach (Course course in courses)
            {
                IEnumerable <PlanSetup> planSetups = course.PlanSetups;
                foreach (PlanSetup planSetup in planSetups)
                {
                    if (planSetup.Dose != null & planSetup.StructureSet != null)
                    {
                        string courseplanid = course.Id + " / " + planSetup.Id;
                        CollCoursePlan.Add(new CoursePlan(course, planSetup, courseplanid, planSetup.StructureSet, false));
                    }
                }
            }
            // PRZYPISANIE WYNIKU ZMIENNEJ STATYCZNEJ
            StaticCollCoursePlan      = CollCoursePlan;
            StaticCollStructureTarget = null;
            StaticCollResult          = null;

            //wywolanie metody MainControl() na sposob z esapi/Projects/Example_DVH
            var mainControl = new FastMPI.MainControl();

            // USTAWIENIA PARAMETROW GLOWNEGO OKNA APLIKACJI
            window.Content    = mainControl;
            window.Background = System.Windows.Media.Brushes.Cornsilk;
            window.Height     = 660;
            window.Width      = 820;
            window.Title      = "Multiple Planning Indices for " + context.Patient.Name;
        }