Skip to content

SGI-2023/Invivo-Exvivo-2023

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exvivo surface mesh reconstruction from in-vivo FreeSurfer meshes

Project Goal

This project aims to reconstruct the exvivo surface meshes of the brain from in-vivo FreeSurfer meshes.

Our approach consists of:

  1. Filling in mesh at high resolution into a 3D Volume
  2. Closing the deep sulci of the brain
  3. Meshing/Remeshing the 3D Volume using Marching Cubes

Requirements

⚠️ Warning: This installation was only tested on Linux

  1. FreeSurfer
  2. pip

Setup

pip install -r requirements.txt

Usage

python closing.py <path-to-configs-file>

Getting Started

⚠️ Warning: To follow this tutorial, you'll need access to our data. If you don't have one, contact one of the project members.

1. Setup

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.

2. Filling in the Mesh into a 3D Volume

The first part of our code uses FreeSurfer to fill the original surface into a 3D Volume.

Filling Surface

3. Closing the brain's deep sulci

Then, we use the morphological operations (closing) of scikit-image to close the brain's deep sulci.

Filling Surface

4. Meshing/Remeshing the 3D Volume using Marching Cubes

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

invivo Original invivo surface

exvivo Transformed exvivo surface

exvivo_ex Example of Ground-Truth exvivo surface

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages