This project aims to reconstruct the exvivo surface meshes of the brain from in-vivo FreeSurfer meshes.
Our approach consists of:
- Filling in mesh at high resolution into a 3D Volume
- Closing the deep sulci of the brain
- Meshing/Remeshing the 3D Volume using Marching Cubes
Linux
- FreeSurfer
pip
pip install -r requirements.txt
python closing.py <path-to-configs-file>
The first step is to set up the configs of your transformation. You can define them using a JSON file. We provided an example as default.
Config file structure:
- input_mesh: dictionary with input mesh information
- path: path to the original invivo mesh file
- resample_nverts: Number of vertices in the resample
- resolution: volume resolution
- filled_mesh (optional): Pre-computed filled mesh to skip the first step
- remesh (optional): Pre-computed downsample mesh
- closing: dictionary with closing parameters
- pad: zero padding size
- radius: closing sphere radius
- fill_holes: boolean to operate fill function after closing
- visualization: boolean to plot central slices of volumes
- output_dir: path to save directory
- verbose: boolean to print measure of time
- create_surfaces: boolean to generate surfaces from closed volume
After defining your config parameters, you're ready to run the code.
The first part of our code uses FreeSurfer to fill the original surface into a 3D Volume.
Then, we use the morphological operations (closing) of scikit-image to close the brain's deep sulci.
Finally, our code uses FreeSurfer to get the surface of our volume and then converts it to our visualization using FreeView.
You can access the files in the selected output directory