-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbatch_quantify.py
More file actions
33 lines (22 loc) · 1.13 KB
/
batch_quantify.py
File metadata and controls
33 lines (22 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""
Batch quantification of collagen from multiple datasets
-
"""
import os
from time import sleep
import subprocess
datasets_dir = '/blue/pinaki.sarder/samuelborder/Farzad_Fibrosis/020524_DUET_Patches/'
datasets_list = [i for i in os.listdir(datasets_dir) if os.path.isdir(datasets_dir+i)]
print(datasets_list)
print(f'---------Found {len(datasets_list)} models! Wow!----------------------')
output_dir = '/Collagen_Quantification/'
results_dir = '/Results/Ensemble_RGB/Testing_Output/'
b_dir = '/B/'
f_dir = '/F/'
threshold = 0.1
use_stitched = True
for dataset_name in datasets_list:
# If only running for the ones that haven't been quantified yet
#if not os.path.exists(f'{datasets_dir}{dataset_name}/{output_dir}'):
process = subprocess.Popen(["python3", "Collagen_Segmentation/CollagenQuantify.py", "--test_image_path", f'{datasets_dir}{dataset_name}{results_dir}','--bf_image_dir',f'{datasets_dir}{dataset_name}{b_dir}','--f_image_dir',f'{datasets_dir}{dataset_name}{f_dir}','--output_dir',f'{datasets_dir}{dataset_name}{output_dir}','--threshold',f'{threshold}','--use_stitched',f'{use_stitched}'])
process.wait()