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); }
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; } }
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(); }
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; }
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; }
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; } } }
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; }
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; }
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; }
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; } }
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; } }
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(); }
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; }
private void _btnCancel_Click(object sender, EventArgs e) { MedicalViewer3DCell cell3D = (MedicalViewer3DCell)_viewer.Cells[0]; _container.Objects[cell3D.Container.CurrentObjectIndex].Opacity = _oldOpacityValue; }