Installation¶
dicom-dre requires Python 3.12 and uses
uv for package management.
Install the package¶
Install from a checkout of the repository:
uv pip install -e .
This installs the library and the dicom-dre command-line entry point.
Verify the install:
dicom-dre --help
Optional: build the JPEG DCT C extension¶
The JPEG DCT-domain scrubber has a pure-Python implementation and an optional CFFI-based C extension. The extension is not required; when it is absent, the engine falls back to the pure-Python path. Building it reduces the time spent zeroing DCT blocks in JPEG Baseline images.
Build the extension with the just recipe:
just build-ext
The recipe compiles src/dicom_dre/_jpeg_dct_accel.c and reports the path of
the resulting shared object. To remove the compiled artifacts:
just clean-ext
To confirm the pure-Python fallback still works without the compiled extension, run:
just test-fallback
Development environment¶
Development uses a Dev Container so every contributor
has the same toolchain (Python 3.12, uv, just, dcmtk, and the build
dependencies for the C extension) regardless of host operating system.
Prerequisites¶
The Dev Containers VS Code extension
Open the repository in the container¶
Clone the repository and open the folder in VS Code.
When VS Code detects the Dev Container configuration, select “Reopen in Container”. You can also run “Dev Containers: Reopen in Container” from the command palette.
The first build downloads the base image and installs the container features; later starts reuse the cached image.
The container’s postCreateCommand runs .devcontainer/post-create.sh, which:
runs
uv syncto install all dependency groups,compiles the CFFI JPEG-DCT acceleration extension into
src/dicom_dre/, andinstalls the pre-commit, pre-push, and commit-msg git hooks.
No manual bootstrap step is required. After the script finishes, run the test suite:
uv run pytest
See Testing for the full set of test recipes.