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: - To download all files and get their paths on disk you can run - pydicom.data.get_testdata_files().
- To download an individual file and get its path on disk you can use - pydicom.data.get_testdata_file(), e.g. for- RG1_UNCI.dcmuse- pydicom.data.get_testdata_file("RG1_UNCI.dcm")
 
- 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: - Added - pydicom.waveformsmodule and- generate_multiplex()and- multiplex_array()functions.
- Added - Dataset.waveform_array()which returns an- ndarrayfor the multiplex group at index within a Waveform Sequence element.
 
- When JPEG 2000 image data is unsigned and the Pixel Representation is 1 the image data is converted to signed (#1149) 
- Added - keywordproperty for the new UID keywords in version 2020d of the DICOM Standard
- Added testing of the variable names used when setting - Datasetattributes and- INVALID_KEYWORD_BEHAVIORconfig 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_BEHAVIORconfig option to allow customizing the behavior when an invalid key is used with the- Dataset- inoperator (#1200)
- Implemented full support (loading, accessing, modifying, writing) of DICOM File-sets and their DICOMDIR files via the - FileSetclass (#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 - ISVR 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_valuesis set (#1161)
- Data dictionaries updated to version 2020d of the DICOM Standard 
- Updated a handful of the SOP Class variable names in - _storage_sopclass_uidsto use the new UID keywords. Variables with- Multiframein them become- MultiFrame, those with- andin them become- And, and- DICOSQuadrupoleResonanceQRStoragebecomes- DICOSQuadrupoleResonanceStorage.
- The following UID constants are deprecated and will be removed in v2.2: - JPEGBaseline: use- JPEGBaseline8Bit
- JPEGExtended: use- JPEGExtended12Bit
- JPEGLossless: use- JPEGLosslessSV1
- JPEGLSLossy: use- JPEGLSNearLossless
- JPEG2000MultiComponentLossless: use- JPEG2000MCLossless
- JPEG2000MultiComponent: use- JPEG2000MC
 
- In v3.0 the value for - JPEGLosslesswill 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: - JPEGLossyCompressedPixelTransferSyntaxes: use- JPEGTransferSyntaxes
- JPEGLSSupportedCompressedPixelTransferSyntaxes: use- JPEGLSTransferSyntaxes
- JPEG2000CompressedPixelTransferSyntaxes: use- JPEG2000TransferSyntaxes
- RLECompressedLosslessSyntaxes: use- RLETransferSyntaxes
- UncompressedPixelTransferSyntaxes: use- UncompressedTransferSyntaxes
- PILSupportedCompressedPixelTransferSyntaxes
 
- DicomDirand the- dicomdirmodule are deprecated and will be removed in v3.0. Use- FileSetinstead (#1211)
- pydicom.overlay_data_handlersis deprecated, use- pydicom.overlaysinstead
- Removed transfer syntax limitations when converting overlays to an - ndarray(#1181)
- The - overlay_data_handlersconfig 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 - TypeErrorif- 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- Noneand not adding private elements when- enforce_valid_valuesis- True(#1215)
