import numpy as np
from _typeshed import Incomplete
from collections.abc import ByteString as ByteString, Iterable, Iterator
from os import PathLike
from pydicom._dicom_dict import DicomDictionary as DicomDictionary
from pydicom.charset import default_encoding as default_encoding
from pydicom.dataset import Dataset as Dataset
from pydicom.encaps import encapsulate as encapsulate, encapsulate_extended as encapsulate_extended
from pydicom.misc import warn_and_log as warn_and_log
from pydicom.tag import BaseTag as BaseTag
from pydicom.uid import ExplicitVRLittleEndian as ExplicitVRLittleEndian, JPEG2000 as JPEG2000, JPEGLSNearLossless as JPEGLSNearLossless, UID as UID, generate_uid as generate_uid
from pydicom.valuerep import VR as VR
from typing import Any, BinaryIO

HAVE_NP: bool
LOGGER: Incomplete

def as_pixel_options(ds: Dataset, **kwargs: Any) -> dict[str, Any]: ...
def compress(ds: Dataset, transfer_syntax_uid: str, arr: np.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) -> Dataset: ...
def decompress(ds: Dataset, *, as_rgb: bool = True, generate_instance_uid: bool = True, decoding_plugin: str = '', **kwargs: Any) -> Dataset: ...
def expand_ybr422(src: ByteString, bits_allocated: int) -> bytes: ...
def get_expected_length(ds: Dataset, unit: str = 'bytes') -> int: ...
def get_image_pixel_ids(ds: Dataset) -> dict[str, int]: ...
def get_j2k_parameters(codestream: bytes) -> dict[str, Any]: ...
def get_nr_frames(ds: Dataset, warn: bool = True) -> int: ...
def iter_pixels(src: str | PathLike[str] | BinaryIO | Dataset, *, ds_out: Dataset | None = None, specific_tags: list[BaseTag | int] | None = None, indices: Iterable[int] | None = None, raw: bool = False, decoding_plugin: str = '', **kwargs: Any) -> Iterator['np.ndarray']: ...
def pack_bits(arr: np.ndarray, pad: bool = True) -> bytes: ...
def pixel_array(src: str | PathLike[str] | BinaryIO | Dataset, *, ds_out: Dataset | None = None, specific_tags: list[int] | None = None, index: int | None = None, raw: bool = False, decoding_plugin: str = '', **kwargs: Any) -> np.ndarray: ...
def pixel_dtype(ds: Dataset, as_float: bool = False) -> np.dtype: ...
def reshape_pixel_array(ds: Dataset, arr: np.ndarray) -> np.ndarray: ...
def set_pixel_data(ds: Dataset, arr: np.ndarray, photometric_interpretation: str, bits_stored: int, *, generate_instance_uid: bool = True) -> None: ...
def unpack_bits(src: bytes, as_array: bool = True) -> np.ndarray | bytes: ...
