/// <summary>
        /// Update 3d view after directory has changed.
        /// </summary>
        /// <param name="dicomLoader">Updated dicom loader.</param>
        public void ChangeDirectory(DicomLoader dicomLoader)
        {
            _dicomLoader = dicomLoader;
            _mapper.Dispose();
            _mapper = vtkSmartVolumeMapper.New();
            _mapper.SetInput(_dicomLoader.GetOutput());
            _mapper.Update();

            _window.RenderWindow.GetRenderers().GetFirstRenderer().RemoveVolume(_volume);
            _volume.Dispose();
            _volume = vtkVolume.New();
            _volume.SetMapper(_mapper);
            _volume.Update();

            _window.RenderWindow.GetRenderers().GetFirstRenderer().AddVolume(_volume);
            _window.RenderWindow.GetRenderers().GetFirstRenderer().Render();

            SetupPlane(PlaneWidgetX);
            SetupPlane(PlaneWidgetY);
            SetupPlane(PlaneWidgetZ);

            // Render
            _window.RenderWindow.Render();
            _window.Validate();
            _window.Update();

            _clipingModule = new ClipingObject(GetObjectSize());
        }
Пример #2
0
        public void ApplySetting(string setting)
        {
            if (setting == "Visible")
            {
                if (_volumeLayer.TissueSettings.Visible)
                {
                    _vtkVolume.VisibilityOn();
                }
                else
                {
                    _vtkVolume.VisibilityOff();
                }
            }
            else
            {
                SetOpacityTransferFunction();

                if (setting != "Opacity")
                {
                    SetColorTransferFunction();
                }
            }
            _vtkVolume.Update();
        }
        public void ChangeDirectory(DicomLoader dicomLoader)
        {
            _dicomLoader = dicomLoader;
            _mapper.Dispose();
            _mapper = vtkSmartVolumeMapper.New();
            _mapper.SetInput(_dicomLoader.GetOutput());
            _mapper.Update();

            _window.RenderWindow.GetRenderers().GetFirstRenderer().RemoveVolume(_volume);
            _volume.Dispose();
            _volume = vtkVolume.New();
            SetOpacityFunction();
            SetGradientOpacity();
            _volume.SetMapper(_mapper);
            _volume.Update();

            _window.RenderWindow.GetRenderers().GetFirstRenderer().AddVolume(_volume);
            _window.RenderWindow.GetRenderers().GetFirstRenderer().Render();

            SetupPlane(PlaneWidgetX);
            SetupPlane(PlaneWidgetY);
            SetupPlane(PlaneWidgetZ);

            // Render
            _window.RenderWindow.Render();
            _window.Validate();
            _window.Update();

            _clipingModule = new ClipingModule(GetObjectSize());
        }