[vtkusers] Reference İmage problem

seyyah776 seyyah776 seyyah776 at gmail.com
Thu Dec 13 22:47:14 EST 2012


this image syngo fastview opened vtk As the image is not opened yellow lines

wants to open up the image of dicom images in series that is, or fails to
fold <attempted to read or write protected memory. This is often an
indication that other memory is corrupt.> This problem disappears when the
image disappear series
please help me

> my code

   private void ReadDICOMSeries()

        {

            try

            {


>                 vtkTesting test = vtkTesting.New();

                string root = test.GetDataRoot();

                vtkStringArray f = vtkStringArray.New();


>
>
>                 vtkDICOMImageReader reader = vtkDICOMImageReader.New();

                reader.SetDirectoryName(@"C:\Users\dr
> who\Desktop\YEDEK2\a\");


>                 double[] spacing = reader.GetOutput().GetSpacing();


>


>                 reader.Update();

                // Visualize

                _ImageViewer = vtkImageViewer2.New();

                _ImageViewer.SetInput(reader.GetOutput());

                // get range of slices (min is the first index, max is the
> last index)

                _ImageViewer.GetSliceRange(ref _MinSlice, ref _MaxSlice);


>
>                 // slice status message

                vtkTextProperty sliceTextProp = vtkTextProperty.New();

                sliceTextProp.SetFontFamilyToCourier();

                sliceTextProp.SetFontSize(20);

                sliceTextProp.SetVerticalJustificationToBottom();

                sliceTextProp.SetJustificationToLeft();


>                 _SliceStatusMapper = vtkTextMapper.New();


>                 _SliceStatusMapper.SetProgressText("Yükleniyor");

                _SliceStatusMapper.SetInput("Slice No " + (_Slice +
> 1).ToString() + "/" + (_MaxSlice + 1).ToString());

                _SliceStatusMapper.SetTextProperty(sliceTextProp);


>                 vtkActor2D sliceStatusActor = vtkActor2D.New();

                sliceStatusActor.SetMapper(_SliceStatusMapper);

                sliceStatusActor.SetPosition(15, 10);


>                 // usage hint message

                vtkTextProperty usageTextProp = vtkTextProperty.New();

                usageTextProp.SetFontFamilyToCourier();

                usageTextProp.SetFontSize(14);

                usageTextProp.SetVerticalJustificationToTop();

                usageTextProp.SetJustificationToLeft();


>                 vtkTextMapper usageTextMapper = vtkTextMapper.New();

                usageTextMapper.SetInput("Slice with mouse wheel\nor
> Up/Down-Key");

                usageTextMapper.SetTextProperty(usageTextProp);


>                 vtkActor2D usageTextActor = vtkActor2D.New();

                usageTextActor.SetMapper(usageTextMapper);


> usageTextActor.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay();

                usageTextActor.GetPositionCoordinate().SetValue(0.05, 0.95);


>                 vtkRenderWindow renderWindow =
> renderWindowControl1.RenderWindow;


>
>                 vtkInteractorStyleImage interactorStyle =
> vtkInteractorStyleImage.New();


>                 interactorStyle.MouseWheelForwardEvt += new
> vtkObject.vtkObjectEventHandler(interactor_MouseWheelForwardEvt);

                interactorStyle.MouseWheelBackwardEvt += new
> vtkObject.vtkObjectEventHandler(interactor_MouseWheelBackwardEvt);


>
> renderWindow.GetInteractor().SetInteractorStyle(interactorStyle);

                renderWindow.GetRenderers().InitTraversal();


>
>
>                 //vtkRenderer ren;

                //while ((ren = renderWindow.GetRenderers().GetNextItem())
> != null)

                //    ren.SetBackground(0.20, 0.0, 0.0);


>                 _ImageViewer.SetRenderWindow(renderWindow);

                _ImageViewer.GetRenderer().AddActor2D(sliceStatusActor);

                _ImageViewer.GetRenderer().AddActor2D(usageTextActor);

                _ImageViewer.SetSlice(_MinSlice);


>
>                 renderWindowControl1.AutoScroll = true;



              _ImageViewer.Render();





            }

            catch { }

        }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121214/beca174f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 02744768.jpg
Type: image/jpeg
Size: 136389 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121214/beca174f/attachment.jpg>


More information about the vtkusers mailing list