Generation of fetal inner cortical (white) surfaces with spherical topology using a simple pipeline. Note that this pipeline is similar to the non deep learning (DL) part of most DL tools such as DeepCSR or CortexODE. It consists of the following steps:
- Extraction of a closed binary mask of each hemisphere by combining the segmented structures from BOUNTI,
- Correction of the topology in the voxel space using Bazin et al. tools (NiRes),
- Extraction of the closed mesh using a classical marching cubes algorithm,
- (optional) Refinement of the mesh (triangles, edges and vertices) using the docker of pymesh, enforcing a regular sampling of the surface,
- Laplacian smoothing of the mesh using Trimesh.
APACHE2.0 License inherited from Nighres
util.tca correspond to the topology correction algorithm by Bazin et al., reimplemented in python+Numba by Qiang Ma in https://github.com/m-qiang/CortexODE. Please cite the original papers if you use this code:
- Bazin et al. Topology correction using fast marching methods and its application to brain segmentation. MICCAI, 2005.
- Bazin et al. Topology correction of segmented medical images using a fast marching algorithm. Computer methods and programs in biomedicine, 2007.
- Q. Ma, L. Li, E. C. Robinson, B. Kainz, D. Rueckert and A. Alansary, "CortexODE: Learning Cortical Surface Reconstruction by Neural ODEs," in IEEE Transactions on Medical Imaging, vol. 42, no. 2, pp. 430-443, Feb. 2023, doi: 10.1109/TMI.2022.3206221.
- trimesh
- nibabel
- scikit-image
- numba
- pymesh (docker version)
conda create --name surfaces python=3.8
conda activate surfaces
pip install -r requirements.txtdocker pull macatools/surf_proc:v0.0.1esingularity build /path/to/save/surf_proc_v0.0.1e.sif docker://macatools/surf_proc:v0.0.1eSet the parameters and run the script
python generate_mesh.py -s my_dseg_file.nii.gz -l 1 -m my_dseg_file_1.stl