Exemple #1
0
        public MainViewModel(User user, Patient patient, string scriptVersion, ObservableCollection <PlanningItemViewModel> planningItemList, PlanningItemViewModel planningItem)
        {
            ActivePlanningItem = planningItem;
            Patient            = patient;
            Image        = ActivePlanningItem.PlanningItemImage;
            StructureSet = ActivePlanningItem.PlanningItemStructureSet;
            DirectoryInfo constraintDir = new DirectoryInfo(Path.Combine(AssemblyHelper.GetAssemblyDirectory(), "ConstraintTemplates"));
            //DirectoryInfo constraintDir = new DirectoryInfo(Path.Combine(AssemblyHelper.GetAssemblyDirectory(), "ConstraintTemplates"));
            string firstFileName           = constraintDir.GetFiles().FirstOrDefault().ToString();
            string firstConstraintFilePath = Path.Combine(constraintDir.ToString(), firstFileName);

            ActiveConstraintPath   = new ConstraintViewModel(firstConstraintFilePath);
            PlanningItemList       = planningItemList;
            StructureList          = StructureSetListViewModel.GetStructureList(StructureSet);;
            ConstraintComboBoxList = ConstraintListViewModel.GetConstraintList(constraintDir.ToString());
            //GetPQMSummaries(ActiveConstraintPath, ActivePlanningItem, Patient);
            //PqmSummaries = new ObservableCollection<PQMSummaryViewModel>();
            ErrorGrid             = GetErrors(ActivePlanningItem);
            Title                 = GetTitle(patient, scriptVersion);
            ModelGroup            = new Model3DGroup();
            SliderValue           = 0;
            upDir                 = new Vector3D(0, -1, 0);
            lookDir               = new Vector3D(0, 0, 1);
            isoctr                = new Point3D(0, 0, 0); //just to initalize
            cameraPosition        = new Point3D(0, 0, -3500);
            PlanningItemSummaries = GetPlanningItemSummary(ActivePlanningItem, PlanningItemList);
            //NotifyPropertyChanged("Structure");
        }
Exemple #2
0
 public Task <ObservableCollection <StructureViewModel> > GetStructuresAsync(string courseId, string planId) =>
 RunAsync(context =>
 {
     var planningItem = Extensions.GetPlanningItem(context.Patient, courseId, planId);
     var ss           = planningItem?.StructureSet;
     var ssvm         = StructureSetListViewModel.GetStructureList(ss);
     return(ssvm);
 });
Exemple #3
0
        public PQMSummaryViewModel CalculatePQM(PQMSummaryViewModel objective, PlanningItemViewModel planningItemVM, StructureSet structureSet, StructureViewModel evalStructure)
        {
            objective.ActivePlanningItem = planningItemVM;
            PlanningItem planningItem = planningItemVM.PlanningItemObject;

            if (evalStructure == null)
            {
                objective.Achieved      = "Structure not found or empty.";
                objective.isCalculated  = false;
                objective.StructureList = StructureSetListViewModel.GetStructureList(structureSet);
                return(objective);
            }
            else
            {
                objective.isCalculated          = true;
                objective.Structure             = evalStructure;
                objective.StructureName         = evalStructure.StructureName;
                objective.StructVolume          = evalStructure.VolumeValue;
                objective.StructureNameWithCode = evalStructure.StructureNameWithCode;
                objective.StructureList         = StructureSetListViewModel.GetStructureList(structureSet);
                return(objective);
            }
        }