Пример #1
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();
        }
Пример #2
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();
        }
Пример #3
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;
        }
Пример #4
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;
                }
            }
        }
Пример #5
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);
        }
Пример #6
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;
        }