Issue regarding the ResampleToImage Filter for FE mesh

I have created a volumetric mesh using gmsh toolkit. It has a an ellipsoid 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 was able to export this mesh as a .vtk file (i.e. as an unstructuredGrid) using the gmsh GUI.

Then I have 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 ellipsoid mesh (after applying the threshold filter and save ellipsoid separately) 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 ellipsoid 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. The black dots are the projections of the vertices of the volumetric ellipsoid.

It seems that the vertices and the DRR are mis-scaled by a factor of 2.

My first guess is the issue is with the voxelization part that I have done using the ResamplingToImage Filter. I assume it does not work correctly in this case, in particular FE meshes (In my whole mesh (i.e. ellipsoid + box) it consists of two scalars).

Any help would be appreciated regarding this matter.

I herewith attached the generated .mhd file, the whole volumetric mesh (i.e. box + ellipsoid) and the volumetric ellipsoid (this is filtered by after applying the threshold filter) for your further reference.


box_ellipsoid_vtk.zip (1.4 MB)
reference_ellipsoid_box_mhd.zip (241.1 KB)
ellipsoid.vtk (66.8 KB)