Skip to content

OishiLab/OpenMAP-T2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenMAP-T2

OpenMAP-T2 parcellates the whole brain into 280 anatomical regions based on JHU-atlas in 70 (sec/case).

Installation Instructions

  1. install python and make virtual environment
    Python 3.9 or later is recommended.

If you encounter issues, please consider using a different version.

  1. Clone this repository, and go into the repository:
git clone https://github.com/OishiLab/OpenMAP-T2.git
cd OpenMAP-T2
  1. Please install PyTorch compatible with your environment.
    https://pytorch.org/

Once you select your environment, the required commands will be displayed.

image

If you want to install an older Pytorch environment, you can download it from the link below.
https://pytorch.org/get-started/previous-versions/

  1. Install libraries other than PyTorch:
pip install -r requirements.txt
  1. Please apply and download the pre-trained model from the link below and upload it to your server.
    Link of pretrained model

  2. You can run OpenMAP-T2 !!

How to use it

Using OpenMAP-T2 is straightforward. You can use it in any terminal on your linux system. We provide CPU as well as GPU support. Running on GPU is a lot faster though and should always be preferred. Here is a minimalistic example of how you can use OpenMAP-T2.

python3 parcellation.py -i INPUT_FOLDER -o OUTPUT_FOLDER -m MODEL_FOLDER

If you want to specify the GPU, please add CUDA_VISIBLE_DEVICES=N.

CUDA_VISIBLE_DEVICES=1 python3 parcellation.py -i INPUT_FOLDER -o OUTPUT_FOLDER -m MODEL_FOLDER

If the error occurs for Windows users, please change Python3 to Python.

How to download the pretrained model.

You can get the pretrained model from this link. Link of pretrained model

image

Folder

All images you input must be in NifTi format and have a .nii extension.

INPUR_FOLDER/
  ├ A.nii
  ├ B.nii
  ├ *.nii

OUTPUT_FOLDER/
  ├ A/
  | ├ A.nii # input image
  | ├ A_SylvianRatio.csv # Ratio of Sylvian Fissure to CSF Sulcus
  | ├ A_Type1_Level5.csv # volume information of Type1_Level1 (mm^3)
  | ├ A_stripped_mask # skull stripped brain mask
  | └ A_280.nii # parcellation map
  └ B/
    ├ B.nii
    ├ B_SylvianRatio.csv.nii
    ├ B_Type1_Level5.csv.nii
    ├ B_stripped_mask.csv
    └ B_280.nii

MODEL_FOLDER/
  ├ SSNet/SSNet.pth
  ├ PNet
  |   ├ coronal.pth
  |   ├ sagittal.pth
  |   └ axial.pth
  └ HNet/
      ├ coronal.pth
      └ axial.pth

FAQ

  • How much GPU memory do I need to run OpenMAP-T2?
    We ran all our experiments on NVIDIA RTX3090 GPUs with 24 GB memory. For inference you will need less, but since inference in implemented by exploiting the fully convolutional nature of CNNs the amount of memory required depends on your image. Typical image should run with less than 4 GB of GPU memory consumption. If you run into out of memory problems please check the following: 1) Make sure the voxel spacing of your data is correct and 2) Ensure your MRI image only contains the head region.

  • Will you provide the training code as well?
    No. The training code is tightly wound around the data which we cannot make public.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages