Skip to content

Commit

Permalink
removed waiting and resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverchampion committed Mar 6, 2024
1 parent bd60a8e commit 0801ec3
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions utilities/data_simulation/Download_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,9 @@ def download_data(force=False):
print(f"Folder '{'download'}' created.")
# Change to the specified folder
os.chdir(os.path.join(base_folder,'download'))
subprocess.run(["zenodo_get", 'https://zenodo.org/records/10696605'])
while not os.path.exists('OSIPI_TF24_data_phantoms.zip'):
time.sleep(1)
subprocess.check_call(["zenodo_get", 'https://zenodo.org/records/10696605'])
# Open the zip file
if force or not os.path.exists('Data'):
# Unzip the file
unzip_file('OSIPI_TF24_data_phantoms.zip', '.')
# Wait for the extraction to complete by checking for the existence of any file
# Wait for the extraction to complete by checking for expected subdirectories
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
while not all(
os.path.isfile(subdir) for subdir in expected_subdirectories):
time.sleep(1) # Wait for 1 second
time.sleep(10)
os.chdir(curdir)

0 comments on commit 0801ec3

Please sign in to comment.