<div dir="ltr">Hi,<div><br></div><div>I'm fairly new to VTK, but I've been stuck for over a day on trying to figure out a fairly simple task.</div><div><br></div><div>I have a numpy array that I'm trying to convert to image data (structured grid), compute the vorticity, and use the cellderivatives to create an array of vorticity magnitude.  I can do this easily in Paraview, but in python the cell derivatives never seem to compute.  </div><div><br></div><div>Here is what I have so far:</div><div><div>vtkdata = numpy_support.numpy_to_vtk(h5file[i][:,:,:,:].ravel(), deep=True, array_type=vtk.VTK_FLOAT)</div><div>vtkdata.SetNumberOfComponents(3)<br></div></div><div><div>image = vtk.vtkImageData()</div><div>image.SetDimensions(xl, yl, zl)   #This is set above and matches the numpy array</div><div>image.GetPointData().AddArray(vtkdata)</div></div><div><br></div><div>At this point, if I write the vti file using vtkXMLImageDataWriter(), I get what I expect in Paraview when I load it.</div><div><br></div><div>Here is where I have problems:</div><div><br></div><div>vorticity = vtk.vtkCellDerivatives()</div><div><div>vorticity.SetVectorModeToComputeVorticity()</div><div>vorticity.SetInputData(image)</div><div>vorticity.Update()</div><div>vwriter = vtk.vtkXMLImageDataWriter()</div><div>vwriter.SetInputData(vorticity.GetOutput())</div><div>vwriter.SetFileName("vorticity.vti")</div></div><div><br></div><div>When I check the vorticity file, it is basically the same as if I never applied the cell derivative filter.  I've tried using the imagestreamer, and basically still get the same results.  I can't seem to find a good vtk6 example on the web that is close enough to what I'm trying.  I also tried the threshold function, and got the same thing, so I think I'm applying the filter incorrectly (not at all in the case).</div><div><br></div><div>Any help would be much appreciated!</div><div><br></div><div>Thanks.</div><div>Stephen</div><div>PhD Student, Johns Hopkins University</div><div><br></div></div>