Beispiel #1
0
        public void update2DVisualization(float windowLevel, float windowWidth)
        {
            this.windowLevel = windowLevel;
            this.windowWidth = windowWidth;

            widget = vtkImagePlaneWidget.New();
            widget.SetInput(dicomReader.GetOutput());
            widget.SetPlaneOrientationToYAxes();
            widget.SetSliceIndex((int)slicePosition);
            widget.SetWindowLevel(this.windowWidth, this.windowLevel, 1);
            viewer.SetInput(widget.GetResliceOutput());
            viewer.Render();
        }
Beispiel #2
0
        public void sliceY(float slicePosition)
        {
            this.slicePosition = slicePosition;
            widget             = vtkImagePlaneWidget.New();
            widget.SetInput(dicomReader.GetOutput());
            widget.SetPlaneOrientationToYAxes();
            widget.SetSliceIndex((int)slicePosition);
            widget.SetWindowLevel(this.windowWidth, this.windowLevel, 1);
            viewer.SetInput(widget.GetResliceOutput());
            viewer.Render();

            window.Update();
            window.RenderWindow.Render();
        }
        public void sliceY(float slicePosition)
        {
            this.slicePosition = slicePosition;
            widget = vtkImagePlaneWidget.New();
            widget.SetInput(dicomReader.GetOutput());
            widget.SetPlaneOrientationToYAxes();
            widget.SetSliceIndex((int) slicePosition);
            widget.SetWindowLevel(this.windowWidth, this.windowLevel, 1);
            viewer.SetInput(widget.GetResliceOutput());
            viewer.Render();

            window.Update();
            window.RenderWindow.Render();
        }
        //TODO

        /// <summary>
        /// Update the 2D visualization window with new slice of pass X, Y or Z coordination.
        /// </summary>
        /// <param name="dicomLoader"> Dicom input from we are going to cut the slice.</param>
        /// <param name="slicePosition">Coordinates of the slice. </param>
        /// <param name="axis">Name of axis to set cut orientation (X,Y,Z). </param>
        public void SliceToAxes(DicomLoader dicomLoader, float slicePosition, Axis axis)
        {
            vtkImagePlaneWidget planeWidget = vtkImagePlaneWidget.New();

            planeWidget.SetInput(dicomLoader.GetOutput());
            if (axis == Axis.X)
            {
                planeWidget.SetPlaneOrientationToXAxes();
            }
            else if (axis == Axis.Y)
            {
                planeWidget.SetPlaneOrientationToYAxes();
            }
            else if (axis == Axis.Z)
            {
                planeWidget.SetPlaneOrientationToZAxes();
            }
            planeWidget.SetSliceIndex((int)slicePosition);
            _viewer.SetInput(planeWidget.GetResliceOutput());
            planeWidget.Dispose();

            UpdateViewer();
        }
        public void update2DVisualization(float windowLevel, float windowWidth)
        {
            this.windowLevel = windowLevel;
            this.windowWidth = windowWidth;

            widget = vtkImagePlaneWidget.New();
            widget.SetInput(dicomReader.GetOutput());
            widget.SetPlaneOrientationToYAxes();
            widget.SetSliceIndex((int)slicePosition);
            widget.SetWindowLevel(this.windowWidth, this.windowLevel, 1);
            viewer.SetInput(widget.GetResliceOutput());
            viewer.Render();
        }