[vtkusers] VTK Model and ITKImageBase itkImage_UC3

Sam sistephan at gmail.com
Sun Nov 21 16:09:21 EST 2010


David,

Why does the Accumulator.Update throw an Access Exception?  Please check my
pipeline.


            vtkPolyDataReader polyDataReader = new vtkPolyDataReader();
            polyDataReader.SetFileName("C:\\DICOModel\\OriginalModel.vtk");
            polyDataReader.Update();
            vtkPolyData model = polyDataReader.GetOutput();

            //Read in MRI Volume
            itkImageBase imageInput = ImageType.New();
            imageInput.ReadSeries("C:\\DICOMVolume", "*.dcm");

            //Convert itkImagebase into a vtkImageData
            vtkImageData dicomImageData = new vtkImageData();
            itkImageToVTKImageFilter_IUC3 convertITKToVTK =
itkImageToVTKImageFilter_IUC3.New();
            convertITKToVTK.SetInput(imageInput);
            convertITKToVTK.Update();
            
            dicomImageData = convertITKToVTK.GetOutput();     

            vtkDataObject dicomDataObject = dicomImageData;

            //Create an image stencil (mask) out of the model.
            vtkPolyDataToImageStencil modelStencilPolyData = new
vtkPolyDataToImageStencil();
            modelStencilPolyData.SetInput(model); //model is a PolyData
Object.

            vtkImageAccumulate modelAccumulate = new vtkImageAccumulate();
            modelAccumulate.SetInput(dicomDataObject);
            modelAccumulate.SetStencil(modelStencilPolyData.GetOutput());
            modelAccumulate.Update(); //causes access violation error
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/VTK-Model-and-ITKImageBase-itkImage-UC3-tp3273888p3274672.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list