imaging_api.routers.download ============================ .. py:module:: imaging_api.routers.download Attributes ---------- .. autoapisummary:: imaging_api.routers.download.router imaging_api.routers.download.XNATAuthHeaders Functions --------- .. autoapisummary:: imaging_api.routers.download.download_images_by_accession_number Module Contents --------------- .. py:data:: router .. py:data:: XNATAuthHeaders .. py:function:: download_images_by_accession_number(net_id: str, request_data: imaging_api.routers.schemas.DownloadImagesRequestData, *, assessor_type: str = 'scan', resource_type: str = 'NIFTI', headers: XNATAuthHeaders) -> imaging_api.routers.schemas.DownloadImagesResponse :async: Downloads XNAT experiment image data corresponding to a given accession ID and encrypted central hub project ID. If data exists for the experiment, all image scan resources will be downloaded and the location returned. All data is downloaded in a single .zip file. Once the file download is complete, this method will then attempt to unzip the folder and delete the existing .zip file. :param net_id: The ID of the FL net that will run the training. :type net_id: str :param request_data: Contains encrypted central hub project ID and accession ID. :type request_data: DownloadImagesRequestData :param assessor_type: The type of assessor to use for the download. Default is "scan". Can be "assessor". :type assessor_type: str :param resource_type: XNAT resource type e.g DICOM/NIFTI. ALL will download all resources. Custom value is :type resource_type: str :param allowed if researcher has added their own custom XNAT resource type into scans.: :param headers: XNAT authentication headers. :type headers: XNATAuthHeaders :returns: The path where the downloaded and unzipped images are stored. :rtype: DownloadImagesResponse :raises HTTPException: If there is an error during decryption, if the resource is not found, or if there is an error during download/unzipping.