Exemplo n.º 1
0
        void stateController_StateUpdated(MedicalState state)
        {
            ButtonGridItem entry = entries[state];

            entry.Caption = state.Name;
            //imageAtlas.replaceImage(state, state.Thumbnail);
        }
Exemplo n.º 2
0
        void stateController_StateChanged(MedicalState state)
        {
            ButtonGridItem stateItem;

            entries.TryGetValue(state, out stateItem);
            stateListBox.SelectedItem = stateItem;
        }
Exemplo n.º 3
0
        private static CompoundPresetState cloneMedicalState(MedicalState medicalState)
        {
            CompoundPresetState compoundPresetState = new CompoundPresetState("", "", "");

            DiscPresetState leftDiscPreset = new DiscPresetState("LeftTMJDisc", "", "", "");

            leftDiscPreset.captureFromState(medicalState.Disc.getPosition("LeftTMJDisc"));
            compoundPresetState.addSubState(leftDiscPreset);

            DiscPresetState rightDiscPreset = new DiscPresetState("RightTMJDisc", "", "", "");

            rightDiscPreset.captureFromState(medicalState.Disc.getPosition("RightTMJDisc"));
            compoundPresetState.addSubState(rightDiscPreset);

            FossaPresetState leftFossaPreset = new FossaPresetState("", "", "");

            leftFossaPreset.captureFromState("LeftFossa", medicalState.Fossa);
            compoundPresetState.addSubState(leftFossaPreset);

            FossaPresetState rightFossaPreset = new FossaPresetState("", "", "");

            rightFossaPreset.captureFromState("RightFossa", medicalState.Fossa);
            compoundPresetState.addSubState(rightFossaPreset);

            AnimationManipulatorPresetState animationManipPresetState = new AnimationManipulatorPresetState("", "", "");

            animationManipPresetState.captureFromState(medicalState.BoneManipulator);
            compoundPresetState.addSubState(animationManipPresetState);

            TeethPresetState teethPreset = new TeethPresetState("", "", "");

            teethPreset.captureFromState(medicalState.Teeth);
            compoundPresetState.addSubState(teethPreset);
            return(compoundPresetState);
        }
Exemplo n.º 4
0
        public void blendPresetStates(PresetState startState, PresetState endState, float percent)
        {
            var          stateBlender      = standaloneController.MedicalStateController;
            MedicalState startMedicalState = stateBlender.createFromPreset(startState);
            MedicalState endMedicalState   = stateBlender.createFromPreset(endState);

            startMedicalState.blend(percent, endMedicalState);
        }
Exemplo n.º 5
0
 void stateController_StateChanged(MedicalState state)
 {
     this.currentState        = state;
     stateNameTextBox.Caption = state.Name;
     datePicker.Caption       = state.Notes.ProcedureDate.ToString();
     distortionWizard.Caption = state.Notes.DataSource;
     notes.OnlyText           = state.Notes.Notes;
 }
Exemplo n.º 6
0
 void stateController_StatesCleared(MedicalStateController controller)
 {
     currentState             = null;
     stateNameTextBox.Caption = "";
     datePicker.Caption       = "";
     distortionWizard.Caption = "";
     notes.OnlyText           = "";
 }
Exemplo n.º 7
0
        private void addMedicalState(MedicalState state)
        {
            String         imageId = imageAtlas.addImage(state, state.Thumbnail);
            ButtonGridItem entry   = stateListBox.addItem("", state.Name, imageId);

            entry.UserObject = state;
            entries.Add(state, entry);
            entry.ItemClicked += entry_ItemClicked;
        }
Exemplo n.º 8
0
        private void removeMedicalState(MedicalState state)
        {
            ButtonGridItem entry;

            if (entries.TryGetValue(state, out entry))
            {
                stateListBox.removeItem(entry);
                entries.Remove(state);
                imageAtlas.removeImage(state);
            }
        }
Exemplo n.º 9
0
        public void restoreMedicalState(String name)
        {
            MedicalState medicalState = modelMemory.get <MedicalState>(name);

            if (medicalState != null)
            {
                core.applyMedicalState(medicalState);
            }
            else
            {
                Log.Warning("A medical state named '{0}' cannot be found to restore.", name);
            }
        }
Exemplo n.º 10
0
        internal void createMedicalState(MedicalStateInfoModel stateInfo)
        {
            standaloneController.MedicalStateController.forceFinishBlend();
            MedicalState createdState = standaloneController.MedicalStateController.createState("Baseline");

            createdState.Notes.DataSource    = stateInfo.DataSource;
            createdState.Notes.Notes         = stateInfo.Notes;
            createdState.Notes.ProcedureDate = stateInfo.ProcedureDate;
            createdState.Name = stateInfo.StateName;

            if (stateInfo.ThumbInfo != null)
            {
                createdState.Thumbnail = ImageRenderer.renderImage(stateInfo.ThumbInfo);
            }

            standaloneController.MedicalStateController.addState(createdState);
            standaloneController.MedicalStateController.blendTo(createdState, 0.0f);
        }
Exemplo n.º 11
0
        public void captureSceneState(EditUICallback callback)
        {
            action.clear();
            if (Layers)
            {
                ChangeLayersCommand changeLayers = new ChangeLayersCommand();
                changeLayers.Layers.captureState();
                action.addCommand(changeLayers);
            }

            if (MusclePosition)
            {
                SetMusclePositionCommand musclePosition = new SetMusclePositionCommand();
                musclePosition.MusclePosition.captureState();
                action.addCommand(musclePosition);
            }

            if (Camera)
            {
                MoveCameraCommand moveCamera = new MoveCameraCommand();
                callback.runOneWayCustomQuery(CameraPosition.CustomEditQueries.CaptureCameraPosition, moveCamera.CameraPosition);
                action.addCommand(moveCamera);
            }

            if (MedicalState)
            {
                ChangeMedicalStateCommand medicalState = new ChangeMedicalStateCommand();
                MedicalState medState = new MedicalState("");
                medState.update();
                medicalState.captureFromMedicalState(medState);
                action.addCommand(medicalState);
            }

            if (HighlightTeeth)
            {
                action.addCommand(new ChangeTeethHighlightsCommand(TeethController.HighlightContacts));
            }
        }
Exemplo n.º 12
0
 public void captureStartFromMedicalState(MedicalState medicalState)
 {
     startState = cloneMedicalState(medicalState);
 }
Exemplo n.º 13
0
        public void saveMedicalState(String name)
        {
            MedicalState medicalState = core.generateMedicalState();

            modelMemory.add(name, medicalState);
        }
Exemplo n.º 14
0
 void stateController_StateRemoved(MedicalStateController controller, MedicalState state)
 {
     removeMedicalState(state);
 }
Exemplo n.º 15
0
 void stateController_StateAdded(MedicalStateController controller, MedicalState state)
 {
     addMedicalState(state);
 }
Exemplo n.º 16
0
 private void MedicalStateController_StateAdded(MedicalStateController controller, MedicalState state)
 {
     slideshowEditController.AllowSlideSceneSetup = false;
 }
Exemplo n.º 17
0
        public void captureSceneStateTo(EditUICallback callback, Action setLayerState, Action setMusclePosition, Action <CameraPosition> setCameraPosition, Action <MedicalState> setMedicalState)
        {
            if (Layers)
            {
                if (layersCommand == null)
                {
                    layersCommand = new BlendLayersCommand();
                    action.addCommand(layersCommand);
                }

                setLayerState();
            }
            else if (layersCommand != null)
            {
                action.removeCommand(layersCommand);
                layersCommand = null;
            }

            if (MusclePosition)
            {
                if (muscleCommand == null)
                {
                    muscleCommand = new BlendMusclePositionCommand();
                    action.addCommand(muscleCommand);
                }

                setMusclePosition();
            }
            else if (muscleCommand != null)
            {
                action.removeCommand(muscleCommand);
                muscleCommand = null;
            }

            if (Camera)
            {
                if (cameraCommand == null)
                {
                    cameraCommand = new MoveBlendedCameraCommand();
                    action.addCommand(cameraCommand);
                }

                CameraPosition camPos = new CameraPosition();
                callback.runOneWayCustomQuery(CameraPosition.CustomEditQueries.CaptureCameraPosition, camPos);
                setCameraPosition(camPos);
            }
            else if (cameraCommand != null)
            {
                action.removeCommand(cameraCommand);
                cameraCommand = null;
            }

            if (MedicalState)
            {
                if (medicalStateCommand == null)
                {
                    medicalStateCommand = new BlendMedicalStateCommand();
                    action.addCommand(medicalStateCommand);
                }

                MedicalState medState = new MedicalState("");
                medState.update();
                setMedicalState(medState);
            }
            else if (medicalStateCommand != null)
            {
                action.removeCommand(medicalStateCommand);
                medicalStateCommand = null;
            }
        }
Exemplo n.º 18
0
 public void applyMedicalState(MedicalState medicalState)
 {
     standaloneController.MedicalStateController.blendTo(medicalState, 1.0f);
 }
Exemplo n.º 19
0
        void captureButton_MouseButtonClick(Widget source, EventArgs e)
        {
            MedicalState medicalState = new MedicalState("");

            medicalState.update();
            CompoundPresetState compoundPresetState = new CompoundPresetState("", "", "");

            if (leftDisc.Checked)
            {
                DiscPresetState leftDiscPreset = new DiscPresetState("LeftTMJDisc", "", "", "");
                leftDiscPreset.captureFromState(medicalState.Disc.getPosition("LeftTMJDisc"));
                compoundPresetState.addSubState(leftDiscPreset);
            }
            if (rightDisc.Checked)
            {
                DiscPresetState rightDiscPreset = new DiscPresetState("RightTMJDisc", "", "", "");
                rightDiscPreset.captureFromState(medicalState.Disc.getPosition("RightTMJDisc"));
                compoundPresetState.addSubState(rightDiscPreset);
            }
            if (leftFossa.Checked)
            {
                FossaPresetState leftFossaPreset = new FossaPresetState("", "", "");
                leftFossaPreset.captureFromState("LeftFossa", medicalState.Fossa);
                compoundPresetState.addSubState(leftFossaPreset);
            }
            if (rightFossa.Checked)
            {
                FossaPresetState rightFossaPreset = new FossaPresetState("", "", "");
                rightFossaPreset.captureFromState("RightFossa", medicalState.Fossa);
                compoundPresetState.addSubState(rightFossaPreset);
            }
            if (mandible.Checked)
            {
                AnimationManipulatorPresetState animationManipPresetState = new AnimationManipulatorPresetState("", "", "");
                animationManipPresetState.captureFromState(medicalState.BoneManipulator);
                compoundPresetState.addSubState(animationManipPresetState);
                //Need to implement mandible, may be just as easy to support each individual element

                /* bonescalarstateentry
                 * rightRamusHeightMandible
                 * rightAntegonialNotchMandible
                 * rightCondyleHeightMandible
                 * rightCondyleDegenerationMandible
                 * rightMandibularNotchMandible
                 * rightLateralPoleMandible
                 * rightMedialPoleScaleMandible
                 *
                 * leftRamusHeightMandible
                 * leftCondyleHeightMandible
                 * leftAntegonialNotchMandible
                 * leftMandibularNotchMandible
                 * leftCondyleDegenerationMandible
                 * leftLateralPoleMandible
                 * leftMedialPoleScaleMandible
                 */
                /* bonerotator
                 * leftCondyleRotationMandible
                 * rightCondyleRotationMandible
                 */
                /* Pose Manipulator
                 * leftCondyleRoughnessMandible
                 * rightCondyleRoughnessMandible
                 */
            }
            if (teeth.Checked)
            {
                TeethPresetState teethPreset = new TeethPresetState("", "", "");
                teethPreset.captureFromState(medicalState.Teeth);
                compoundPresetState.addSubState(teethPreset);
            }

            String errorPrompt = null;

            resultCallback.Invoke(compoundPresetState, ref errorPrompt);
            this.close();
        }
Exemplo n.º 20
0
 public void captureEndFromMedicalState(MedicalState medicalState)
 {
     endState = cloneMedicalState(medicalState);
 }