Code changes
Browse files- README.md +8 -6
- inference_brain2vec_PCA.py +8 -5
README.md
CHANGED
@@ -22,8 +22,10 @@ A linear PCA model for brain structure T1 MRIs. The models takes in a 3d MRI NIf
|
|
22 |
# Example usage
|
23 |
```
|
24 |
# get brain2vec_PCA model repository
|
|
|
25 |
git clone https://huggingface.co/radiata-ai/brain2vec_PCA
|
26 |
cd brain2vec_PCA
|
|
|
27 |
|
28 |
# set up virtual environemt
|
29 |
python3 -m venv venv_brain2vec_PCA
|
@@ -51,14 +53,14 @@ python inference_brain2vec_PCA.py \
|
|
51 |
--pca_model pca_model.joblib \
|
52 |
--input_images /path/to/img1.nii.gz /path/to/img2.nii.gz \
|
53 |
--output_dir pca_output \
|
54 |
-
--embeddings_filename
|
55 |
--save_recons
|
56 |
-
|
57 |
-
# or if you have a CSV with image paths:
|
58 |
python inference_brain2vec_PCA.py \
|
59 |
-
--pca_model
|
60 |
-
--csv_input
|
61 |
-
--output_dir
|
|
|
62 |
```
|
63 |
|
64 |
# Methods
|
|
|
22 |
# Example usage
|
23 |
```
|
24 |
# get brain2vec_PCA model repository
|
25 |
+
git lfs install # Ensure Git LFS is installed and enabled
|
26 |
git clone https://huggingface.co/radiata-ai/brain2vec_PCA
|
27 |
cd brain2vec_PCA
|
28 |
+
git lfs pull
|
29 |
|
30 |
# set up virtual environemt
|
31 |
python3 -m venv venv_brain2vec_PCA
|
|
|
53 |
--pca_model pca_model.joblib \
|
54 |
--input_images /path/to/img1.nii.gz /path/to/img2.nii.gz \
|
55 |
--output_dir pca_output \
|
56 |
+
--embeddings_filename pca_embeddings_2 \
|
57 |
--save_recons
|
58 |
+
|
|
|
59 |
python inference_brain2vec_PCA.py \
|
60 |
+
--pca_model pca_model.joblib \
|
61 |
+
--csv_input inputs.csv \
|
62 |
+
--output_dir pca_output \
|
63 |
+
--embeddings_filename pca_embeddings_all
|
64 |
```
|
65 |
|
66 |
# Methods
|
inference_brain2vec_PCA.py
CHANGED
@@ -10,16 +10,19 @@ reconstructions) for each image.
|
|
10 |
Example usage:
|
11 |
|
12 |
python inference_brain2vec_PCA.py \
|
13 |
-
--pca_model
|
14 |
--input_images /path/to/img1.nii.gz /path/to/img2.nii.gz \
|
15 |
-
--output_dir
|
|
|
|
|
16 |
|
17 |
Or, if you have a CSV with image paths:
|
18 |
|
19 |
python inference_brain2vec_PCA.py \
|
20 |
-
--pca_model
|
21 |
-
--csv_input
|
22 |
-
--output_dir
|
|
|
23 |
"""
|
24 |
|
25 |
import os
|
|
|
10 |
Example usage:
|
11 |
|
12 |
python inference_brain2vec_PCA.py \
|
13 |
+
--pca_model pca_model.joblib \
|
14 |
--input_images /path/to/img1.nii.gz /path/to/img2.nii.gz \
|
15 |
+
--output_dir pca_output \
|
16 |
+
--embeddings_filename pca_embeddings_2 \
|
17 |
+
--save_recons
|
18 |
|
19 |
Or, if you have a CSV with image paths:
|
20 |
|
21 |
python inference_brain2vec_PCA.py \
|
22 |
+
--pca_model pca_model.joblib \
|
23 |
+
--csv_input inputs.csv \
|
24 |
+
--output_dir pca_output \
|
25 |
+
--embeddings_filename pca_embeddings_all
|
26 |
"""
|
27 |
|
28 |
import os
|