GSTT-CSC / XNAT

Tracks general documentation, standard operating procedures (SOP) and helper scripts for XNAT.
15 stars 0 forks source link

Adds generic export project to PACS feature #62

Closed laurencejackson closed 1 year ago

laurencejackson commented 1 year ago

Had a few cases where we needed to go through every scan in an XNAT project and send them to an external dicom node (XNAT pacs destination).

This PR adds a hopefully generic version which is configured for separate projects by passing a yaml formatted config file.

Ideally, we expand the functionality of the function and add addition config options to fine-tune the export - for example inclusion/exclusion criteria.

e.g.

config.yml

xnat:
  user: admin
  password: ${XNAT_PASSWORD}
  url: http://localhost/
  project_id: scaphoidfracturesxray
destination:
  name: horos
settings:
  delay: 3
  attempts: 3
  failure_log: failed_to_send.txt
criteria:
  inclusion:
    scan:
      - field: series_description
        value:
          - SWI_Images
          - ax_dwi_fs_epi_DFC_TRACEW

Excecuted by running:

python export-to-pacs.py config.yml

This will try all the values listed under value against the scan object's field property and if any of the results are true the scan is sent.

Current known limitations (can be fixed with updates by me or anyone):