For my M.Sc. Thesis work, I need to apply SPHARM-PDM analysis to certain number of segmented hippocampi from an experiment but I am really new to the program and I still cannot make sense out of it clearly.
When I follow the tutorial, I open the Slicer 3D and I go to the Shape Analysis Model and I want to apply it to the segmented hippocampi mesh file .vtk (which is not empty, I can visualize it in MATLAB through trisurf command). It first converts it from mesh to label map (Step 0 folder is non-empty), then applies post process segmentation and I get the _pp file but on second step I get the following error:
and I don’t know where to look for the problem - I looked through many forum posts and could not find a similar problem. Is it because I am using .vtk file instead of .nii.gz or something similar, a label map? Which I highly doubt because the tutorial says that .vtk files are valid inputs. Is it because there is something wrong in the segmentation or in the settings I have?
I would appreciate any help, thanks in advance.
Arda
Have you visualized the topology of your VTK / nii.gz object? If the Euler Number is not satisfied that means the spherical topology required by SPHARM is not met.
I do not know exactly what you mean by visualizing the topology but when I visualized the .vtk file it was a normal right hippocampus of one subject which was segmented with another program that I used couple of weeks ago, named FSL. Interesting thing is that the program also gives the masks for segmenting out the subcortical structure in NIFTI format, which are label maps (1 for the structure 0 for background) and when I used these files I did not have any problem with applying SPHARM-PDM analysis - there was no Euler number error, I was able to extract SPHARM parameters and visualize the images in the tutorial. Thus, I was really confused. I am not exactly sure if it would be the same analysis doing it through the masks rather than segmented subcortical structure but I would feel more secure if I was able to carry out the analysis through the meshed segmented file .vtk. Do you have any idea what might be the cause of that? Because the structure is the same structure (probably same topology) just different representations, one mesh and one label map. At the end of the day it might not be any problem (especially since I was able to get different SPHARM parameters for different subjects as expected) but I would like to figure out why .vtk mesh file raises the problem of Euler number.
I would double check the SegPostprocess output. It is possible that the scan conversion from VTK to binary label map is causing topology errors. This is a new feature in SPHARM-PDM and I would recommend looking at the label created after the conversion in the Step1_SegPostprocess folder to see if the VTK topology holds after scan conversion.
I encountered the same problem for some triangulated mouse brain surfaces (Euler number = 0). I put here a heuristic solution that I found: I applied the “Close Holes” and “TwoStep Smooth” filters of MeshLab on problematic meshes and then the SPHARM worked properly. The intuition behind this idea is to close holes and refine the problematic regions by smoothing.
Hamed
P.S. I used PyMesh package to check whether a mesh is closed through the method mesh.is_closed(). (https://github.com/qnzhou/PyMesh)
I also encountered the same problem for some binary segmented hippocampal image (voxel), how can i use this tool(MeshLab) to close holes in the voxel-image? Is there any other method to deal with this issue? Thank you very much!
You can find the close hole tool in MeshLab (https://www.meshlab.net/) under the menu “Filters > Remeshing, simplification and reconstruction > Close holes”. I’ve never tried it for voxel-images but for triangulated mesh surfaces. I’m not aware of any other tool to fix this issue.