Skip to content

Latest commit

 

History

History

pypx-DICOMweb

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

pypx-DICOMweb

A server implementing DICOMweb* for query and retrieval of DICOM data from a directory managed by pypx-listener.

*Specifically, this project targets the subset of DICOMweb necessary to get things working with OHIF.

Development

First, download some example data:

../example_data/download.sh

Then run the server:

export PYPX_LOG_DIR=../example_data/samples/pypx/log
export PYPX_DATA_DIR=../example_data/samples/pypx/data
export PYPX_REPACK_DATA_MOUNTPOINT=/tmp/dicom/data
export RUST_LOG=pypx_dicomweb=DEBUG
env PORT=4006 cargo run

Using Docker or Podman

docker build -f ../pypx-DICOMweb.Dockerfile -t localhost/fnndsc/pypx-dicomweb:latest ..
docker run --name pypx-dicomweb \
    --rm -u "$((RANDOM+1000))" -p 4006:4006 \
    -v "$(realpath ../example_data/samples/pypx):/data:ro" \
    -e PYPX_LOG_DIR=/data/log -e PYPX_DATA_DIR=/data/data \
    -e PYPX_REPACK_DATA_MOUNTPOINT=/tmp/dicom/data \
    -e RUST_LOG=pypx_dicomweb=DEBUG \
    localhost/fnndsc/pypx-dicomweb:latest

Code Outline

  • main.rs is the driver which load the configuration and runs the server.
  • router.rs interfaces between axum and pypx_reader.rs
  • pypx_reader.rs provides an API for a pypx-organized directory of JSON and DICOM files
  • json_files.rs and translate.rs define helper functions for pypx_reader.rs
  • dicom.rs defines helper functions for reading DICOM files

OHIF Configuration

window.config = {
  // -- snip --
  dataSources: [
    {
      namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
      sourceName: 'pypx',
      configuration: {
        friendlyName: 'Existing pypx-organized DICOM files',
        name: 'pypx',
        wadoUriRoot: 'http://localhost:4006/dicomweb',
        qidoRoot: 'http://localhost:4006/dicomweb',
        wadoRoot: 'http://localhost:4006/dicomweb',
        qidoSupportsIncludeField: false,
        supportsReject: false,
        imageRendering: 'wadors',
        thumbnailRendering: 'wadors',
        enableStudyLazyLoad: true,
        supportsFuzzyMatching: false,
        supportsWildcard: false,
        staticWado: false,
        singlepart: 'bulkdata,video',
        bulkDataURI: {
          enabled: true,
          relativeResolution: 'studies',
        },
        omitQuotationForMultipartRequest: true
      },
    },
  ]
}

Performance Considerations

pypx itself is filesystem-based, hence queries (for studies and series) involve directory traversal. Moreover, it is necessary to read and parse JSON files to extract information. These operations are considered slow and can benefit from a caching proxy server (TBA).

TODO

  • etag
  • add PatientName to study query results