Skip to content

Commit 0801ec3

Browse files
removed waiting and resolved conflicts
1 parent bd60a8e commit 0801ec3

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

utilities/data_simulation/Download_data.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,9 @@ def download_data(force=False):
2222
print(f"Folder '{'download'}' created.")
2323
# Change to the specified folder
2424
os.chdir(os.path.join(base_folder,'download'))
25-
subprocess.run(["zenodo_get", 'https://zenodo.org/records/10696605'])
26-
while not os.path.exists('OSIPI_TF24_data_phantoms.zip'):
27-
time.sleep(1)
25+
subprocess.check_call(["zenodo_get", 'https://zenodo.org/records/10696605'])
2826
# Open the zip file
2927
if force or not os.path.exists('Data'):
3028
# Unzip the file
3129
unzip_file('OSIPI_TF24_data_phantoms.zip', '.')
32-
# Wait for the extraction to complete by checking for the existence of any file
33-
# Wait for the extraction to complete by checking for expected subdirectories
34-
expected_subdirectories = [os.path.join('Utilities','DRO.npy'),os.path.join('Data','abdomen.nii.gz'), os.path.join('Data','brain.nii.gz'), os.path.join('Phantoms','brain','data','ballistic_snr200.nii.gz'), os.path.join('Phantoms','brain','data','diffusive_snr200.nii.gz'), os.path.join('Phantoms','XCAT_MAT_RESP','XCAT5D_RP_1_CP_1.mat'), os.path.join('Phantoms','XCAT_MAT_RESP','XCAT5D_RP_9_CP_1.mat'), os.path.join('Phantoms','XCAT_MAT_RESP','XCAT5D_RP_20_CP_1.mat')] # Add the expected subdirectories
35-
while not all(
36-
os.path.isfile(subdir) for subdir in expected_subdirectories):
37-
time.sleep(1) # Wait for 1 second
38-
time.sleep(10)
3930
os.chdir(curdir)

0 commit comments

Comments
 (0)