imaging_api.routers.schemas
Attributes
Classes
Represents a user profile on XNAT. |
|
Represents a 'create user request' for XNAT. |
|
Represents a user created on XNAT. |
|
Represents a 'create project request' for XNAT. |
|
Represents a project on XNAT. |
|
Represents a project created on XNAT. |
|
Represents a project on the central hub from which an imaging project is created on XNAT. |
|
Short representation of a subject on XNAT, it is the result of the REST API call |
|
Short representation of an experiment on XNAT, it is the result of the REST API call |
|
Represents the status of a PACS system. |
|
Represents a study query for PACS through XNAT DQR. |
|
Represents a study to be imported via DQR. |
|
Represents an image import request for DQR. |
|
Represents the response from an import request. |
|
Tracks the status of imported studies. |
|
Tracks the status of imported studies. |
|
Represents a project retrieval. |
|
Represents a request to download images. |
|
Represents a request to upload data. |
Module Contents
- imaging_api.routers.schemas.PACS_ID = 1
- imaging_api.routers.schemas.XNAT_PORT
- imaging_api.routers.schemas._XML_FORBIDDEN_CHARS = ('<', '>', '&')
- class imaging_api.routers.schemas.User
Bases:
pydantic.BaseModelRepresents a user profile on XNAT.
- lastModified: int | None = None
- username: str
- enabled: bool
- id: int
- secured: bool
- email: pydantic.EmailStr
- verified: bool
- firstName: str
- lastName: str
- lastSuccessfulLogin: int | None = None
- class imaging_api.routers.schemas.CreateUser
Bases:
pydantic.BaseModelRepresents a ‘create user request’ for XNAT.
- username: str
- password: str
- email: pydantic.EmailStr
- firstName: str
- lastName: str
- enabled: bool = True
- class imaging_api.routers.schemas.CreatedUser
Bases:
pydantic.BaseModelRepresents a user created on XNAT.
- username: str
- encrypted_password: str
- email: pydantic.EmailStr
- class imaging_api.routers.schemas.UpdateUser
Bases:
pydantic.BaseModel- email: pydantic.EmailStr
- enabled: bool
- class imaging_api.routers.schemas.CentralHubUser
Bases:
pydantic.BaseModel- id: uuid.UUID
- email: pydantic.EmailStr
- is_disabled: bool = False
- class imaging_api.routers.schemas.CreateProject
Bases:
pydantic.BaseModelRepresents a ‘create project request’ for XNAT.
- id: str
- secondary_id: str
- name: str
- description: str = ''
- class imaging_api.routers.schemas.Project
Bases:
pydantic.BaseModelRepresents a project on XNAT.
- pi_firstname: str
- secondary_ID: str
- pi_lastname: str
- name: str
- description: str | None = None
- ID: str
- URI: str
- class imaging_api.routers.schemas.CreatedProject
Bases:
pydantic.BaseModelRepresents a project created on XNAT.
- ID: uuid.UUID
- name: str
- created_users: list[CreatedUser]
- class imaging_api.routers.schemas.CentralHubProject
Bases:
pydantic.BaseModelRepresents a project on the central hub from which an imaging project is created on XNAT.
- project_id: uuid.UUID
- trust_id: uuid.UUID
- project_name: str
- query: str
- users: list[CentralHubUser] = []
- dicom_to_nifti: bool = True
- classmethod _reject_xml_control_chars(v: str) str
- class imaging_api.routers.schemas.Subject
Bases:
pydantic.BaseModelShort representation of a subject on XNAT, it is the result of the REST API call
GET f"{XNAT_URL}/data/projects/{project_id}/subjects"- id: str
- label: str
- insert_date: str
- project: str
- insert_user: str
- uri: str
- class imaging_api.routers.schemas.Experiment
Bases:
pydantic.BaseModelShort representation of an experiment on XNAT, it is the result of the REST API call
GET f"{XNAT_URL}/data/projects/{project_id}/experiments"- id: str
- label: str
- date: str
- project: str
- insert_date: str
- xsiType: str
- uri: str
- subject_assessor_data_id: str | None
- class imaging_api.routers.schemas.PacsStatus
Bases:
pydantic.BaseModelRepresents the status of a PACS system.
- pacs_id: int
- successful: bool
- ping_time: int
- created: int
- enabled: bool
- timestamp: int
- id: int
- disabled: int
- class imaging_api.routers.schemas.Study
Bases:
pydantic.BaseModel- study_instance_uid: str
- study_description: str
- accession_number: str
- study_date: str
- modalities_in_study: list[str]
- referring_physician_name: str
- class imaging_api.routers.schemas.StudyQuery
Bases:
pydantic.BaseModelRepresents a study query for PACS through XNAT DQR.
- accession_number: str
- pacs_id: int
- modality: str | None
- class imaging_api.routers.schemas.ImportStudy(**data: object)
Bases:
pydantic.BaseModelRepresents a study to be imported via DQR.
- study_instance_uid: str
- accession_number: str
- relabel_map: dict[str, str]
- set_relabel_map() None
Sets the relabel_map dictionary for subject and session.
- class imaging_api.routers.schemas.ImportStudyRequest
Bases:
pydantic.BaseModelRepresents an image import request for DQR.
- pacs_id: int
- ae_title: str
- port: int
- project_id: str
- force_import: bool
- studies: Annotated[list[ImportStudy], Field(..., min_length=1)]
- classmethod deduplicate_and_parse_studies(data: dict) dict
Deduplicates and parses studies before validation.
- Parameters:
data (dict) – The raw input payload being validated.
data["studies"]may containdictentries or already-parsedImportStudyinstances.- Returns:
The same payload with
studiesreplaced by a de-duplicated list ofImportStudyinstances keyed bystudy_instance_uid.- Return type:
dict
- class imaging_api.routers.schemas.ImportStudyResponse
Bases:
pydantic.BaseModelRepresents the response from an import request.
- id: int
- pacs_id: int
- status: str
- accession_number: str
- queued_time: int
- created: int
- priority: int
- class imaging_api.routers.schemas.ImportStatus
Bases:
pydantic.BaseModelTracks the status of imported studies.
- successful: list[str] = []
- failed: list[str] = []
- processing: list[str] = []
- queued: list[str] = []
- queue_failed: list[str] = []
- class imaging_api.routers.schemas.ImportStatusCount
Bases:
pydantic.BaseModelTracks the status of imported studies.
- successful_count: int = 0
- failed_count: int = 0
- processing_count: int = 0
- queued_count: int = 0
- queue_failed_count: int = 0
- class imaging_api.routers.schemas.ProjectRetrieval
Bases:
pydantic.BaseModelRepresents a project retrieval.
- project_creation_completed: bool = False
- import_status: ImportStatusCount