/// <summary>
        /// Update the 2D visualization when the plane moved.
        /// </summary>
        /// <param name="plane">PlaneWidget which changed the coordinates.</param>
        public void PlaneMoved(vtkImagePlaneWidget plane)
        {
            vtkImageReslice reslice   = vtkImageReslice.New();
            vtkTransform    transform = vtkTransform.New();

            transform.PostMultiply();

            //TODO wyznaczenie centrum okna
            double[] center = { 75, 100, 0 };
            transform.Translate(-center[0], -center[1], -center[2]);
            transform.RotateZ(_orientation);
            transform.Translate(+center[0], +center[1], +center[2]);

            transform.Update();
            reslice.SetInput(plane.GetResliceOutput());
            reslice.SetResliceTransform(transform);
            reslice.Update();
            //
            vtkImageData viewerInputData;

            viewerInputData = reslice.GetOutput();

            _lastData = viewerInputData;

            _viewer.SetInput(viewerInputData);
            //
            //_viewer.SetInput(reslice.GetOutput());
            UpdateViewer();
        }
예제 #2
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();
        }
예제 #3
0
        public void sliceX(float slicePosition)
        {
            this.slicePosition = slicePosition;
            widget             = vtkImagePlaneWidget.New();
            widget.SetInput(dicomReader.GetOutput());
            widget.SetPlaneOrientationToXAxes();
            widget.SetSliceIndex((int)slicePosition);
            widget.SetWindowLevel(this.windowWidth, this.windowLevel, 1);
            viewer.SetInput(widget.GetResliceOutput());
            viewer.Render();

            window.Update();
            window.RenderWindow.Render();
        }
        public void sliceZ(float slicePosition)
        {
            this.slicePosition = slicePosition;
            widget = vtkImagePlaneWidget.New();
            widget.SetInput(dicomReader.GetOutput());
            widget.SetPlaneOrientationToZAxes();
            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();
        }
        /// <summary>
        /// Update the 2D visualization when the plane moved.
        /// </summary>
        /// <param name="plane">PlaneWidget which changed the coordinates.</param>
        public void PlaneMoved(vtkImagePlaneWidget plane)
        {
            vtkImageReslice reslice = vtkImageReslice.New();
            vtkTransform transform = vtkTransform.New();
            transform.PostMultiply();

            //TODO wyznaczenie centrum okna
            double[] center = {75, 100, 0};
            transform.Translate( -center[0], -center[1], -center[2] );
            transform.RotateZ(_orientation);
            transform.Translate( +center[0], +center[1], +center[2] );

            transform.Update();
            reslice.SetInput(plane.GetResliceOutput());
            reslice.SetResliceTransform(transform);
            reslice.Update();

            _viewer.SetInput(reslice.GetOutput());
            UpdateViewer();
        }
예제 #7
0
 /// <summary>
 /// Update the 2D visualization when the plane moved.
 /// </summary>
 /// <param name="plane">PlaneWidget which changed the coordinates.</param>
 public void PlaneMoved(vtkImagePlaneWidget plane)
 {
     _viewer.SetInput(plane.GetResliceOutput());
     UpdateViewer();
 }
 /// <summary>
 /// Update the 2D visualization when the plane moved.
 /// </summary>
 /// <param name="plane">PlaneWidget which changed the coordinates.</param>
 public void PlaneMoved(vtkImagePlaneWidget plane)
 {
     _viewer.SetInput(plane.GetResliceOutput());
     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();
        }