You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enh: simplify by using class variable in place of string
Use class variable for defining the default download hierarchy template.
This simplifies updating the default template, improves readability and
will allow for specifying alternative preset templates more easily.
validate_manifest (bool, optional): If True, validates the manifest for any errors. Defaults to True.
488
491
show_progress_bar (bool, optional): If True, tracks the progress of download
489
492
use_s5cmd_sync (bool, optional): If True, will use s5cmd sync operation instead of cp when downloadDirectory is not empty; this can significantly improve the download speed if the content is partially downloaded
490
-
dirTemplate (str): A template string for the directory path. Must start with %. Defaults to %collection_id/%PatientID/%Modality/%StudyInstanceUID/%SeriesInstanceUID. It can contain attributes (PatientID, collection_id, Modality, StudyInstanceUID, SeriesInstanceUID) wrapped in '%'. Special characters can be used as connectors: '-' (hyphen), '/' (slash for subdirectories), '_' (underscore). Can be disabled by None.
493
+
dirTemplate (str): A template string for the directory path. Must start with %. Defaults to index.DOWNLOAD_HIERARCHY_DEFAULT. It can contain attributes (PatientID, collection_id, Modality, StudyInstanceUID, SeriesInstanceUID) wrapped in '%'. Special characters can be used as connectors: '-' (hyphen), '/' (slash for subdirectories), '_' (underscore). Can be disabled by None.
491
494
492
495
Returns:
493
496
total_size (float): The total size of all series in the manifest file.
output (str): The output of s5cmd sync --dry-run command.
793
796
downloadDir (str): The directory to download the files to.
794
-
dirTemplate (str): A template string for the directory path. Defaults to %collection_id/%PatientID/%Modality/%StudyInstanceUID/%SeriesInstanceUID. It can contain attributes (PatientID, collection_id, Modality, StudyInstanceUID, SeriesInstanceUID) wrapped in '%'. Special characters can be used as connectors: '-' (hyphen), '/' (slash for subdirectories), '_' (underscore). Can be disabled by None.
797
+
dirTemplate (str): A template string for the directory path.
795
798
796
799
Returns:
797
800
Path: The path to the generated synced manifest file.
@@ -904,7 +907,7 @@ def _s5cmd_run(
904
907
quiet (bool, optional): If True, suppresses the stdout and stderr of the s5cmd command.
905
908
show_progress_bar (bool, optional): If True, tracks the progress of download
906
909
use_s5cmd_sync (bool, optional): If True, will use s5cmd sync operation instead of cp when downloadDirectory is not empty; this can significantly improve the download speed if the content is partially downloaded
907
-
dirTemplate (str): A template string for the directory path. Defaults to %collection_id/%PatientID/%Modality/%StudyInstanceUID/%SeriesInstanceUID. It can contain attributes (PatientID, collection_id, Modality, StudyInstanceUID, SeriesInstanceUID) wrapped in '%'. Special characters can be used as connectors: '-' (hyphen), '/' (slash for subdirectories), '_' (underscore). Can be disabled by None.
910
+
dirTemplate (str): A template string for the directory path.
908
911
909
912
Raises:
910
913
subprocess.CalledProcessError: If the s5cmd command fails.
Download the manifest file. In a series of steps, the manifest file
@@ -1094,7 +1097,7 @@ def download_from_manifest(
1094
1097
validate_manifest (bool, optional): If True, validates the manifest for any errors. Defaults to True.
1095
1098
show_progress_bar (bool, optional): If True, tracks the progress of download
1096
1099
use_s5cmd_sync (bool, optional): If True, will use s5cmd sync operation instead of cp when downloadDirectory is not empty; this can significantly improve the download speed if the content is partially downloaded
1097
-
dirTemplate (str): A template string for the directory path. Defaults to %collection_id/%PatientID/%Modality/%StudyInstanceUID/%SeriesInstanceUID. It can contain attributes (PatientID, collection_id, Modality, StudyInstanceUID, SeriesInstanceUID) wrapped in '%'. Special characters can be used as connectors: '-' (hyphen), '/' (slash for subdirectories), '_' (underscore). Can be disabled by None.
1100
+
dirTemplate (str): A template string for the directory path. Defaults to index.DOWNLOAD_HIERARCHY_DEFAULT set to %collection_id/%PatientID/%StudyInstanceUID/%Modality_%SeriesInstanceUID. It can contain attributes (PatientID, collection_id, Modality, StudyInstanceUID, SeriesInstanceUID) prefixed by '%'. The following special characters can be used as connectors: '-' (hyphen), '/' (slash for subdirectories), '_' (underscore). When set to None all files will be downloaded to the download directory with no subdirectories.
1098
1101
1099
1102
Raises:
1100
1103
ValueError: If the download directory does not exist.
"""Download the files corresponding to the selection. The filtering will be applied in sequence (but does it matter?) by first selecting the collection(s), followed by
1151
1153
patient(s), study(studies) and series. If no filtering is applied, all the files will be downloaded.
0 commit comments