Updates
Browse files- README.md +25 -22
- brain2vec.py +1 -1
README.md
CHANGED
@@ -19,28 +19,7 @@ An autoencoder model for brain structure T1 MRIs based on [Brain Latent Progress
|
|
19 |
- [PatchAdversarialLoss](https://docs.monai.io/en/stable/losses.html#patchadversarialloss)
|
20 |
- [PerceptualLoss](https://docs.monai.io/en/stable/losses.html#perceptualloss)
|
21 |
|
22 |
-
# License
|
23 |
-
MIT License
|
24 |
|
25 |
-
Copyright (c) 2025
|
26 |
-
|
27 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
28 |
-
of this software and associated documentation files (the "Software"), to deal
|
29 |
-
in the Software without restriction, including without limitation the rights
|
30 |
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
31 |
-
copies of the Software, and to permit persons to whom the Software is
|
32 |
-
furnished to do so, subject to the following conditions:
|
33 |
-
|
34 |
-
The above copyright notice and this permission notice shall be included in all
|
35 |
-
copies or substantial portions of the Software.
|
36 |
-
|
37 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
38 |
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
39 |
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
40 |
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
41 |
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
42 |
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
43 |
-
SOFTWARE.
|
44 |
|
45 |
# Training data
|
46 |
[Radiata brain-structure](https://huggingface.co/datasets/radiata-ai/brain-structure): 3066 scans from 2085 individuals in the 'train' split. Mean age = 45.1 +- 24.5, including 2847 scans from cognitively normal subjects and 219 scans from individuals with an Alzheimer's disease clinical diagnosis.
|
@@ -58,7 +37,8 @@ source venv_brain2vec/bin/activate
|
|
58 |
# install Python libraries
|
59 |
pip install -r requirements.txt
|
60 |
|
61 |
-
# create the csv file listing the scan paths and other info
|
|
|
62 |
python create_csv.py
|
63 |
|
64 |
mkdir ae_cache
|
@@ -97,3 +77,26 @@ Pinaya
|
|
97 |
publisher = {Hugging Face}
|
98 |
}
|
99 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
- [PatchAdversarialLoss](https://docs.monai.io/en/stable/losses.html#patchadversarialloss)
|
20 |
- [PerceptualLoss](https://docs.monai.io/en/stable/losses.html#perceptualloss)
|
21 |
|
|
|
|
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
# Training data
|
25 |
[Radiata brain-structure](https://huggingface.co/datasets/radiata-ai/brain-structure): 3066 scans from 2085 individuals in the 'train' split. Mean age = 45.1 +- 24.5, including 2847 scans from cognitively normal subjects and 219 scans from individuals with an Alzheimer's disease clinical diagnosis.
|
|
|
37 |
# install Python libraries
|
38 |
pip install -r requirements.txt
|
39 |
|
40 |
+
# create the csv file inputs.csv listing the scan paths and other info
|
41 |
+
# this script loads the radiata-ai/brain-structure dataset
|
42 |
python create_csv.py
|
43 |
|
44 |
mkdir ae_cache
|
|
|
77 |
publisher = {Hugging Face}
|
78 |
}
|
79 |
```
|
80 |
+
|
81 |
+
# License
|
82 |
+
MIT License
|
83 |
+
|
84 |
+
Copyright (c) 2025
|
85 |
+
|
86 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
87 |
+
of this software and associated documentation files (the "Software"), to deal
|
88 |
+
in the Software without restriction, including without limitation the rights
|
89 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
90 |
+
copies of the Software, and to permit persons to whom the Software is
|
91 |
+
furnished to do so, subject to the following conditions:
|
92 |
+
|
93 |
+
The above copyright notice and this permission notice shall be included in all
|
94 |
+
copies or substantial portions of the Software.
|
95 |
+
|
96 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
97 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
98 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
99 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
100 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
101 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
102 |
+
SOFTWARE.
|
brain2vec.py
CHANGED
@@ -560,7 +560,7 @@ def inference(
|
|
560 |
for image_path in tqdm(df.image_path, total=len(df)):
|
561 |
destpath = os.path.join(
|
562 |
output_dir,
|
563 |
-
os.path.basename(image_path).replace('.nii.gz', '
|
564 |
)
|
565 |
if os.path.exists(destpath):
|
566 |
continue
|
|
|
560 |
for image_path in tqdm(df.image_path, total=len(df)):
|
561 |
destpath = os.path.join(
|
562 |
output_dir,
|
563 |
+
os.path.basename(image_path).replace('.nii.gz', '_embeddings.npz').replace('.nii', '_embeddings.npz')
|
564 |
)
|
565 |
if os.path.exists(destpath):
|
566 |
continue
|