Skip to content

Commit 6bab6ff

Browse files
authored
Automated package update (#8)
Co-authored-by: scaramallion <[email protected]>
1 parent c18df23 commit 6bab6ff

21 files changed

+244
-110
lines changed

custom/dataset.pyi

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ from pydicom._version import __version_info__ as __version_info__
88
from pydicom.charset import convert_encodings as convert_encodings, default_encoding as default_encoding
99
from pydicom.config import logger as logger
1010
from pydicom.datadict import dictionary_VR as dictionary_VR, dictionary_description as dictionary_description, get_private_entry as get_private_entry, keyword_for_tag as keyword_for_tag, repeater_has_keyword as repeater_has_keyword, tag_for_keyword as tag_for_keyword
11-
from pydicom.dataelem import DataElement as DataElement, DataElement_from_raw as DataElement_from_raw, RawDataElement as RawDataElement
11+
from pydicom.dataelem import DataElement as DataElement, RawDataElement as RawDataElement, convert_raw_data_element as convert_raw_data_element
1212
from pydicom.filebase import ReadableBuffer as ReadableBuffer, WriteableBuffer as WriteableBuffer
1313
from pydicom.fileutil import PathType as PathType, path_from_pathlike as path_from_pathlike
1414
from pydicom.misc import warn_and_log as warn_and_log
1515
from pydicom.pixels import compress as compress, convert_color_space as convert_color_space, decompress as decompress, pixel_array as pixel_array
16-
from pydicom.pixels.utils import get_image_pixel_ids as get_image_pixel_ids, reshape_pixel_array as reshape_pixel_array
16+
from pydicom.pixels.utils import get_image_pixel_ids as get_image_pixel_ids, reshape_pixel_array as reshape_pixel_array, set_pixel_data as set_pixel_data
1717
from pydicom.tag import BaseTag as BaseTag, TAG_PIXREP as TAG_PIXREP, Tag as Tag, TagType as TagType, tag_in_exception as tag_in_exception
1818
from pydicom.uid import PYDICOM_IMPLEMENTATION_UID as PYDICOM_IMPLEMENTATION_UID, UID as UID
1919
from pydicom.valuerep import AMBIGUOUS_VR as AMBIGUOUS_VR
@@ -128,6 +128,7 @@ class Dataset:
128128
PyramidUID: UI_1_Type
129129
RelatedGeneralSOPClassUID: UI_1N_Type
130130
OriginalSpecializedSOPClassUID: UI_1_Type
131+
SyntheticData: CS_1_Type
131132
StudyDate: DA_1_Type
132133
SeriesDate: DA_1_Type
133134
AcquisitionDate: DA_1_Type
@@ -274,6 +275,7 @@ class Dataset:
274275
ManufacturerModelName: LO_1_Type
275276
ReferencedStudySequence: SQType
276277
ReferencedPerformedProcedureStepSequence: SQType
278+
ReferencedInstancesBySOPClassSequence: SQType
277279
ReferencedSeriesSequence: SQType
278280
ReferencedPatientSequence: SQType
279281
ReferencedVisitSequence: SQType
@@ -299,6 +301,7 @@ class Dataset:
299301
FailedSOPSequence: SQType
300302
ReferencedSOPSequence: SQType
301303
OtherFailuresSequence: SQType
304+
FailedStudySequence: SQType
302305
StudiesContainingOtherReferencedInstancesSequence: SQType
303306
RelatedSeriesSequence: SQType
304307
DerivationDescription: ST_1_Type
@@ -397,6 +400,7 @@ class Dataset:
397400
PatientTelephoneNumbers: SH_1N_Type
398401
PatientTelecomInformation: LT_1_Type
399402
EthnicGroup: SH_1_Type
403+
EthnicGroupCodeSequence: SQType
400404
Occupation: SH_1_Type
401405
SmokingStatus: CS_1_Type
402406
AdditionalPatientHistory: LT_1_Type
@@ -420,21 +424,28 @@ class Dataset:
420424
ClinicalTrialSponsorName: LO_1_Type
421425
ClinicalTrialProtocolID: LO_1_Type
422426
ClinicalTrialProtocolName: LO_1_Type
427+
IssuerOfClinicalTrialProtocolID: LO_1_Type
428+
OtherClinicalTrialProtocolIDsSequence: SQType
423429
ClinicalTrialSiteID: LO_1_Type
424430
ClinicalTrialSiteName: LO_1_Type
431+
IssuerOfClinicalTrialSiteID: LO_1_Type
425432
ClinicalTrialSubjectID: LO_1_Type
433+
IssuerOfClinicalTrialSubjectID: LO_1_Type
426434
ClinicalTrialSubjectReadingID: LO_1_Type
435+
IssuerOfClinicalTrialSubjectReadingID: LO_1_Type
427436
ClinicalTrialTimePointID: LO_1_Type
428437
ClinicalTrialTimePointDescription: ST_1_Type
429438
LongitudinalTemporalOffsetFromEvent: FD_1_Type
430439
LongitudinalTemporalEventType: CS_1_Type
431440
ClinicalTrialTimePointTypeCodeSequence: SQType
441+
IssuerOfClinicalTrialTimePointID: LO_1_Type
432442
ClinicalTrialCoordinatingCenterName: LO_1_Type
433443
PatientIdentityRemoved: CS_1_Type
434444
DeidentificationMethod: LO_1N_Type
435445
DeidentificationMethodCodeSequence: SQType
436446
ClinicalTrialSeriesID: LO_1_Type
437447
ClinicalTrialSeriesDescription: LO_1_Type
448+
IssuerOfClinicalTrialSeriesID: LO_1_Type
438449
ClinicalTrialProtocolEthicsCommitteeName: LO_1_Type
439450
ClinicalTrialProtocolEthicsCommitteeApprovalNumber: LO_1_Type
440451
ConsentForClinicalTrialUseSequence: SQType
@@ -1724,6 +1735,7 @@ class Dataset:
17241735
HorizontalFieldOfView: FL_1_Type
17251736
PupilDilated: CS_1_Type
17261737
DegreeOfDilation: FL_1_Type
1738+
VertexDistance: FD_1_Type
17271739
StereoBaselineAngle: FL_1_Type
17281740
StereoBaselineDisplacement: FL_1_Type
17291741
StereoHorizontalPixelOffset: FL_1_Type
@@ -3116,8 +3128,6 @@ class Dataset:
31163128
VolumetricPresentationInputIndex: US_1_Type
31173129
PresentationStateCompositorComponentSequence: SQType
31183130
WeightingTransferFunctionSequence: SQType
3119-
WeightingLookupTableDescriptor: US_N_Type
3120-
WeightingLookupTableData: OB_1_Type
31213131
VolumetricAnnotationSequence: SQType
31223132
ReferencedStructuredContextSequence: SQType
31233133
ReferencedContentItem: UI_1_Type
@@ -3648,6 +3658,8 @@ class Dataset:
36483658
ROIDescription: ST_1_Type
36493659
ROIDisplayColor: IS_N_Type
36503660
ROIVolume: DS_1_Type
3661+
ROIDateTime: DT_1_Type
3662+
ROIObservationDateTime: DT_1_Type
36513663
RTRelatedROISequence: SQType
36523664
RTROIRelationship: CS_1_Type
36533665
ROIGenerationAlgorithm: CS_1_Type
@@ -3659,6 +3671,11 @@ class Dataset:
36593671
NumberOfContourPoints: IS_1_Type
36603672
ContourNumber: IS_1_Type
36613673
SourcePixelPlanesCharacteristicsSequence: SQType
3674+
SourceSeriesSequence: SQType
3675+
SourceSeriesInformationSequence: SQType
3676+
ROICreatorSequence: SQType
3677+
ROIInterpreterSequence: SQType
3678+
ROIObservationContextCodeSequence: SQType
36623679
ContourData: DS_N_Type
36633680
RTROIObservationsSequence: SQType
36643681
ObservationNumber: IS_1_Type
@@ -3821,6 +3838,7 @@ class Dataset:
38213838
TableTopVerticalPositionTolerance: DS_1_Type
38223839
TableTopLongitudinalPositionTolerance: DS_1_Type
38233840
TableTopLateralPositionTolerance: DS_1_Type
3841+
TableTopPositionAlignmentUID: UI_1_Type
38243842
RTPlanRelationship: CS_1_Type
38253843
FractionGroupSequence: SQType
38263844
FractionGroupNumber: IS_1_Type
@@ -4380,6 +4398,9 @@ class Dataset:
43804398
PatientSupportDisplacementSequence: SQType
43814399
DisplacementReferenceLocationCodeSequence: SQType
43824400
RTRadiationSetDeliveryUsage: CS_1_Type
4401+
PatientTreatmentPreparationSequence: SQType
4402+
PatientToEquipmentRelationshipSequence: SQType
4403+
ImagingEquipmentToTreatmentDeliveryDeviceRelationshipSequence: SQType
43834404
ReferencedRTPlanSequence: SQType
43844405
ReferencedBeamSequence: SQType
43854406
ReferencedBeamNumber: IS_1_Type
@@ -4758,8 +4779,8 @@ class Dataset:
47584779
def popitem(self) -> tuple[BaseTag, _DatasetValue]: ...
47594780
def setdefault(self, key: TagType, default: Any | None = None) -> DataElement: ...
47604781
def convert_pixel_data(self, handler_name: str = '') -> None: ...
4761-
def compress(self, transfer_syntax_uid: str, arr: numpy.ndarray | None = None, encoding_plugin: str = '', encapsulate_ext: bool = False, *, new_instance_uid: bool = True, jls_error: int | None = None, j2k_cr: list[float] | None = None, j2k_psnr: list[float] | None = None, **kwargs: Any) -> None: ...
4762-
def decompress(self, handler_name: str = '', *, as_rgb: bool = True, new_instance_uid: bool = True, decoding_plugin: str = '', **kwargs: Any) -> None: ...
4782+
def compress(self, transfer_syntax_uid: str, arr: numpy.ndarray | None = None, encoding_plugin: str = '', encapsulate_ext: bool = False, *, generate_instance_uid: bool = True, jls_error: int | None = None, j2k_cr: list[float] | None = None, j2k_psnr: list[float] | None = None, **kwargs: Any) -> None: ...
4783+
def decompress(self, handler_name: str = '', *, as_rgb: bool = True, generate_instance_uid: bool = True, decoding_plugin: str = '', **kwargs: Any) -> None: ...
47634784
def overlay_array(self, group: int) -> numpy.ndarray: ...
47644785
@property
47654786
def pixel_array(self) -> numpy.ndarray: ...
@@ -4773,10 +4794,11 @@ class Dataset:
47734794
@property
47744795
def read_little_endian(self) -> bool | None: ...
47754796
def remove_private_tags(self) -> None: ...
4776-
def save_as(self, filename: str | os.PathLike[AnyStr] | BinaryIO | WriteableBuffer, __write_like_original: bool | None = None, /, *, implicit_vr: bool | None = None, little_endian: bool | None = None, enforce_file_format: bool = False, **kwargs: Any) -> None: ...
4797+
def save_as(self, filename: str | os.PathLike[AnyStr] | BinaryIO | WriteableBuffer, __write_like_original: bool | None = None, /, *, implicit_vr: bool | None = None, little_endian: bool | None = None, enforce_file_format: bool = False, overwrite: bool = True, **kwargs: Any) -> None: ...
47774798
def ensure_file_meta(self) -> None: ...
47784799
def __setattr__(self, name: str, value: Any) -> None: ...
47794800
def __setitem__(self, key: slice | TagType, elem: _DatasetValue) -> None: ...
4801+
def set_pixel_data(self, arr: numpy.ndarray, photometric_interpretation: str, bits_stored: int, *, generate_instance_uid: bool = True) -> None: ...
47804802
def top(self) -> str: ...
47814803
def trait_names(self) -> list[str]: ...
47824804
def update(self, d: _DatasetType) -> None: ...
@@ -4786,16 +4808,17 @@ class Dataset:
47864808
def from_json(cls, json_dataset: dict[str, Any] | str | bytes | bytearray, bulk_data_uri_handler: Callable[[str, str, str], None | str | int | float | bytes] | Callable[[str], None | str | int | float | bytes] | None = None) -> Dataset: ...
47874809
def to_json_dict(self, bulk_data_threshold: int = 1024, bulk_data_element_handler: Callable[[DataElement], str] | None = None, suppress_invalid_tags: bool = False) -> dict[str, Any]: ...
47884810
def to_json(self, bulk_data_threshold: int = 1024, bulk_data_element_handler: Callable[[DataElement], str] | None = None, dump_handler: Callable[[dict[str, Any]], str] | None = None, suppress_invalid_tags: bool = False) -> str: ...
4811+
def update_raw_element(self, tag: TagType, *, vr: str | None = None, value: bytes | None = None) -> None: ...
47894812

47904813
class FileDataset(Dataset):
47914814
preamble: Incomplete
47924815
file_meta: Incomplete
47934816
fileobj_type: Incomplete
4794-
filename: str
4817+
filename: Incomplete
4818+
buffer: Incomplete
47954819
timestamp: Incomplete
47964820
def __init__(self, filename_or_obj: PathType | BinaryIO | ReadableBuffer, dataset: _DatasetType, preamble: bytes | None = None, file_meta: FileMetaDataset | None = None, is_implicit_VR: bool = True, is_little_endian: bool = True) -> None: ...
4797-
def __copy__(self) -> FileDataset: ...
4798-
def __deepcopy__(self, _: dict[int, Any] | None) -> FileDataset: ...
4821+
def __deepcopy__(self, memo: dict[int, Any]) -> FileDataset: ...
47994822

48004823
def validate_file_meta(file_meta: FileMetaDataset, enforce_standard: bool = True) -> None: ...
48014824

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ license = {text = "MIT"}
2020
name = "types-pydicom"
2121
readme = "README.md"
2222
requires-python = ">=3.10"
23-
version = "3.0.0.0.dev0"
23+
version = "3.0.0rc1.0"
2424

2525
[tool.setuptools.package-data]
2626
pydicom_stubs = ["*.pyi"]

src/pydicom-stubs/config.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ RAISE: int
2727
class Settings:
2828
def __init__(self) -> None: ...
2929
@property
30+
def buffered_read_size(self) -> int: ...
31+
@buffered_read_size.setter
32+
def buffered_read_size(self, size: int) -> None: ...
33+
@property
3034
def reading_validation_mode(self) -> int: ...
3135
@reading_validation_mode.setter
3236
def reading_validation_mode(self, value: int) -> None: ...

src/pydicom-stubs/data/data_manager.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ from pydicom.misc import warn_and_log as warn_and_log
88
DATA_ROOT: Incomplete
99

1010
class DataTypes(IntEnum):
11-
DATASET: int
12-
CHARSET: int
13-
PALETTE: int
14-
DICOMDIR: int
15-
JPEG: int
11+
DATASET = 0
12+
CHARSET = 1
13+
PALETTE = 2
14+
DICOMDIR = 3
15+
JPEG = 4
1616

1717
def get_external_sources() -> dict: ...
1818
def external_data_sources() -> dict: ...

src/pydicom-stubs/dataelem.pyi

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ from _typeshed import Incomplete
22
from collections.abc import Callable as Callable, MutableSequence
33
from pydicom import config as config, jsonrep as jsonrep
44
from pydicom.config import logger as logger
5-
from pydicom.datadict import dictionary_VR as dictionary_VR, dictionary_description as dictionary_description, dictionary_has_tag as dictionary_has_tag, dictionary_is_retired as dictionary_is_retired, dictionary_keyword as dictionary_keyword, private_dictionary_VR as private_dictionary_VR, private_dictionary_description as private_dictionary_description, repeater_has_tag as repeater_has_tag
5+
from pydicom.datadict import dictionary_VR as dictionary_VR, dictionary_description as dictionary_description, dictionary_has_tag as dictionary_has_tag, dictionary_is_retired as dictionary_is_retired, dictionary_keyword as dictionary_keyword, private_dictionary_description as private_dictionary_description, repeater_has_tag as repeater_has_tag
66
from pydicom.dataset import Dataset as Dataset
7-
from pydicom.errors import BytesLengthException as BytesLengthException
7+
from pydicom.fileutil import buffer_equality as buffer_equality, buffer_length as buffer_length, check_buffer as check_buffer
8+
from pydicom.hooks import hooks as hooks
89
from pydicom.jsonrep import BulkDataType as BulkDataType, JsonDataElementConverter as JsonDataElementConverter
910
from pydicom.misc import warn_and_log as warn_and_log
1011
from pydicom.multival import MultiValue as MultiValue
1112
from pydicom.tag import BaseTag as BaseTag, Tag as Tag
1213
from pydicom.uid import UID as UID
13-
from pydicom.valuerep import ALLOW_BACKSLASH as ALLOW_BACKSLASH, AMBIGUOUS_VR as AMBIGUOUS_VR, BYTES_VR as BYTES_VR, DEFAULT_CHARSET_VR as DEFAULT_CHARSET_VR, LONG_VALUE_VR as LONG_VALUE_VR, PersonName as PersonName, STR_VR as STR_VR, validate_value as validate_value
14+
from pydicom.valuerep import ALLOW_BACKSLASH as ALLOW_BACKSLASH, AMBIGUOUS_VR as AMBIGUOUS_VR, BUFFERABLE_VRS as BUFFERABLE_VRS, BYTES_VR as BYTES_VR, DEFAULT_CHARSET_VR as DEFAULT_CHARSET_VR, LONG_VALUE_VR as LONG_VALUE_VR, PersonName as PersonName, STR_VR as STR_VR, validate_value as validate_value
1415
from typing import Any, NamedTuple
1516

1617
def empty_value_for_VR(VR: str | None, raw: bool = False) -> bytes | list[str] | str | None | PersonName: ...
@@ -39,10 +40,13 @@ class DataElement:
3940
@property
4041
def VM(self) -> int: ...
4142
@property
43+
def is_buffered(self) -> bool: ...
44+
@property
4245
def is_empty(self) -> bool: ...
4346
@property
4447
def empty_value(self) -> bytes | list[str] | None | str | PersonName: ...
4548
def clear(self) -> None: ...
49+
def __deepcopy__(self, memo: dict[int, Any]) -> DataElement: ...
4650
def __eq__(self, other: Any) -> Any: ...
4751
def __ne__(self, other: Any) -> Any: ...
4852
@property
@@ -66,5 +70,7 @@ class RawDataElement(NamedTuple):
6670
is_implicit_VR: bool
6771
is_little_endian: bool
6872
is_raw: bool = ...
73+
is_buffered: bool = ...
6974

70-
def DataElement_from_raw(raw_data_element: RawDataElement, encoding: str | MutableSequence[str] | None = None, dataset: Dataset | None = None) -> DataElement: ...
75+
def convert_raw_data_element(raw: RawDataElement, *, encoding: str | MutableSequence[str] | None = None, ds: Dataset | None = None) -> DataElement: ...
76+
def __getattr__(name: str) -> Any: ...

0 commit comments

Comments
 (0)