Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature gate capabilities: image, ndarray, rayon, transfer-syntax-registry adapters #238

Merged
merged 14 commits into from Apr 27, 2023

Conversation

Enet4
Copy link
Owner

@Enet4 Enet4 commented Apr 28, 2022

These changes make it so that image and ndarray support in the pixeldata crate become opt-in, and make it possible for projects to exclude the use of rayon entirely.

At transfer-syntax-registry, the built-in native decoders (JPEG and RLE) are now opt-in, and need to be enabled. This provides faster and more efficient builds for projects which do not need to manipulate pixel data.

This is a breaking change because some methods and resources that originally were always available are put behind Cargo features. Depends on Rust 1.60+, which is below the current minimum version known to work (1.63).

Summary

  • [transfer-syntax-registry] add rayon Cargo feature, maps to jpeg-decoder/rayon, making it opt-in
  • [pixeldata] make image and ndarray dependencies optional, gated behind features with the same names
    • conversions from decoded pixel data to images or ndarrays are conditioned on these features
    • configured docs.rs to include them
    • tweaked CI pipeline to test both with and without these features
  • [pixeldata] add rayon feature so that Rayon can be removed entirely
    • use a non-parallel iterator implementation when not enabled
  • [transfer-syntax-registry] make native feature opt-in, always added in dicom-pixeldata

@Enet4 Enet4 added enhancement A-lib Area: library labels Apr 28, 2022
@Enet4 Enet4 force-pushed the imp/pixeldata/feature-gate branch from bb97167 to ce38bc5 Compare April 29, 2022 12:57
@Enet4 Enet4 force-pushed the imp/pixeldata/feature-gate branch from ce38bc5 to 7c11be5 Compare May 13, 2022 08:12
@Enet4 Enet4 added the breaking change Hint that this may require a major version bump on release label May 18, 2022
@Enet4 Enet4 force-pushed the imp/pixeldata/feature-gate branch from 53ebe39 to 836e34d Compare July 14, 2022 18:55
@Enet4 Enet4 marked this pull request as ready for review January 28, 2023 16:40
@Enet4 Enet4 added the C-pixeldata Crate: dicom-pixeldata label Jan 29, 2023
@Enet4 Enet4 force-pushed the imp/pixeldata/feature-gate branch 2 times, most recently from b295793 to 2d3b10a Compare February 4, 2023 10:01
- [encoding] make jpeg-decoder/rayon opt-in
- [pixeldata] add ndarray and image features,
  not default anymore!
   - APIs depending on them are feature gated
   - configure docs.rs to include them anyway
- add default feature rayon,
  so that the use of rayon can be removed entirely

Note: Rust >= 1.60 required due to feature syntax
- include testing pixeldata without default features
- test project with default + commonly useful features
   - for now `image` and `ndarray`
- use actions-rs/cargo@v1 consistently
fix build with no default arguments
- add rayon feature, enabled by default
- import conditionally based on features
- [pixeldata] refer to rayon feature there
@Enet4 Enet4 force-pushed the imp/pixeldata/feature-gate branch from 2d3b10a to c824889 Compare March 5, 2023 15:24
@Enet4 Enet4 added C-encoding Crate: dicom-encoding C-transfer-syntax Crate: dicom-transfer-syntax-registry labels Apr 27, 2023
@Enet4 Enet4 changed the title [pixeldata] Feature gate capabilities: image, ndarray, rayon Feature gate capabilities: image, ndarray, rayon Apr 27, 2023
@Enet4 Enet4 removed the C-encoding Crate: dicom-encoding label Apr 27, 2023
- exclude jpeg and rle decoding by default
  for faster and smaller builds
  (they are not needed unless for pixel data manipulation)
- Include feature when building documentation at docs.rs
  so that supported TSes appear as implemented
- [pixeldata] explicitly require native encodings from ts registry
- expand root docs
- explain that encapsulated pixel data adaptors
  are disabled by default
- mention that inventory-based registry
  is not enabled by default
- show table of support for encapsulated pixel data
- mention that a native implementation is available
  by enabling the right Cargo feature
@Enet4 Enet4 force-pushed the imp/pixeldata/feature-gate branch from 46c6e05 to 678ebf9 Compare April 27, 2023 18:53
@Enet4 Enet4 merged commit 941deb5 into master Apr 27, 2023
4 checks passed
@Enet4 Enet4 changed the title Feature gate capabilities: image, ndarray, rayon Feature gate capabilities: image, ndarray, rayon, transfer-syntax adapters Apr 27, 2023
@Enet4 Enet4 changed the title Feature gate capabilities: image, ndarray, rayon, transfer-syntax adapters Feature gate capabilities: image, ndarray, rayon, transfer-syntax-registry adapters Apr 27, 2023
@Enet4 Enet4 deleted the imp/pixeldata/feature-gate branch April 27, 2023 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lib Area: library breaking change Hint that this may require a major version bump on release C-pixeldata Crate: dicom-pixeldata C-transfer-syntax Crate: dicom-transfer-syntax-registry enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant