예제 #1
0
        private OrientationAxis GetOppositeOrientation(OrientationAxis orientation)
        {
            switch (orientation)
            {
            case OrientationAxis.Anterior:
                return(OrientationAxis.Posterior);

            case OrientationAxis.Inferior:
                return(OrientationAxis.Superior);

            case OrientationAxis.Left:
                return(OrientationAxis.Right);

            case OrientationAxis.Posterior:
                return(OrientationAxis.Anterior);

            case OrientationAxis.Right:
                return(OrientationAxis.Left);

            case OrientationAxis.Invalid:
                return(OrientationAxis.Invalid);

            default:
                return(OrientationAxis.Inferior);
            }
        }
예제 #2
0
        private void comboBoxTop_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (comboBoxConfigs.SelectedIndex < 0 || comboBoxTop.SelectedIndex < 0)
                {
                    return;
                }

                OrientationAxis  orientation = (OrientationAxis)comboBoxTop.SelectedItem;
                PlaneOrientation po          = comboBoxConfigs.SelectedItem as PlaneOrientation;

                labelBottom.Text = GetOppositeOrientation(orientation).ToString( );

                po.Top = orientation;

                CheckRight(orientation);

                _OldTopOrientation = orientation;
            }
            catch (Exception exception)
            {
                Messager.ShowError(this, exception);
            }
        }
예제 #3
0
        private void CheckTop(OrientationAxis right)
        {
            if (comboBoxTop.SelectedIndex < 0)
            {
                return;
            }

            if ((OrientationAxis)comboBoxTop.SelectedItem == right)
            {
                comboBoxTop.SelectedItem = _OldRightOrientation;
            }
            else if (GetOppositeOrientation((OrientationAxis)comboBoxTop.SelectedItem) == right)
            {
                comboBoxTop.SelectedItem = _OldRightOrientation;
            }
        }
예제 #4
0
        private void CheckRight(OrientationAxis top)
        {
            if (comboBoxRight.SelectedItem == null)
            {
                return;
            }

            if (( OrientationAxis )comboBoxRight.SelectedItem == top)
            {
                comboBoxRight.SelectedItem = _OldTopOrientation;
            }
            else if (GetOppositeOrientation((OrientationAxis)comboBoxRight.SelectedItem) == top)
            {
                comboBoxRight.SelectedItem = _OldTopOrientation;
            }
        }
예제 #5
0
        private void ConfigureSagittal( )
        {
            foreach (PlaneOrientation plane in _Configuration.Sagittal)
            {
                comboBoxConfigs.Items.Add(plane);
            }

            SetOrientationAxis(OrientationAxis.Anterior,
                               OrientationAxis.Posterior,
                               OrientationAxis.Superior,
                               OrientationAxis.Inferior);

            if (_Configuration.Sagittal.Count > 0)
            {
                comboBoxTop.SelectedItem   = _Configuration.Sagittal[0].Top;
                comboBoxRight.SelectedItem = _Configuration.Sagittal[0].Right;

                labelBottom.Text = GetOppositeOrientation(_Configuration.Sagittal[0].Top).ToString( );
                labelLeft.Text   = GetOppositeOrientation(_Configuration.Sagittal[0].Right).ToString( );

                _OldTopOrientation   = _Configuration.Sagittal[0].Top;
                _OldRightOrientation = _Configuration.Sagittal[0].Right;
            }
        }