title: How to convert a 3D vtkDataSet into a numpy array?
body: <p>I am trying to read a series of DICOM files and render it into a 3D Model. I have accomplished this. However I also want to be able to remove certain slices before rendering. This is where I am lost. I am unable to find a way to access each file loaded and remove the ones I want. I have read that I could convert the the dataset to a numpy array. However I am uncertain as to how I could do that.</p>
  
  <pre><code>    reader = vtkDICOMImageReader()
      reader.SetDirectoryName('loads a directory of DICOM files')
      reader.Update()
  
      imageDataGeometryFilter = vtkImageDataGeometryFilter()
      imageDataGeometryFilter.SetInputConnection(reader.GetOutputPort())
      imageDataGeometryFilter.Update()
  
      mapper = vtkPolyDataMapper()
      mapper.SetInputConnection(imageDataGeometryFilter.GetOutputPort())
  
      '''Here is where I want to take my vtkDataSet and convert it into a numpy array.
         Once in array form I can remove data that I do not want (ie DICOM slices).
         Then I want to convert it back into a vtkDataSet to continue program.
      '''
  
  
  
      actor = vtkActor()
      actor.SetMapper(mapper)
  
      ren = vtkRenderer()
      ren.AddActor(actor)
      ren.SetBackground(0.1,0.3,0.1)
  
      renWin = vtkRenderWindow()
      renWin.AddRenderer(ren)
  
      interactor = vtkRenderWindowInteractor()
      interactor.SetRenderWindow(renWin)
  
      renWin.Start()
  
      interactor.Initialize()
      interactor.Start()
  </code></pre>