SUGAR Official Repository
PyTorch3D A library for deep learning with 3D data
PyTorch Scatter PyTorch Extension Library of Optimized Scatter Operations
PyG Graph Neural Network Library for PyTorch
Download an example data from GoogleDrive or Baidu NetDisk, the surface and morphometrics for registration are preprocessed using FreeSurfer recon-all.
If new datasets are welling to be used, please make sure you have all the pre-request files.
run docker container is highly recommended, as you only need to pull docker.
sudo docker pull ninganme/sugar:latest
sudo docker run -it --rm --gpus all \
-v test_dataset_path:/data \
-v output_path:/out sugar \
--fsd /usr/local/freesurfer \
--sd /data \
--out /out \
--sid sub01 \
--hemi lh \
--device cuda
download model Google Drive or Baidu NetDisk.
Note: please have FreeSurfer properly installed, as the registration atlas is from FreeSurfer (FreeSurfer/subjects/fsaverage)
# install pytorch
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113
# install pytorch3d
pip install fvcore==0.1.5.post20221221
pip3 install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1121/download.html
# install torch_geometric
pip install --no-index pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-1.12.1+cu113.html
pip install torch_geometric==2.2.0
# install nibabel
pip install nibabel==3.2.2
cd SUGAR
python3 predict.py \
--sd test_dataset_path \
--out output_path \
--fsd freesurfer_path \
--sid sub01 \
--model-path model_path \
--hemi lh \
--device cuda