Exemplo n.º 1
0
        public SlabDialog(MedicalViewer medicalViewer, Medical3DContainer Medical3DContainer, Medical3DVolumeType type)
        {
            viewer = medicalViewer;
            MedicalViewer3DCell cell3D = (MedicalViewer3DCell)viewer.Cells[0];

            InitializeComponent();
            switch (type)
            {
            case Medical3DVolumeType.MIP:
                slab = Medical3DContainer.Objects[cell3D.Container.CurrentObjectIndex].MIP.Slab;
                break;

            case Medical3DVolumeType.VRT:
                slab = Medical3DContainer.Objects[cell3D.Container.CurrentObjectIndex].VRT.Slab;
                break;
            }
            previousSlabValue = new Medical3DSlab(slab);
            EnableControls(slab.Enabled);
            _chkBoxenableSlab.Checked = slab.Enabled;
            _textBoxX1.Value          = (int)(slab.X1 * 1000);
            _textBoxY1.Value          = (int)(slab.Y1 * 1000);
            _textBoxZ1.Value          = (int)(slab.Z1 * 1000);
            _textBoxZ2.Value          = (int)(slab.Z2 * 1000);
            _textBoxY2.Value          = (int)(slab.Y2 * 1000);
            _textBoxX2.Value          = (int)(slab.X2 * 1000);
        }
Exemplo n.º 2
0
        public RotatePlaneActionDialog(MedicalViewer medicalViewer, Medical3DContainer medical3DContainer)
        {
            InitializeComponent();
            viewer    = medicalViewer;
            container = medical3DContainer;

            Text = "Rotate Plane Action";

            MedicalViewerRotate3DPlane rotatePlane = (MedicalViewerRotate3DPlane)viewer.GetActionProperties(MedicalViewerActionType.RotatePlane);

            switch (rotatePlane.Axis)
            {
            case Medical3DAxis.X:
                _comboBoxAxis.SelectedIndex = 0;
                break;

            case Medical3DAxis.Y:
                _comboBoxAxis.SelectedIndex = 1;
                break;

            case Medical3DAxis.Z:
                _comboBoxAxis.SelectedIndex = 2;
                break;
            }

            if (rotatePlane.Space == Medical3DSpace.Object)
            {
                _comboBoxOrientation.SelectedIndex = 0;
            }
            else
            {
                _comboBoxOrientation.SelectedIndex = 1;
            }
        }
Exemplo n.º 3
0
        public MovePlane(MedicalViewer viewer, Medical3DContainer container, int planeIndex, Medical3DVolumeType type)
        {
            InitializeComponent();
            _viewer     = viewer;
            _container  = container;
            _planeIndex = planeIndex;
            _type       = type;
            MedicalViewer3DCell cell3D = (MedicalViewer3DCell)_viewer.Cells[0];

            if (_planeIndex == -1)
            {
                switch (_type)
                {
                case Medical3DVolumeType.VRT:
                    _planeIndex = _container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes.Count - 1;
                    break;

                case Medical3DVolumeType.MIP:
                    _planeIndex = _container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes.Count - 1;
                    break;

                case Medical3DVolumeType.MPR:
                    _planeIndex = _container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes.Count - 1;
                    break;
                }
            }

            GetPlanePoint();
        }
Exemplo n.º 4
0
        public ThresholdDialog(Medical3DControl control3D, Medical3DContainer Medical3DContainer, Medical3DVolumeType Medical3DVolumeType)
        {
            InitializeComponent();

            container = Medical3DContainer;
            type      = Medical3DVolumeType;

            _control3D = control3D;

            oldFromValue                    = container.Objects[_control3D.ObjectsContainer.CurrentObjectIndex].LowerThreshold;
            oldToValue                      = container.Objects[_control3D.ObjectsContainer.CurrentObjectIndex].UpperThreshold;
            removeIntervalType              = container.Objects[_control3D.ObjectsContainer.CurrentObjectIndex].RemoveInterval;
            oldEnabled                      = container.Objects[_control3D.ObjectsContainer.CurrentObjectIndex].EnableThresholding;
            _chkBoxenableThreshold.Checked  = container.Objects[_control3D.ObjectsContainer.CurrentObjectIndex].EnableThresholding;
            _removeInnerRangeChkBox.Checked = container.Objects[_control3D.ObjectsContainer.CurrentObjectIndex].RemoveInterval == Medical3DRemoveIntervalType.InnerRange;

            minimum = container.Objects[_control3D.ObjectsContainer.CurrentObjectIndex].MinimumValue;
            maximum = container.Objects[_control3D.ObjectsContainer.CurrentObjectIndex].MaximumValue;

            dontApply = true;
            _trackBarLower.Maximum       = maximum;
            _textBoxLower.MinimumAllowed = 0;
            _textBoxLower.MaximumAllowed = maximum;
            _textBoxLower.Value          = (int)oldFromValue;

            _trackBarUpper.Maximum       = maximum;
            _textBoxUpper.MinimumAllowed = 0;
            _textBoxUpper.MaximumAllowed = maximum;
            dontApply           = false;
            _textBoxUpper.Value = (int)oldToValue;

            EnableControls(_chkBoxenableThreshold.Checked);
            _control3D.Invalidate();
        }
Exemplo n.º 5
0
        public ScaleDialog(MedicalViewer control, Medical3DContainer container, ItemType type, int objectIndex)
        {
            InitializeComponent();

            _oldPoint    = new Medical3DPoint();
            _type        = type;
            _control     = control;
            _container   = container;
            _objectIndex = objectIndex;

            switch (type)
            {
            case ItemType.Camera:
                Text        = "Zoom Camera Dialog";
                _oldPoint.Y = container.Camera.Zoom;
                break;

            case ItemType.Object:
                Text        = "Scale Object Dialog";
                _oldPoint.X = container.Objects[objectIndex].XScale;
                _oldPoint.Y = container.Objects[objectIndex].YScale;
                _oldPoint.Z = container.Objects[objectIndex].ZScale;
                break;
            }

            _textBoxX.Value = (int)(_oldPoint.X * 1000);
            _textBoxY.Value = (int)(_oldPoint.Y * 1000);
            _textBoxZ.Value = (int)(_oldPoint.Z * 1000);
        }
Exemplo n.º 6
0
        public MoveDialog(MedicalViewer viewer, Medical3DContainer container, ItemType type, int objectIndex)
        {
            InitializeComponent();

            _oldPoint    = new Medical3DPoint();
            _type        = type;
            _viewer      = viewer;
            _container   = container;
            _objectIndex = objectIndex;

            switch (type)
            {
            case ItemType.Camera:
                Text        = "Move Camera Dialog";
                _oldPoint.X = container.Camera.XOffset;
                _oldPoint.Y = container.Camera.YOffset;
                _oldPoint.Z = container.Camera.ZOffset;
                _textBoxZ.MaximumAllowed = 4000;
                _textBoxZ.MinimumAllowed = 0;
                _trackBarZ.Maximum       = 4000;
                _trackBarZ.Minimum       = 0;
                break;

            case ItemType.Object:
                Text        = "Move Object Dialog";
                _oldPoint.X = container.Objects[objectIndex].XOffset;
                _oldPoint.Y = container.Objects[objectIndex].YOffset;
                _oldPoint.Z = container.Objects[objectIndex].ZOffset;
                break;
            }

            _textBoxX.Value = (int)(_oldPoint.X * 1000);
            _textBoxY.Value = (int)(_oldPoint.Y * 1000);
            _textBoxZ.Value = (int)(_oldPoint.Z * 1000);
        }
Exemplo n.º 7
0
        public SetPlanePointNormal(MedicalViewer viewer, Medical3DContainer container, Medical3DVolumeType type, int index)
        {
            MedicalViewer3DCell cell3D = (MedicalViewer3DCell)viewer.Cells[0];

            InitializeComponent();
            _type       = type;
            _container  = container;
            _planeIndex = index;
            _dontApply  = true;
            _viewer     = viewer;
            if (_planeIndex == -1)
            {
                switch (_type)
                {
                case Medical3DVolumeType.VRT:
                    _planeIndex = _container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes.Count - 1;
                    break;

                case Medical3DVolumeType.MIP:
                    _planeIndex = _container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes.Count - 1;
                    break;

                case Medical3DVolumeType.MPR:
                    _planeIndex = _container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes.Count - 1;
                    break;
                }
            }

            UpdatePlanePointNormal();
            _dontApply = false;
        }
Exemplo n.º 8
0
        public RotatePlane(MedicalViewer control, Medical3DContainer container, int planeIndex, Medical3DVolumeType type)
        {
            InitializeComponent();
            _control    = control;
            _container  = container;
            _planeIndex = planeIndex;
            _type       = type;
            _comboBoxAxis.SelectedIndex  = 0;
            _comboBoxSpace.SelectedIndex = 0;
            MedicalViewer3DCell cell3D = (MedicalViewer3DCell)_control.Cells[0];

            if (_planeIndex == -1)
            {
                switch (_type)
                {
                case Medical3DVolumeType.VRT:
                    _planeIndex = _container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes.Count - 1;
                    break;

                case Medical3DVolumeType.MIP:
                    _planeIndex = _container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes.Count - 1;
                    break;

                case Medical3DVolumeType.MPR:
                    _planeIndex = _container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes.Count - 1;
                    break;
                }
            }
        }
Exemplo n.º 9
0
 public ZoomCameraDialog(MedicalViewer control, Medical3DContainer container)
 {
     InitializeComponent();
     _control                    = control;
     _container                  = container;
     _oldZoomValue               = container.Camera.Zoom;
     _trackBarZoom.Maximum       = 180;
     _textBoxZoom.MaximumAllowed = 180;
     _textBoxZoom.Value          = (180 - (int)container.Camera.Zoom);
     _trackBarZoom.Value         = _textBoxZoom.Value;
 }
Exemplo n.º 10
0
        public ContainerProperties(Medical3DControl control3D, MedicalViewer viewer, Medical3DContainer container)
        {
            _container = container;
            _control3D = control3D;
            _viewer    = viewer;

            _mprCell = FindFirstMPRCell(viewer);
            _cell    = FindFirstMultiCell(viewer);


            InitializeComponent();
            FillDialogWithOldValues();
        }
Exemplo n.º 11
0
        public OpacityDialog(MedicalViewer control, Medical3DContainer container)
        {
            InitializeComponent();
            _viewer = control;

            MedicalViewer3DCell cell3D = (MedicalViewer3DCell)_viewer.Cells[0];

            _container                     = container;
            _oldOpacityValue               = container.Objects[cell3D.Container.CurrentObjectIndex].Opacity;
            _trackBarOpacity.Maximum       = 100;
            _textBoxOpacity.MaximumAllowed = 100;
            _textBoxOpacity.Value          = (int)container.Objects[cell3D.Container.CurrentObjectIndex].Opacity;
            _trackBarOpacity.Value         = _textBoxOpacity.Value;
        }
Exemplo n.º 12
0
        public RotateDialog(MedicalViewer control, Medical3DContainer container, ItemType type, int objectIndex)
        {
            InitializeComponent();

            _type        = type;
            _control     = control;
            _container   = container;
            _objectIndex = objectIndex;
            _oldPoint    = new Medical3DPoint();

            switch (type)
            {
            case ItemType.Camera:
                Text = "Rotate Camera Dialog";
                _textBoxX.MinimumAllowed = -180;
                _textBoxY.MinimumAllowed = -90;
                _textBoxZ.MinimumAllowed = 0;

                _textBoxX.MaximumAllowed = 180;
                _textBoxY.MaximumAllowed = 90;
                _textBoxZ.MaximumAllowed = 360;

                _trackBarX.Minimum = -180;
                _trackBarY.Minimum = -90;
                _trackBarZ.Minimum = 0;

                _trackBarX.Maximum = 180;
                _trackBarY.Maximum = 90;
                _trackBarZ.Maximum = 360;

                _oldPoint.X = container.Camera.XRotation;
                _oldPoint.Y = container.Camera.YRotation;
                _oldPoint.Z = container.Camera.AxialRotation;

                break;

            case ItemType.Object:
                Text        = "Rotate Object Dialog";
                _oldPoint.X = container.Objects[objectIndex].XRotation;
                _oldPoint.Y = container.Objects[objectIndex].YRotation;
                _oldPoint.Z = container.Objects[objectIndex].ZRotation;
                break;
            }

            _textBoxX.Value = (int)_oldPoint.X;
            _textBoxY.Value = (int)_oldPoint.Y;
            _textBoxZ.Value = (int)_oldPoint.Z;
        }
Exemplo n.º 13
0
        public IsoThresholdDialog(Medical3DControl control3D, MedicalViewer control, Medical3DContainer container)
        {
            InitializeComponent();

            _viewer    = control;
            _control3D = control3D;

            _container         = container;
            _oldThresholdValue = container.Objects[_control3D.ObjectsContainer.CurrentObjectIndex].SSD.Threshold;

            minimum = container.Objects[_control3D.ObjectsContainer.CurrentObjectIndex].MinimumValue;
            maximum = container.Objects[_control3D.ObjectsContainer.CurrentObjectIndex].MaximumValue;

            _textBoxThreshold.MinimumAllowed = minimum;
            _textBoxThreshold.MaximumAllowed = maximum;

            _trackThreshold.Maximum = maximum - minimum;

            _trackThreshold.Value = Math.Min(maximum - minimum, Math.Max(minimum, _oldThresholdValue));
            _control3D.Invalidate();
            _control3D.Update();
        }
Exemplo n.º 14
0
        public ActionDialog(MedicalViewer viewer, Medical3DContainer Medical3DContainer, Medical3DActionType actionType)
        {
            InitializeComponent();
            _viewer   = viewer;
            container = Medical3DContainer;
            type      = actionType;

            switch (type)
            {
            case Medical3DActionType.MoveObject:
                Text = "Move Object Action";
                _cmbButton.SelectedIndex  = (int)container.MoveObject.Button;
                _textBoxSensitivity.Value = (int)container.MoveObject.Sensitivity;
                SetModifier(_cmbModifier, container.MoveObject.Modifier);
                break;

            case Medical3DActionType.RotateObject:
                Text = "Rotate Object Action";
                _cmbButton.SelectedIndex  = (int)container.RotateObject.Button;
                _textBoxSensitivity.Value = (int)container.RotateObject.Sensitivity;
                SetModifier(_cmbModifier, container.RotateObject.Modifier);
                break;

            case Medical3DActionType.ScaleObject:
                Text = "Scale Object Action";
                _cmbButton.SelectedIndex  = (int)container.ScaleObject.Button;
                _textBoxSensitivity.Value = (int)container.ScaleObject.Sensitivity;
                SetModifier(_cmbModifier, container.ScaleObject.Modifier);
                break;

            case Medical3DActionType.MoveCamera:
                Text = "Move Camera Action";
                _cmbButton.SelectedIndex  = (int)container.MoveCamera.Button;
                _textBoxSensitivity.Value = (int)container.MoveCamera.Sensitivity;
                SetModifier(_cmbModifier, container.MoveCamera.Modifier);
                break;

            case Medical3DActionType.RotateCamera:
                Text = "Rotate Camera Action";
                _cmbButton.SelectedIndex  = (int)container.RotateCamera.Button;
                _textBoxSensitivity.Value = (int)container.RotateCamera.Sensitivity;
                SetModifier(_cmbModifier, container.RotateCamera.Modifier);
                break;

            case Medical3DActionType.ZoomCamera:
                Text = "Zoom Camera Action";
                _cmbButton.SelectedIndex  = (int)container.ZoomCamera.Button;
                _textBoxSensitivity.Value = (int)container.ZoomCamera.Sensitivity;
                SetModifier(_cmbModifier, container.ZoomCamera.Modifier);
                break;

            case Medical3DActionType.MovePlane:
                Text = "Move Plane Action";
                _cmbButton.SelectedIndex  = (int)container.MovePlane.Button;
                _textBoxSensitivity.Value = (int)container.MovePlane.Sensitivity;
                SetModifier(_cmbModifier, container.MovePlane.Modifier);
                break;

            case Medical3DActionType.RotatePlane:
                Text = "Rotate Plane Action";
                _cmbButton.SelectedIndex  = (int)container.RotatePlane.Button;
                _textBoxSensitivity.Value = (int)container.RotatePlane.Sensitivity;
                SetModifier(_cmbModifier, container.RotatePlane.Modifier);
                break;

            case Medical3DActionType.WindowLevel:
                Text = "Window Level Action";
                _cmbButton.SelectedIndex  = (int)container.WindowLevel.Button;
                _textBoxSensitivity.Value = (int)container.WindowLevel.Sensitivity;
                SetModifier(_cmbModifier, container.WindowLevel.Modifier);
                break;
            }
        }
Exemplo n.º 15
0
        public SetPlanePoints(MedicalViewer viewer, Medical3DContainer Medical3DContainer, Medical3DVolumeType Medical3DVolumeType, int index)
        {
            InitializeComponent();

            container   = Medical3DContainer;
            type        = Medical3DVolumeType;
            _planeIndex = index;
            _viewer     = viewer;
            Medical3DPoint[] pointArray = null;

            MedicalViewer3DCell cell3D = (MedicalViewer3DCell)_viewer.Cells[0];

            if (_planeIndex == -1)
            {
                switch (type)
                {
                case Medical3DVolumeType.VRT:
                    _planeIndex = container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes.Count - 1;
                    pointArray  = container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes[_planeIndex].GetPlanePoints();
                    break;

                case Medical3DVolumeType.MIP:
                    _planeIndex = container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes.Count - 1;
                    pointArray  = container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes[_planeIndex].GetPlanePoints();
                    break;

                case Medical3DVolumeType.MPR:
                    _planeIndex = container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes.Count - 1;
                    pointArray  = container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes[_planeIndex].GetPlanePoints();
                    break;
                }
            }
            else
            {
                switch (type)
                {
                case Medical3DVolumeType.VRT:
                    pointArray = container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes[_planeIndex].GetPlanePoints();
                    break;

                case Medical3DVolumeType.MIP:
                    pointArray = container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes[_planeIndex].GetPlanePoints();
                    break;

                case Medical3DVolumeType.MPR:
                    pointArray = container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes[_planeIndex].GetPlanePoints();
                    break;
                }
            }

            _textBoxPoint1X.Value = pointArray[0].X;
            _textBoxPoint2X.Value = pointArray[1].X;
            _textBoxPoint3X.Value = pointArray[2].X;

            _textBoxPoint1Y.Value = pointArray[0].Y;
            _textBoxPoint2Y.Value = pointArray[1].Y;
            _textBoxPoint3Y.Value = pointArray[2].Y;

            _textBoxPoint1Z.Value = pointArray[0].Z;
            _textBoxPoint2Z.Value = pointArray[1].Z;
            _textBoxPoint3Z.Value = pointArray[2].Z;
        }