コード例 #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);
        }
コード例 #2
0
ファイル: RotatePlane.cs プロジェクト: sakpung/webstudy
        private void _btnOK_Click(object sender, EventArgs e)
        {
            MedicalViewer3DCell cell3D = (MedicalViewer3DCell)_control.Cells[0];

            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;
            }


            switch (_type)
            {
            case Medical3DVolumeType.MIP:
                _container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes[_planeIndex].Rotate(_trackBarRotatePlane.Value, _axis, _space);
                break;

            case Medical3DVolumeType.VRT:
                _container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes[_planeIndex].Rotate(_trackBarRotatePlane.Value, _axis, _space);
                break;

            case Medical3DVolumeType.MPR:
                _container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes[_planeIndex].Rotate(_trackBarRotatePlane.Value, _axis, _space);
                break;
            }
        }
コード例 #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();
        }
コード例 #4
0
        void UpdatePlanePointNormal()
        {
            MedicalViewer3DCell cell3D = (MedicalViewer3DCell)_viewer.Cells[0];

            switch (_type)
            {
            case Medical3DVolumeType.MIP:
                normal = _container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes[_planeIndex].Normal;
                point  = _container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes[_planeIndex].Point;
                break;

            case Medical3DVolumeType.VRT:
                normal = _container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes[_planeIndex].Normal;
                point  = _container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes[_planeIndex].Point;
                break;

            case Medical3DVolumeType.MPR:
                normal = _container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes[_planeIndex].Normal;
                point  = _container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes[_planeIndex].Point;
                break;
            }

            _textBoxPointX.Value  = point.X;
            _textBoxPointY.Value  = point.Y;
            _textBoxPointZ.Value  = point.Z;
            _textBoxNormalX.Value = normal.X;
            _textBoxNormalY.Value = normal.Y;
            _textBoxNormalZ.Value = normal.Z;
        }
コード例 #5
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;
        }
コード例 #6
0
ファイル: RotatePlane.cs プロジェクト: sakpung/webstudy
        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;
                }
            }
        }
コード例 #7
0
ファイル: OpacityDialog.cs プロジェクト: sakpung/webstudy
        private void _btnReset_Click(object sender, EventArgs e)
        {
            MedicalViewer3DCell cell3D = (MedicalViewer3DCell)_viewer.Cells[0];

            _container.Objects[cell3D.Container.CurrentObjectIndex].Opacity = _oldOpacityValue;
            _textBoxOpacity.Value = (int)100;
        }
コード例 #8
0
ファイル: OpacityDialog.cs プロジェクト: sakpung/webstudy
        private void _trackBarOpacity_Scroll(object sender, EventArgs e)
        {
            if (_trackBarOpacity.Value != _textBoxOpacity.Value)
            {
                _textBoxOpacity.Value = _trackBarOpacity.Value;
            }

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

            _container.Objects[cell3D.Container.CurrentObjectIndex].Opacity = _textBoxOpacity.Value;
        }
コード例 #9
0
ファイル: OpacityDialog.cs プロジェクト: sakpung/webstudy
        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;
        }
コード例 #10
0
        private void GetPlanePoint()
        {
            MedicalViewer3DCell cell3D = (MedicalViewer3DCell)_viewer.Cells[0];

            switch (_type)
            {
            case Medical3DVolumeType.VRT:
                point = _container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes[_planeIndex].Point;
                break;

            case Medical3DVolumeType.MIP:
                point = _container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes[_planeIndex].Point;
                break;

            case Medical3DVolumeType.MPR:
                point = _container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes[_planeIndex].Point;
                break;
            }
        }
コード例 #11
0
        void ApplyMove()
        {
            MedicalViewer3DCell cell3D = (MedicalViewer3DCell)_viewer.Cells[0];

            switch (_container.VolumeType)
            {
            case Medical3DVolumeType.VRT:
                _container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes[_planeIndex].Move(_trackBarMovePlane.Value / 1000.0f);
                break;

            case Medical3DVolumeType.MIP:
                _container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes[_planeIndex].Move(_trackBarMovePlane.Value / 1000.0f);
                break;

            case Medical3DVolumeType.MPR:
                _container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes[_planeIndex].Move(_trackBarMovePlane.Value / 1000.0f);
                break;
            }
        }
コード例 #12
0
        void applyNewValue(bool old)
        {
            if (_dontApply)
            {
                return;
            }

            Medical3DPoint currentPoint;
            Medical3DPoint currentNormal;

            if (old)
            {
                currentPoint  = new Medical3DPoint(point.X, point.Y, point.Z);
                currentNormal = new Medical3DPoint(normal.X, normal.Y, normal.Z);
            }
            else
            {
                currentPoint  = new Medical3DPoint(_textBoxPointX.Value, _textBoxPointY.Value, _textBoxPointZ.Value);
                currentNormal = new Medical3DPoint(_textBoxNormalX.Value, _textBoxNormalY.Value, _textBoxNormalZ.Value);
            }

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

            switch (_type)
            {
            case Medical3DVolumeType.MIP:
                _container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes[_planeIndex].Point  = currentPoint;
                _container.Objects[cell3D.Container.CurrentObjectIndex].MIP.Planes[_planeIndex].Normal = currentNormal;
                break;

            case Medical3DVolumeType.VRT:
                _container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes[_planeIndex].Point  = currentPoint;
                _container.Objects[cell3D.Container.CurrentObjectIndex].VRT.Planes[_planeIndex].Normal = currentNormal;
                break;

            case Medical3DVolumeType.MPR:
                _container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes[_planeIndex].Point  = currentPoint;
                _container.Objects[cell3D.Container.CurrentObjectIndex].MPR.Planes[_planeIndex].Normal = currentNormal;
                break;
            }

            cell3D.Invalidate();
        }
コード例 #13
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;
        }
コード例 #14
0
ファイル: OpacityDialog.cs プロジェクト: sakpung/webstudy
        private void _btnCancel_Click(object sender, EventArgs e)
        {
            MedicalViewer3DCell cell3D = (MedicalViewer3DCell)_viewer.Cells[0];

            _container.Objects[cell3D.Container.CurrentObjectIndex].Opacity = _oldOpacityValue;
        }