Skip to content

Coregisters pre and post-op MRI images and identifies resection

License

Notifications You must be signed in to change notification settings

ajoshiusc/auto_resection_mask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auto Resection Mask

This tools Coregisters pre and post-op MRI images and identifies resection.

Here is an example dataset to run through the module.

The code is documented in the jupyter notebook main_automask.ipynb

This notebook shows an example workflow to delineate resection on MRI image.

Inputs: Pre-op MRI image, Post-op MRI image
Outputs: Post-op MRI image affinely registered to pre-op MRI image, resection mask (<subject>.resection.mask.nii.gz)

To run the code, NVidia GPU is required.

To run the code, please open main_automask.ipynb as a jupyter notebook, correct paths of our input pre-op and post-op MRIs and run the code.

Installation

  • Make sure you have BrainSuite installed.
  • A devcontainer is available with the repository. Open .devcontainer.json file and set the data and code paths.
  • Open the cloned folder using vscode. This will prompt you to open the repo in a devcontainer. Alternatively, you can configure a python environment by manually installing requirements.txt
  • BrainSuite needs to be installed on your system. If you don't have it, please install it.

image

Usage

Running the code

  • Assume as input, you have preop.nii.gz (pre-op MRI), and post-op.nii.gz (post-op MRI with resection). Open Jupyter notebook main_automask.ipynb in vscode.
  • Go to the Input Cell and add the paths to preop.nii.gz and post-op.nii.gz. Add the path to the BrainSuite installation folder.
  • Run the notebook.

Manually editing the resection mask

If you are not completely happy with the resection mask generated by the module, you can edit it in BrainSuite using the Mask Tool. Here is one example video for mask editing using the Mask Tool (although the video shows different mask being edited, you can apply the same process to resection mask).

Importing to BrainStorm

The resection mask created by the tool can be imported into BrainStorm during import anatomy.

  • Open BrainStorm, Import anatomy as a (BrainSuite processed folder)[https://neuroimage.usc.edu/brainstorm/Tutorials/SegBrainSuite].
  • You will see resection (resection surface), and resection_mask (resection volume). You can visualize them in BrainStorm by right clicking and selecting options of your choice.

bstm_resection

Visualization in BrainSuite

  • Open BrainSuite and load pre-op.nii.gz
  • Click on File->Overlay Volume and select pre-op.post2pre.nii.gz" and load it. This is the post-op volume coregistred to pre-op volume.
  • Click on File->Open mask volume and select resection.mask.nii.gz and load it. This will show outline of the identified resection.
  • Goto Tools->Mask Tool and generate a surface.
drawing

Support

About

Coregisters pre and post-op MRI images and identifies resection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published