ResampleToImage Filter for FE mesh

I have created a volumetric mesh using gmsh toolkit. It has a liver inside of a box. I have used two physical groups one is to hold the data for the liver and the other group is to hold the whole 3D volumetric mesh using gmsh. I’m able to export this mesh as a .vtk file (i.e. as an unstructuredGrid) using the gmsh GUI.

Then I loaded it to the ParaView and applied the ResampleToImage filter to this volumetric mesh in order to voxelize this as an image volume and saved it as a .mhd file.

Next, I have passed this generated image volume to the SyddonJacobRayTracing algorithm in the ITK tool to produce the corresponding DRR image.

Moreover, I have implemented an algorithm to project each 3D vertex coordinate of the liver mesh onto the DRR plane in the same way that the SyddonJacob algorithm does. I am convinced that this vertex projection is correct because I have done testing manually as well.

I have rendered the projected coordinates of this 3D coordinates of the liver mesh on the corresponding DRR image to check whether they are aligned correctly. But I have noticed that they are not correctly aligned with each other. See the image below.

My first guess is the issue is with the voxelization part that I have done using the ParaView means with the ResamplingToImage Filter. I assume it does not work correctly in this case.

Any help would be appreciated regarding this matter.

I herewith attached the generated .mhd file and the volumetric mesh (i.e. box + liver) for your further reference.

ref_volumetric_liver_box_mhd.zip (893.3 KB)

volumetric_liver_box.vtk (181.9 KB)