Hi there,
I want to plot contour (isovalues) for a 3D image VTK data using Paraview. My vtkImageData is generated by following code:
auto writer = vtkSmartPointer<vtkXMLImageDataWriter>::New(); auto dataSet = vtkSmartPointer<vtkImageData>::New(); auto velocity = vtkSmartPointer<vtkDoubleArray>::New(); dataSet->SetExtent(0, nx_fullgrid-1, 0, ny_fullgrid-1, 0, nz_fullgrid-1); dataSet->SetOrigin(0,0,0); dataSet->SetSpacing(dXc_minimal.x, dXc_minimal.y, dXc_minimal.z); velocity->SetNumberOfComponents(3); velocity->SetNumberOfTuples(nx_fullgrid*ny_fullgrid*nz_fullgrid); for(int k=0; k<nz_fullgrid; k++){ for(int j=0; j<ny_fullgrid; j++){ for(int i=0; i<nx_fullgrid; i++){ velocity->SetTuple3(k*nx_fullgrid*ny_fullgrid+j*nx_fullgrid+i, U_onfullgrid3D[k](j,i), V_onfullgrid3D[k](j,i), W_onfullgrid3D[k](j,i)); } } } dataSet->GetPointData()->AddArray(velocity); velocity->SetName("Velocity"); writer->SetFileName(resfilename.c_str()); writer->SetInputData(dataSet); writer->Write();
The generated data can be imported by selecting the “XML image data reader”. The visualization on the velocity field is also fine. But when I tried to convert the image data to points (which i think is a necessary step for contour creation), I find it impossible to convert the image data to uniform grid nor table format. Because these filters are not available. I have not been able to identify the reason after an hour’s googling. Any help is appreciated. Thanks for your support.