Skip to content

Commit bd60a8e

Browse files
Fixed bugs and added brain phantom
1 parent 2a8de37 commit bd60a8e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

phantoms/brain/sim_brain_phantom.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
import numpy as np
55
import nibabel as nib
66
from scipy.ndimage import zoom
7+
from utilities.data_simulation.Download_data import download_data
78

89
if __name__ == "__main__":
10+
download_data()
911

1012
DIFFUSIVE_REGIME = 'diffusive'
1113
BALLISTIC_REGIME = 'ballistic'
@@ -22,7 +24,7 @@
2224

2325

2426
# Ground truth
25-
nii = nib.load(os.path.join(folder,'ground_truth','hrgt_icbm_2009a_nls_3t.nii.gz'))
27+
nii = nib.load(os.path.join(os.path.split(os.path.split(folder)[0])[0],'download','Phantoms','brain','ground_truth','hrgt_icbm_2009a_nls_3t.nii.gz'))
2628
segmentation = np.squeeze(nii.get_fdata()[...,-1])
2729

2830
with open(os.path.join(folder,'ground_truth',regime+'_groundtruth.json'), 'r') as f:

utilities/data_simulation/Download_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def download_data(force=False):
2121
os.makedirs(os.path.join(base_folder,'download'))
2222
print(f"Folder '{'download'}' created.")
2323
# Change to the specified folder
24-
os.chdir(os.path.join(base_folder,'download'))
24+
os.chdir(os.path.join(base_folder,'download'))
2525
subprocess.run(["zenodo_get", 'https://zenodo.org/records/10696605'])
2626
while not os.path.exists('OSIPI_TF24_data_phantoms.zip'):
2727
time.sleep(1)

0 commit comments

Comments
 (0)