Example #1
0
        private void _btnOK_Click(object sender, EventArgs e)
        {
            MedicalViewerNudgeTool nudgeToolProperties = (MedicalViewerNudgeTool)(cell.GetActionProperties(MedicalViewerActionType.NudgeTool));

            nudgeToolProperties.Width  = Convert.ToInt32(_txtNudgeWidth.Text);
            nudgeToolProperties.Height = Convert.ToInt32(_txtNudgeHeight.Text);
            nudgeToolProperties.Shape  = NudgeType;

            cell.SetActionProperties(MedicalViewerActionType.NudgeTool, nudgeToolProperties);

            foreach (MedicalViewerMultiCell viewerCell in viewer.Cells)
            {
                viewerCell.SetActionProperties(MedicalViewerActionType.NudgeTool, nudgeToolProperties);
            }



            nudgeToolProperties = (MedicalViewerNudgeTool)(cell.GetActionProperties(MedicalViewerActionType.ShrinkTool));

            nudgeToolProperties.Width  = Convert.ToInt32(_txtShrinkWidth.Text);
            nudgeToolProperties.Height = Convert.ToInt32(_txtShrinkHeight.Text);
            nudgeToolProperties.Shape  = ShrinkType;

            cell.SetActionProperties(MedicalViewerActionType.ShrinkTool, nudgeToolProperties);

            foreach (MedicalViewerMultiCell viewerCell in viewer.Cells)
            {
                viewerCell.SetActionProperties(MedicalViewerActionType.ShrinkTool, nudgeToolProperties);
            }

            this.Close();
        }
        public MagnifyGlassProperties(MainForm owner, MedicalViewerCell selectedCell)
        {
            InitializeComponent();

            _Viewer       = owner.Viewer;
            _SelectedCell = selectedCell;

            if (_SelectedCell != null)
            {
                _magnifyGlass = (MedicalViewerMagnifyGlass)(_SelectedCell.GetActionProperties(MedicalViewerActionType.MagnifyGlass));
            }
            else
            {
                _magnifyGlass = (MedicalViewerMagnifyGlass)(MainForm.DefaultCell.GetActionProperties(MedicalViewerActionType.MagnifyGlass));
            }

            _chk3D.Checked              = _magnifyGlass.Border3D;
            _chk3D.Enabled              = !_chkElliptical.Checked;
            _chkElliptical.Checked      = _magnifyGlass.Elliptical;
            _txtWidth.Value             = _magnifyGlass.Width;
            _txtHeight.Value            = _magnifyGlass.Height;
            _txtZoom.Value              = _magnifyGlass.Zoom;
            _txtBorder.Value            = _magnifyGlass.BorderSize;
            _cmbCrosshair.SelectedIndex = (int)_magnifyGlass.Crosshair;
            _lblPenColor.BackColor      = Color.FromArgb(0xff, _magnifyGlass.PenColor.R, _magnifyGlass.PenColor.G, _magnifyGlass.PenColor.B);
        }
Example #3
0
        public WindowLevelPropertiesDialog(MainForm owner, MedicalViewerCell selectedCell)
        {
            InitializeComponent();

            _Viewer = owner.Viewer;
            if (selectedCell == null)
            {
                if (_Viewer.Cells.Count != 0)
                {
                    selectedCell = (MedicalViewerCell)_Viewer.Cells[0];
                }
            }
            _SelectedCell = selectedCell;

            if (selectedCell != null)
            {
                _txtCellIndex.Value = _Viewer.Cells.IndexOf(selectedCell);
            }

            if (selectedCell == null)
            {
                _windowLevel = MainForm.GlobalCell.GetActionProperties(MedicalViewerActionType.WindowLevel, 0) as MedicalViewerWindowLevel;
                _keys        = MainForm.GlobalCell.GetActionKeys(MedicalViewerActionType.WindowLevel);
            }
            else
            {
                _windowLevel = selectedCell.GetActionProperties(MedicalViewerActionType.WindowLevel, 0) as MedicalViewerWindowLevel;
                _keys        = selectedCell.GetActionKeys(MedicalViewerActionType.WindowLevel);
            }

            _cmbFillType.Items.Add(MedicalViewerLookupTableType.Linear);
            _cmbFillType.Items.Add(MedicalViewerLookupTableType.Logarithmic);
            _cmbFillType.Items.Add(MedicalViewerLookupTableType.Exponential);
            _cmbFillType.Items.Add(MedicalViewerLookupTableType.Sigmoid);
            _btnCursor.ButtonCursor = _windowLevel.ActionCursor;

            _lblStart.BoxColor = _windowLevel.StartColor;
            _lblEnd.BoxColor   = _windowLevel.EndColor;
            _txtWidth.Value    = (_windowLevel.Width == 0) ? 1 : _windowLevel.Width;
            _txtCenter.Value   = _windowLevel.Center;
            int index = _cmbFillType.Items.IndexOf(_windowLevel.LookupTableType);

            _cmbFillType.SelectedIndex       = index == -1 ? 0 : index;
            _txtSensitivity.Text             = _windowLevel.Sensitivity.ToString();
            _chkCircular.Checked             = _windowLevel.CircularMouseMove;
            _cmbApplyToCell.SelectedIndex    = 0;
            _cmbApplyToSubCell.SelectedIndex = 0;

            owner.AddKeysToCombo(_cmbLeftKey, _keys.MouseLeft);
            owner.AddKeysToCombo(_cmbRightKey, _keys.MouseRight);
            owner.AddKeysToCombo(_cmbBottomKey, _keys.MouseDown);
            owner.AddKeysToCombo(_cmbTopKey, _keys.MouseUp);
            owner.AddModifiersToCombo(_cmbModifiers, _keys.Modifiers);

            _cmbApplyToCell.Enabled = (owner.Viewer.Cells.Count != 0);
        }
Example #4
0
        public NudgeShrinkToolDialog(MainForm owner)
        {
            InitializeComponent();

            cell   = MainForm.DefaultCell;
            viewer = owner.Viewer;

            MedicalViewerNudgeTool nudgeToolProperties = (MedicalViewerNudgeTool)cell.GetActionProperties(MedicalViewerActionType.NudgeTool);

            _txtNudgeHeight.Text = nudgeToolProperties.Height.ToString();
            _txtNudgeWidth.Text  = nudgeToolProperties.Width.ToString();
            NudgeType            = nudgeToolProperties.Shape;

            nudgeToolProperties = (MedicalViewerNudgeTool)cell.GetActionProperties(MedicalViewerActionType.ShrinkTool);

            _txtShrinkHeight.Text = nudgeToolProperties.Height.ToString();
            _txtShrinkWidth.Text  = nudgeToolProperties.Width.ToString();
            ShrinkType            = nudgeToolProperties.Shape;
        }
        public ArrowAnnotationDialog(MainForm owner)
        {
            InitializeComponent();

            cell   = MainForm.DefaultCell;
            viewer = owner.Viewer;

            _arrowAnnotation          = (MedicalViewerAnnotationArrow)(cell.GetActionProperties(MedicalViewerActionType.AnnotationArrow));
            _lblColor.BackColor       = Color.FromArgb(0xff, _arrowAnnotation.AnnotationColor);
            _cmbApplyTo.SelectedIndex = (int)_arrowAnnotation.Flags;
        }
Example #6
0
        public RectangleAnnotationDialog(MainForm owner)
        {
            InitializeComponent();

            cell   = MainForm.DefaultCell;
            viewer = owner.Viewer;

            _cmbApplyTo.SelectedIndex = 0;
            _rectangleAnnotation      = (MedicalViewerAnnotationRectangle)(cell.GetActionProperties(MedicalViewerActionType.AnnotationRectangle));
            _lblColor.BackColor       = Color.FromArgb(0xff, _rectangleAnnotation.AnnotationColor);
            _radCenter.Checked        = _rectangleAnnotation.CreateFromCenter;
        }
Example #7
0
        public OffsetPropertiesDialog(MainForm owner, MedicalViewerCell selectedCell)
        {
            InitializeComponent();
            _Viewer = owner.Viewer;
            if (selectedCell == null)
            {
                if (_Viewer.Cells.Count != 0)
                {
                    selectedCell = (MedicalViewerCell)_Viewer.Cells[0];
                }
            }
            _SelectedCell = selectedCell;

            if (selectedCell != null)
            {
                _txtCellIndex.Value = _Viewer.Cells.IndexOf(selectedCell);
            }

            if (_SelectedCell != null)
            {
                _offset = (MedicalViewerOffset)(_SelectedCell.GetActionProperties(MedicalViewerActionType.Offset, _txtCellIndex.Value));
                _keys   = _SelectedCell.GetActionKeys(MedicalViewerActionType.Offset);
            }
            else
            {
                _offset = (MedicalViewerOffset)(MainForm.DefaultCell.GetActionProperties(MedicalViewerActionType.Offset, _txtCellIndex.Value));
                _keys   = MainForm.DefaultCell.GetActionKeys(MedicalViewerActionType.Offset);
            }

            _btnActionCursor.ButtonCursor = _offset.ActionCursor;

            _cmbApplyToCell.SelectedIndex = 0;
            _txtX.Value = _offset.X;
            _txtY.Value = _offset.Y;

            _txtSensitivity.Value = _offset.Sensitivity;
            _chkCircular.Checked  = _offset.CircularMouseMove;

            owner.AddKeysToCombo(_cmbLeftKey, _keys.MouseLeft);
            owner.AddKeysToCombo(_cmbRightKey, _keys.MouseRight);
            owner.AddKeysToCombo(_cmbBottomKey, _keys.MouseDown);
            owner.AddKeysToCombo(_cmbTopKey, _keys.MouseUp);
            owner.AddModifiersToCombo(_cmbModifiers, _keys.Modifiers);

            _cmbApplyToCell.Enabled = (owner.Viewer.Cells.Count != 0);
        }
Example #8
0
        public StackPropertiesDialog(MainForm owner, MedicalViewerCell selectedCell)
        {
            InitializeComponent();
            _Viewer = owner.Viewer;
            if (selectedCell == null)
            {
                if (_Viewer.Cells.Count != 0)
                {
                    selectedCell = (MedicalViewerCell)_Viewer.Cells[0];
                }
            }
            _SelectedCell = selectedCell;

            if (selectedCell != null)
            {
                _txtCellIndex.Value = _Viewer.Cells.IndexOf(selectedCell);
            }

            if (selectedCell != null)
            {
                _stack = (MedicalViewerStack)(_SelectedCell.GetActionProperties(MedicalViewerActionType.Stack));
                _keys  = _SelectedCell.GetActionKeys(MedicalViewerActionType.Stack);
            }
            else
            {
                _stack = (MedicalViewerStack)(MainForm.GlobalCell.GetActionProperties(MedicalViewerActionType.Stack, _txtCellIndex.Value));
                _keys  = MainForm.GlobalCell.GetActionKeys(MedicalViewerActionType.Stack);
            }

            _btnActionCursor.ButtonCursor = _stack.ActionCursor;

            _txtSensitivity.Value   = _stack.Sensitivity;
            _chkCircular.Checked    = _stack.CircularMouseMove;
            _txtStack.Value         = _stack.ScrollValue;
            _txtActiveSubCell.Value = _stack.ActiveSubCell;

            _cmbApplyToCells.SelectedIndex = 0;

            owner.AddKeysToCombo(_cmbTopKey, _keys.MouseUp);
            owner.AddKeysToCombo(_cmbBottomKey, _keys.MouseDown);
            owner.AddModifiersToCombo(_cmbModifiers, _keys.Modifiers);

            _cmbApplyToCells.Enabled = (owner.Viewer.Cells.Count != 0);
        }
        public ScalePropertiesDialog(MainForm owner, MedicalViewerCell selectedCell)
        {
            InitializeComponent();
            _Viewer = owner.Viewer;
            if (selectedCell == null)
            {
                if (_Viewer.Cells.Count != 0)
                {
                    selectedCell = (MedicalViewerCell)_Viewer.Cells[0];
                }
            }
            _SelectedCell = selectedCell;

            if (selectedCell != null)
            {
                _txtCellIndex.Value = _Viewer.Cells.IndexOf(selectedCell);
            }

            if (_SelectedCell != null)
            {
                _scale = (MedicalViewerScale)(_SelectedCell.GetActionProperties(MedicalViewerActionType.Scale));
                _keys  = _SelectedCell.GetActionKeys(MedicalViewerActionType.Scale);

                _chkBoxDynamic.Checked = _SelectedCell.ScaleType == MedicalViewerScaleType.Dynamic;
            }
            else
            {
                _scale = (MedicalViewerScale)(MainForm.DefaultCell.GetActionProperties(MedicalViewerActionType.Scale));
                _keys  = MainForm.DefaultCell.GetActionKeys(MedicalViewerActionType.Scale);

                MainForm.DefaultCell.ScaleType = _chkBoxDynamic.Checked ? MedicalViewerScaleType.Dynamic : MedicalViewerScaleType.Normal;
            }

            _btnCursor.ButtonCursor        = _scale.ActionCursor;
            _cmbApplyToCells.SelectedIndex = 0;
            _txtSensitivity.Value          = _scale.Sensitivity;
            _chkCircular.Checked           = _scale.CircularMouseMove;
            _txtScale.Value = _scale.Scale;
            owner.AddKeysToCombo(_cmbTopKey, _keys.MouseUp);
            owner.AddKeysToCombo(_cmbBottomKey, _keys.MouseDown);
            owner.AddModifiersToCombo(_cmbModifiers, _keys.Modifiers);

            _cmbApplyToCells.Enabled = (owner.Viewer.Cells.Count != 0);
        }
Example #10
0
        public AlphaPropertiesDialog(MainForm owner, MedicalViewerCell selectedCell)
        {
            InitializeComponent();
            _Viewer = owner.Viewer;
            if (selectedCell == null)
            {
                if (_Viewer.Cells.Count != 0)
                {
                    selectedCell = (MedicalViewerCell)_Viewer.Cells[0];
                }
            }

            _SelectedCell          = selectedCell;
            _txtCellIndex.Value    = _Viewer.Cells.IndexOf(_SelectedCell);
            _txtSubCellIndex.Value = 0;

            if (_SelectedCell != null)
            {
                _alpha = (MedicalViewerAlpha)(_SelectedCell.GetActionProperties(MedicalViewerActionType.Alpha));
                _keys  = _SelectedCell.GetActionKeys(MedicalViewerActionType.Alpha);
            }
            else
            {
                _alpha = (MedicalViewerAlpha)(MainForm.DefaultCell.GetActionProperties(MedicalViewerActionType.Alpha));
                _keys  = MainForm.DefaultCell.GetActionKeys(MedicalViewerActionType.Alpha);
            }

            _btnCursor.ButtonCursor = _alpha.ActionCursor;

            _txtFactor.Value = _alpha.Alpha;

            _txtSensitivity.Value = _alpha.Sensitivity;
            _chkCircular.Checked  = _alpha.CircularMouseMove;

            _cmbApplyToCell.SelectedIndex    = 0;
            _cmbApplyToSubCell.SelectedIndex = 0;

            owner.AddKeysToCombo(_cmbLeftKey, _keys.MouseLeft);
            owner.AddKeysToCombo(_cmbRightKey, _keys.MouseRight);
            owner.AddModifiersToCombo(_cmbModifiers, _keys.Modifiers);

            _cmbApplyToCell.Enabled = (owner.Viewer.Cells.Count != 0);
        }
Example #11
0
        public TextAnnotationDialog(MainForm owner)
        {
            InitializeComponent();

            _cell   = MainForm.DefaultCell;
            _viewer = owner.Viewer;

            if (_viewer.Cells.Count == 0)
            {
                _textAnnotation = (MedicalViewerAnnotationText)(_cell.GetActionProperties(MedicalViewerActionType.AnnotationText));
            }
            else
            {
                _textAnnotation = (MedicalViewerAnnotationText)(_viewer.Cells[0].GetActionProperties(MedicalViewerActionType.AnnotationText));
            }

            _lblColor.BackColor       = Color.FromArgb(0xff, _textAnnotation.AnnotationColor);
            _textAnnotation.TextColor = Color.FromArgb(0xff, _textAnnotation.TextColor);
            _cmbApplyTo.SelectedIndex = (int)_textAnnotation.Flags;
        }