MantisBT - VTK | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0009068 | VTK | (No Category) | public | 2009-05-26 14:39 | 2016-08-12 09:55 |
| Reporter | ppeetteerr | ||||
| Assigned To | Kitware Robot | ||||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | moved | ||
| Platform | OS | OS Version | |||
| Product Version | |||||
| Target Version | Fixed in Version | ||||
| Project | |||||
| Type | |||||
| Summary | 0009068: vtkPolyDataConnectivityFilter() doesn't filter data when passed to out using vtk_to_numpy | ||||
| Description | I'm not sure whether this is a vtkPolyDataConnectivityFilter() or a vtk_to_numpy issue, I assume the latter. vtkPolyDataConnectivityFilter() succesfully filters the data when rendering the data or writing the data to an stl. However when I use vtk_to_numpy the surronding regions are passed as well. The odd thing is that some of the regions are filtered. I can tell this by running size. In the example below SetExtractionModeToLargestRegion() eliminates some of the data (size(ar) shrinks from 618 to 597) Using a standardized dataset the code is below import vtk import vtk.util.numpy_support as VN from pylab import * reader = vtk.vtkRectilinearGridReader() reader.SetFileName('.\RectGrid2.vtk') skinExtractor = vtk.vtkContourFilter() skinExtractor.SetInputConnection(reader.GetOutputPort()) skinExtractor.SetValue(0, 5.2) skinConnect=vtk.vtkPolyDataConnectivityFilter() skinConnect.SetInputConnection(skinExtractor.GetOutputPort()) skinConnect.SetExtractionModeToLargestRegion() skinNormals = vtk.vtkPolyDataNormals() skinNormals.SetInputConnection(skinConnect.GetOutputPort()) skinNormals.SetFeatureAngle(60.0) skinMapper = vtk.vtkPolyDataMapper() skinMapper.SetInputConnection(skinNormals.GetOutputPort()) skinMapper.ScalarVisibilityOn() skinMapper.SetColorModeToMapScalars() skinMapper.SelectColorArray('scalars') skinActor = vtk.vtkActor() skinActor.SetMapper(skinMapper) skinu = skinNormals.GetOutput() # Force the pipeline to execute skinu.Update() ar = VN.vtk_to_numpy(skinu.GetPoints().GetData()) #print ar temp=[] for item in ar: if item[2]>0.899999: temp+=[item] temp=array(temp) x1=temp[:,0] y1=temp[:,1] scatter(x1,y1) show() ren = vtk.vtkRenderer() ren.AddActor(skinActor) renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) ren.ResetCamera() renWin.Render() iren.Initialize() iren.Start() ========================================= | ||||
| Steps To Reproduce | |||||
| Additional Information | |||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | |||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2009-05-26 14:39 | ppeetteerr | New Issue | |||
| 2011-06-16 13:11 | Zack Galbreath | Category | => (No Category) | ||
| 2016-08-12 09:55 | Kitware Robot | Note Added: 0037079 | |||
| 2016-08-12 09:55 | Kitware Robot | Status | expired => closed | ||
| 2016-08-12 09:55 | Kitware Robot | Resolution | open => moved | ||
| 2016-08-12 09:55 | Kitware Robot | Assigned To | => Kitware Robot | ||
| Notes | |||||
|
|
|||||
|
|
||||