Mapping data

Myself Samanvith,

I am doing my post-grad in IIT Indore.

I have 3d gridded data ( 384, 384, 384) and I have a coordinate data, X, Y, Z each of length 122987. I want to map the coordinate data to the gridded data. It would be helpful if I get a solution to it.

use the RessampleToImage filter.

Hey Mathieu,

For which data set I should use RessampleToImage filter.

I tried using it on the gridded data, but there isn’t any satisfactory results

The coordinate data is a array data, X, Y, Z. Then I stored into a single array with each column as X,Y,Z. Then I have stored in a .csv file.
The gridded data, is in .VTK file format

Sorry, not sure to follow what you are trying to achieve, please explain in more details.

@mwestphal
I have extracted data of HI (neutral hydrogen) maps from a binary file, which is I have converted into a 3D gridded data, whose dim is (384, 384 384). I have successfully created a VTK file of this and was able to create a 3D cube of this HI map. I have attached an image of it.
Now I have a data file of Halos( binary file), from which I have extracted the coordinates of halos( X, Y, Z) and then stored it in a CSV file, which has length 122988 each. I have attached the file of this
Now I want to map the coordinates to the HI map. I am not able to understand how to do it.
I hope the explanation helps you.

Mapnumbers.csv (3.5 MB)

You can read in your csv file directly into ParaView. ParaView will initially show it as a table. You can then use the Table To Points filter to convert the table into points located in 3D space. Here is a state file that loads your csv file as described.

load-numbers.pvsm (149.0 KB)

Once you have your points displayed in a 3D space, you can also load in your VTK file of gridded data and show it in the same view at the same time.

Hey @Kenneth_Moreland

I tried the method that you suggested me. But there is a problem in scaling I guess. The VTK data is being displayed too small against the coordinate data rather being displayed together. I have attached both the files for your reference. Please let me know if I am doing anything wrong here.

numbers.csv (3.5 MB)
HI map

Yes, this is a problem with scaling. The bounds of the grid data goes from 0 to 127 in each dimension whereas the bounds of the points go from 0 to 50,000.

I’m pretty sure the problem is with the grid data. A uniform structured grid has an origin (the position of the lower left corner) and a spacing (the size of each cell in the grid). The default spacing of a grid like this is usually 1 (for lack of a better value). That is probably wrong in your case.

There are multiple ways to fix the problem, but the best would be to fix your data file. You can do it for your HI_8_128_grid.vtk file by opening it in a text editor and changing the 6th line from

SPACING 1 1 1

to

SPACING 393.7 393.7 393.7

Hey @Kenneth_Moreland

The method worked totally fine. Thanks a lot for your help and time.

I have another query.

What happen when we tick the " keep all data arrays" when applying table to points filter.

Well, all your data arrays associated to points and cells are copied to the output instead of being removed.