[vtkusers] How create 3d image from DICOM-files in C#?

Андрей Глухов realandron at gmail.com
Wed Jan 20 03:13:47 EST 2010


I find my error. I forged DicomReader.Update()...sorry for bothering.

18 января 2010 г. 15:16 пользователь Андрей Глухов
<realandron at gmail.com>написал:

> Hello. Hi. I looked at an example
> http://devsample.org/index.php?option=com_content&task=view&id=18&Itemid=1, but
> I do not understand what properties should be set for Interactor.
>
>   vtkRenderer ren1 = new vtkRenderer();
>             ren1.SetBackground(0, 0, 0);
>
>             vtkRenderWindow Win = reWin.GetRenderWindow(); ;
>             Win.AddRenderer(ren1);
>
>             vtkRenderWindowInteractor iren = new
> vtkRenderWindowInteractor();
>             iren.SetRenderWindow(Win);
>
>             vtkDICOMImageReader DicomReader = new vtkDICOMImageReader();
>             DicomReader.SetDirectoryName(@"directory");
>
>             vtkImageData ImageData = new vtkImageData();
>             ImageData.DeepCopy(DicomReader.GetOutput());
>
>             vtkPiecewiseFunction m_pOpacityTransferFunction = new
> vtkPiecewiseFunction();
>             vtkColorTransferFunction m_pColorTransferFunction = new
> vtkColorTransferFunction();
>
>             vtkVolumeProperty VolumeProperty = new vtkVolumeProperty();
>             VolumeProperty.SetColor(m_pColorTransferFunction);
>             VolumeProperty.SetScalarOpacity(m_pOpacityTransferFunction);
>             VolumeProperty.SetInterpolationTypeToLinear();
>             VolumeProperty.ShadeOff();
>
>             vtkVolume Volume = new vtkVolume();
>             Volume.SetProperty(VolumeProperty);
>
>             vtkFixedPointVolumeRayCastMapper VolumeMapperSoftware = new
> vtkFixedPointVolumeRayCastMapper();
>             VolumeMapperSoftware.SetInput(ImageData);
>             VolumeMapperSoftware.SetSampleDistance(1.0f);
>             VolumeMapperSoftware.SetBlendModeToMaximumIntensity();
>             Volume.SetMapper(VolumeMapperSoftware);
>
>             ren1.AddVolume(Volume);
>             ren1.ResetCamera();
>             iren.Initialize();
>             iren.Start();// There error AccessViolationException.
>
> Help me please. Thanks in advance.
> --
> С Уважением,
> Андрей.
>



-- 
С Уважением,
Андрей.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100120/e8110bb0/attachment.htm>


More information about the vtkusers mailing list