-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "initial attempt at moving all resources files to OSF"
This reverts commit 608eff6.
- Loading branch information
Showing
103 changed files
with
1,064 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
T1w: 'https://zenodo.org/record/4508747/files/trained_model.3d_fullres.Task101_hcp1200_T1w.nnUNetTrainerV2.model_best.tar' | ||
T2w: 'https://zenodo.org/record/4508747/files/trained_model.3d_fullres.Task102_hcp1200_T2w.nnUNetTrainerV2.model_best.tar' | ||
neonateT1w: 'https://zenodo.org/record/5733556/files/trained_model.3d_fullres.Task205_hcp1200_b1000_finetuneround2_dhcp_T1w.nnUNetTrainerV2.model_best.tar' | ||
neonateT1w_v2: 'https://zenodo.org/record/8209029/files/trained_model.3d_fullres.Task301_dhcp_T1w_synthseg_manuallycorrected.nnUNetTrainer.model_best.tar' | ||
hippb500: 'https://zenodo.org/record/5732291/files/trained_model.3d_fullres.Task110_hcp1200_b1000crop.nnUNetTrainerV2.model_best.tar' | ||
T1T2w: 'https://zenodo.org/record/4508747/files/trained_model.3d_fullres.Task103_hcp1200_T1T2w.nnUNetTrainerV2.model_best.tar' | ||
synthseg_v0.1: 'https://dropbox.com/s/asoanq94ofersv3/trained_model.3d_fullres.Task102_synsegGenDetailed.nnUNetTrainerV2.model_best.tar' | ||
synthseg_v0.2: 'https://www.dropbox.com/scl/fi/69yvmo38gdn3dj8aupq9z/trained_model.3d_fullres.Task203_synthseg.nnUNetTrainerV2.model_best.tar?rlkey=90km7u4t0cw8t15akr5tawxyl&dl=0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#!/usr/bin/env python3 | ||
import argparse | ||
import errno | ||
import os | ||
|
||
import requests | ||
import yaml | ||
from appdirs import AppDirs | ||
|
||
|
||
def get_model_dict(): | ||
# get list of model urls | ||
model_cfg = os.path.join( | ||
os.path.dirname(__file__), "config", "nnunet_model_urls.yml" | ||
) | ||
with open(model_cfg, "r") as cfg: | ||
model_dict = yaml.load(cfg, Loader=yaml.FullLoader) | ||
return model_dict | ||
|
||
|
||
def parse_args(model_dict): | ||
parser = argparse.ArgumentParser( | ||
prog="hippunfold_download_models", | ||
description="Tool for downloading U-net models for hippunfold", | ||
) | ||
|
||
parser.add_argument("--models", nargs="+", dest="models", choices=model_dict.keys()) | ||
args = parser.parse_args() | ||
return args | ||
|
||
|
||
def main(): | ||
|
||
# get the model dict first, so we know what to parse | ||
model_dict = get_model_dict() | ||
inputs = parse_args(model_dict) | ||
|
||
if "HIPPUNFOLD_CACHE_DIR" in os.environ.keys(): | ||
print( | ||
f"HIPPUNFOLD_CACHE_DIR defined, using: {os.environ['HIPPUNFOLD_CACHE_DIR']}" | ||
) | ||
download_dir = os.environ["HIPPUNFOLD_CACHE_DIR"] | ||
else: | ||
print(f"HIPPUNFOLD_CACHE_DIR not defined, using default location") | ||
# create local download dir if it doesn't exist | ||
dirs = AppDirs("hippunfold", "khanlab") | ||
download_dir = dirs.user_cache_dir | ||
|
||
try: | ||
os.mkdir(download_dir) | ||
except OSError as exc: | ||
if exc.errno != errno.EEXIST: | ||
raise | ||
pass | ||
|
||
if inputs.models == None: | ||
models = model_dict.keys() | ||
else: | ||
models = inputs.models | ||
|
||
for modality in models: | ||
url = model_dict[modality] | ||
tarfile = url.split("/")[-1] | ||
local_path = os.path.join(download_dir, tarfile) | ||
|
||
# add ?dl=1 to url | ||
url = "".join([url, "?dl=1"]) | ||
|
||
# if it doesn't exist, download the file | ||
if not os.path.exists(local_path): | ||
# download it: | ||
print(f"Downloading {modality} model...") | ||
print(f" url = {url}") | ||
print(f" dest = {local_path}") | ||
r = requests.get(url, allow_redirects=True, stream=True) | ||
with open(local_path, "wb") as f: | ||
f.write(r.content) | ||
print(" Download complete") | ||
else: | ||
print(f"Skipping {modality} model: already downloaded to {local_path}") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
24 changes: 24 additions & 0 deletions
24
hippunfold/resources/atlases-unfolded/bigbrain/bigbrain_snaplabels.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
################################################ | ||
# ITK-SnAP Label Description File | ||
# File format: | ||
# IDX -R- -G- -B- -A-- VIS MSH LABEL | ||
# Fields: | ||
# IDX: Zero-based index | ||
# -R-: Red color component (0..255) | ||
# -G-: Green color component (0..255) | ||
# -B-: Blue color component (0..255) | ||
# -A-: Label transparency (0.00 .. 1.00) | ||
# VIS: Label visibility (0 or 1) | ||
# IDX: Label mesh visibility (0 or 1) | ||
# LABEL: Label description | ||
################################################ | ||
0 0 0 0 0 0 0 "Clear Label" | ||
1 255 0 0 1 1 1 "Subiculum" | ||
2 0 255 0 1 1 1 "CA1" | ||
3 0 0 255 1 1 1 "CA2" | ||
4 255 255 0 1 1 1 "CA3" | ||
5 0 255 255 1 1 1 "CA4" | ||
6 255 0 255 1 1 1 "DG" | ||
7 255 239 213 1 1 1 "SRLM" | ||
8 240 86 224 1 1 1 "Cyst" | ||
|
9 changes: 9 additions & 0 deletions
9
hippunfold/resources/atlases-unfolded/bigbrain/desc-subfields_atlas-bigbrain_dseg.tsv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
index name abbreviation | ||
1 subiculum Sub | ||
2 CA1 CA1 | ||
3 CA2 CA2 | ||
4 CA3 CA3 | ||
5 CA4 CA4 | ||
6 dentate_gyrus DG | ||
7 SRLM SRLM | ||
8 cysts Cyst |
Binary file added
BIN
+62.6 KB
...atlases-unfolded/bigbrain/sub-bigbrain_hemi-L_label-hipp_desc-manualsubfields_dseg.nii.gz
Binary file not shown.
Binary file added
BIN
+56.5 KB
...atlases-unfolded/bigbrain/sub-bigbrain_hemi-R_label-hipp_desc-manualsubfields_dseg.nii.gz
Binary file not shown.
10 changes: 10 additions & 0 deletions
10
hippunfold/resources/atlases-unfolded/bigbrain/sub-bigbrain_labellist.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Subiculum | ||
1 0 0 255 255 | ||
CA1 | ||
2 133 222 255 255 | ||
CA2 | ||
3 0 255 170 255 | ||
CA3 | ||
4 255 162 0 255 | ||
CA4 | ||
5 255 0 0 255 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Freesurfer subfield atlas | ||
|
||
Generated using workflow from https://github.com/khanlab/hippunfold-create-atlas#freesurfer | ||
This creates probalistic and maxprob (used here) labels by running hippunfold & freesurfer subfield segmentation on ds002168 (openneuro, 48 subjects) and mapping the freesurfer labels to the unfolded space. | ||
|
||
|
10 changes: 10 additions & 0 deletions
10
hippunfold/resources/atlases-unfolded/freesurfer/desc-subfields_atlas-freesurfer_dseg.tsv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
index name abbreviation | ||
203 parasubiculum ParaSub | ||
204 presubiculum PreSub | ||
205 subiculum Sub | ||
206 CA1 CA1 | ||
208 CA3 CA3 | ||
209 CA4_and_dentate gyrus CA4_DG | ||
226 tail Tail | ||
227 SRLM SRLM | ||
228 cysts Cyst |
10 changes: 10 additions & 0 deletions
10
hippunfold/resources/atlases-unfolded/freesurfer/desc-subfields_freeview_desg.tsv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#No. Label Name R G B A | ||
1 subiculum 255 0 0 0 | ||
2 CA1 0 255 0 0 | ||
3 CA2 0 0 255 0 | ||
4 CA3 255 255 0 0 | ||
5 CA4 0 255 255 0 | ||
6 dentate_gyrus 255 0 255 0 | ||
7 SRLM 255 239 213 0 | ||
8 cysts 0 0 205 0 | ||
|
88 changes: 88 additions & 0 deletions
88
hippunfold/resources/atlases-unfolded/freesurfer/freesurfer_labellist.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
alveus | ||
201 255 204 153 255 | ||
perforant_pathway | ||
202 255 128 128 255 | ||
parasubiculum | ||
203 175 175 75 255 | ||
presubiculum | ||
204 64 0 64 255 | ||
subiculum | ||
205 0 0 255 255 | ||
CA1 | ||
206 255 0 0 255 | ||
CA2 | ||
207 128 128 255 255 | ||
CA3 | ||
208 0 128 0 255 | ||
CA4 | ||
209 196 160 128 255 | ||
GC-DG | ||
210 32 200 255 255 | ||
HATA | ||
211 128 255 128 255 | ||
fimbria | ||
212 204 153 204 255 | ||
lateral_ventricle | ||
213 121 17 136 255 | ||
molecular_layer_HP | ||
214 128 0 0 255 | ||
hippocampal_fissure | ||
215 128 32 255 255 | ||
entorhinal_cortex | ||
216 255 204 102 255 | ||
molecular_layer_subiculum | ||
217 128 128 128 255 | ||
Amygdala | ||
218 104 255 255 255 | ||
Cerebral_White_Matter | ||
219 0 226 0 255 | ||
Cerebral_Cortex | ||
220 205 63 78 255 | ||
Inf_Lat_Vent | ||
221 197 58 250 255 | ||
Perirhinal | ||
222 33 150 250 255 | ||
Cerebral_White_Matter_Edge | ||
223 226 0 0 255 | ||
Background | ||
224 100 100 100 255 | ||
Ectorhinal | ||
225 197 150 250 255 | ||
HP_tail | ||
226 170 170 255 255 | ||
Polymorphic-Layer | ||
227 128 255 128 255 | ||
Intracellular-Space | ||
228 204 153 204 255 | ||
HP_body | ||
231 0 255 0 255 | ||
HP_head | ||
232 255 0 0 255 | ||
presubiculum-head | ||
233 32 0 32 255 | ||
presubiculum-body | ||
234 64 0 64 255 | ||
subiculum-head | ||
235 0 0 175 255 | ||
subiculum-body | ||
236 0 0 255 255 | ||
CA1-head | ||
237 175 75 75 255 | ||
CA1-body | ||
238 255 0 0 255 | ||
CA3-head | ||
239 0 80 0 255 | ||
CA3-body | ||
240 0 128 0 255 | ||
CA4-head | ||
241 120 90 50 255 | ||
CA4-body | ||
242 196 160 128 255 | ||
GC-ML-DG-head | ||
243 75 125 175 255 | ||
GC-ML-DG-body | ||
244 32 200 255 255 | ||
molecular_layer_HP-head | ||
245 100 25 25 255 | ||
molecular_layer_HP-body | ||
246 128 0 0 255 |
Oops, something went wrong.