2.1.0#

Enhancements#

  • Large testing data is no longer distributed within the pydicom package with the aim to reduce the package download size. These test files will download on-the-fly whenever either the tests are run, or should the file(s) be requested via the data manager functions. For example:

  • Added a new pixel data handler based on pylibjpeg which supports all (non-retired) JPEG transfer syntaxes (#1127)

  • Added apply_rescale() alias

  • Added apply_voi() and apply_windowing()

  • Added prefer_lut keyword parameter to apply_voi_lut() and handle empty VOI LUT module elements (#1234, #1237)

  • Added ability to register external data sources for use with the functions in pydicom.data (#1156)

  • __contains__, __next__ and __iter__ implementations added to PersonName (#1103)

  • Added convenience constants for the MPEG transfer syntaxes to pydicom.uid (#1155)

  • Added support for decoding Waveform Data:

  • When JPEG 2000 image data is unsigned and the Pixel Representation is 1 the image data is converted to signed (#1149)

  • Added keyword property for the new UID keywords in version 2020d of the DICOM Standard

  • Added testing of the variable names used when setting Dataset attributes and INVALID_KEYWORD_BEHAVIOR config option to allow customizing the behavior when a camel case variable name is used that isn’t a known element keyword (#1014)

  • Added INVALID_KEY_BEHAVIOR config option to allow customizing the behavior when an invalid key is used with the Dataset in operator (#1200)

  • Implemented full support (loading, accessing, modifying, writing) of DICOM File-sets and their DICOMDIR files via the FileSet class (#9, #243, #1093)

  • Added AllTransferSyntaxes

  • Added option to turn on pydicom future breaking behavior to allow user code to check itself against the next major version release. Set environment variable “PYDICOM_FUTURE” to “True” or call future_behavior()

  • Added another signature to the bulk_data_uri_handler in from_json to allow for the communication of not just the URI but also the tag and VR to the handler. Previous handlers will work as expected, new signature handlers will get the additional information.

  • pack_bits() can now be used with 2D or 3D input arrays and will pad the packed data to even length by default.

  • Elements with the IS VR accept float strings that are convertible to integers without loss, e.g. “1.0” (#1240)

  • Added encapsulate_extended() function for use when an Extended Offset Table is required (#1178)

Changes#

  • Dropped support for Python 3.5 (only Python 3.6+ supported)

  • Reading and adding unknown non-private tags now does not raise an exception per default, only when enforce_valid_values is set (#1161)

  • Data dictionaries updated to version 2020d of the DICOM Standard

  • Updated a handful of the SOP Class variable names in _storage_sopclass_uids to use the new UID keywords. Variables with Multiframe in them become MultiFrame, those with and in them become And, and DICOSQuadrupoleResonanceQRStorage becomes DICOSQuadrupoleResonanceStorage.

  • The following UID constants are deprecated and will be removed in v2.2:

  • In v3.0 the value for JPEGLossless will change from 1.2.840.10008.1.2.4.70 to 1.2.840.10008.1.2.4.57 to match its UID keyword

  • The following lists of UIDs are deprecated and will be removed in v2.2:

  • DicomDir and the dicomdir module are deprecated and will be removed in v3.0. Use FileSet instead (#1211)

  • pydicom.overlay_data_handlers is deprecated, use pydicom.overlays instead

  • Removed transfer syntax limitations when converting overlays to an ndarray (#1181)

  • The overlay_data_handlers config option is deprecated, the default handler will always be used.

Fixes#

  • Dataset.copy() now works as expected (#1146)

  • Optimistically parse undefined length non-SQ data as if it’s encapsulated pixel data to avoid erroring out on embedded sequence delimiter (#1140)

  • Fixed get_testdata_file() and get_testdata_files() raising an exception if no network connection is available (#1156)

  • Fixed GDCM < v2.8.8 not returning the pixel array for datasets not read from a file-like (#1153)

  • Raise TypeError if dcmread() or dcmwrite() is called with wrong argument

  • Gracefully handle empty Specific Character Set (#1190)

  • Fixed empty ambiguous VR elements raising an exception (#1193)

  • Allow apply_voi_lut() to apply VOI lookup to an input float array

  • Fixed Dataset.setdefault() not adding working correctly when the default value is None and not adding private elements when enforce_valid_values is True (#1215)