imaging_api.routers.retrieval ============================= .. py:module:: imaging_api.routers.retrieval Attributes ---------- .. autoapisummary:: imaging_api.routers.retrieval.router imaging_api.routers.retrieval.XNATAuthHeaders Functions --------- .. autoapisummary:: imaging_api.routers.retrieval.base64_url_decode imaging_api.routers.retrieval.get_import_status_count imaging_api.routers.retrieval.reimport_imaging_project_studies Module Contents --------------- .. py:data:: router .. py:data:: XNATAuthHeaders .. py:function:: base64_url_decode(data: str) -> str Decode a Base64 URL-encoded string, adding padding if necessary. :param data: The Base64 URL-encoded string to decode. Padding is added if missing. :type data: str :returns: The decoded UTF-8 string. :rtype: str .. py:function:: get_import_status_count(project_id: str, encoded_query: str, headers: XNATAuthHeaders) -> imaging_api.routers.schemas.ProjectRetrieval :async: Returns a project with details about the status of study imports :param project_id: The imaging project ID to retrieve the data about. :type project_id: str :param encoded_query: Project cohort query base64 url encoded. :type encoded_query: str :param headers: The headers containing XNAT authentication details. :type headers: XNATAuthHeaders :returns: An object containing the status of study imports. :rtype: ProjectRetrieval :raises HTTPException: If the project does not exist or if there was an error while retrieving the project. .. py:function:: reimport_imaging_project_studies(project_id: str, encoded_query: str, headers: XNATAuthHeaders, background_tasks: fastapi.BackgroundTasks) -> fastapi.responses.JSONResponse :async: Retries failed study imports for a given imaging project ID and encoded cohort query. :param project_id: The imaging project ID to retrieve the data about. :type project_id: str :param encoded_query: Project cohort query base64 url encoded. :type encoded_query: str :param headers: The headers containing XNAT authentication details. :type headers: XNATAuthHeaders :param background_tasks: FastAPI BackgroundTasks instance for scheduling the reimport task. :type background_tasks: BackgroundTasks :returns: A response indicating the result of the reimport operation. :rtype: JSONResponse :raises HTTPException: If the reimport feature is not enabled or if the query is empty