# 3D VTK Image data to uniform grid filter unavaiable

**URL:** https://discourse.paraview.org/t/3d-vtk-image-data-to-uniform-grid-filter-unavaiable/3925
**Category:** ParaView Support
**Created:** [March 31, 2020, 12:23pm UTC](https://discourse.paraview.org/t/3d-vtk-image-data-to-uniform-grid-filter-unavaiable/3925 "2020-03-31T12:23:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![eatgreen](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/e/c77e96/32.png) [@eatgreen](https://discourse.paraview.org/u/eatgreen)
#### Post date: [March 31, 2020, 12:23pm UTC](https://discourse.paraview.org/t/3d-vtk-image-data-to-uniform-grid-filter-unavaiable/3925/1 "2020-03-31T12:23:38Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Andy\_Bauer](https://discourse.paraview.org/user_avatar/discourse.paraview.org/andy_bauer/32/5442_2.png) [@Andy\_Bauer](https://discourse.paraview.org/u/Andy_Bauer)
#### Post date: [March 31, 2020, 12:46pm UTC](https://discourse.paraview.org/t/3d-vtk-image-data-to-uniform-grid-filter-unavaiable/3925/2 "2020-03-31T12:46:35Z")

</div>

I think the issue is that you’re trying to contour by a vector field. You need to compute the magnitude of your velocity field in order to get a scalar field which you’ll be able to contour by. You can do that with the Calculator filter, or more efficiently the Python Calculator filter.
