← Về thư mục
skills/pydicom/scripts/_common.py
- ToolError · class · L301-L302 — class ToolError(ValueError)
- bounded_int · function · L305-L314 — def bounded_int(value: Any, *, name: str, minimum: int, maximum: int) -> int
- parse_size · function · L317-L335 — def parse_size( value: str | int, *, name: str, minimum: int = 1, maximum: int = HARD_MAX_INPUT_BYTES, ) -> int
- require_text · function · L338-L345 — def require_text( value: Any, *, name: str, minimum: int = 1, maximum: int = 1_000 ) -> str
- safe_plugin_name · function · L348-L351 — def safe_plugin_name(value: str) -> str
- _reject_path_text · function · L354-L362 — def _reject_path_text(value: str) -> None
- _absolute · function · L365-L366 — def _absolute(path: Path) -> Path
- _reject_symlink_components · function · L369-L381 — def _reject_symlink_components(path: Path) -> None
- checked_root · function · L384-L396 — def checked_root(value: str | os.PathLike[str]) -> Path
- _within_root · function · L399-L403 — def _within_root(path: Path, root: Path) -> None
- checked_input · function · L406-L438 — def checked_input( value: str | os.PathLike[str], *, root: str | os.PathLike[str] = ".", kind: str = "file", max_bytes: int = DEFAULT_MAX_INPUT_BYTES, ) -> Path
- checked_output · function · L441-L467 — def checked_output( value: str | os.PathLike[str], *, root: str | os.PathLike[str] = ".", force: bool = False, ) -> Path
- checked_output_directory · function · L470-L498 — def checked_output_directory( value: str | os.PathLike[str], *, root: str | os.PathLike[str] = ".", ) -> Path
- paths_overlap · function · L501-L504 — def paths_overlap(first: Path, second: Path) -> bool
- collect_local_files · function · L507-L550 — def collect_local_files( source: Path, *, max_files: int, max_bytes: int, recursive: bool = True, ) -> list[Path]
- _reject_json_constant · function · L553-L554 — def _reject_json_constant(value: str) -> None
- _unique_object · function · L557-L563 — def _unique_object(pairs: list[tuple[str, Any]]) -> dict[str, Any]
- load_json · function · L566-L579 — def load_json(path: Path, *, max_bytes: int = MAX_JSON_BYTES) -> Any
- json_bytes · function · L582-L598 — def json_bytes(document: Any) -> bytes
- emit_json · function · L601-L602 — def emit_json(document: Any) -> None
- fail_json · function · L605-L619 — def fail_json(tool: str, exc: Exception) -> int
- atomic_write · function · L622-L645 — def atomic_write( destination: Path, payload: bytes, *, force: bool = False, max_bytes: int = MAX_REPORT_BYTES, ) -> None
- atomic_generated_file · function · L648-L681 — def atomic_generated_file( destination: Path, *, writer: Callable[[Path], None], validator: Callable[[Path], None] | None = None, force: bool = False, max_bytes: int = HARD_MAX_OUTPUT_BYTES, ) -> None
- require_pydicom · function · L684-L696 — def require_pydicom() -> Any
- require_pixel_stack · function · L699-L710 — def require_pixel_stack() -> tuple[Any, Any, Any]
- safe_dcmread · function · L713-L731 — def safe_dcmread( path: Path, *, stop_before_pixels: bool, force: bool = False, defer_size: str | int | None = None, specific_tags: Iterable[str | int] | None = None, ) -> Any
- element_tag · function · L734-L735 — def element_tag(element: Any) -> str
- valid_uid · function · L738-L746 — def valid_uid(value: Any) -> bool
- derive_uid · function · L749-L764 — def derive_uid(original: str, *, key: bytes, scope: str) -> str
- derive_token · function · L767-L776 — def derive_token(value: str, *, key: bytes, scope: str, length: int = 24) -> str
- sha256_text · function · L779-L780 — def sha256_text(value: str) -> str
- frame_count · function · L783-L795 — def frame_count(dataset: Any) -> tuple[int, list[str]]
- pixel_plan · function · L798-L867 — def pixel_plan( dataset: Any, *, max_frames: int = HARD_MAX_FRAMES, max_decompressed_bytes: int = HARD_MAX_DECOMPRESSED_BYTES, ) -> dict[str, Any]
- counter_dict · function · L870-L871 — def counter_dict(counter: Counter[str]) -> dict[str, int]
- validate_profile · function · L874-L906 — def validate_profile(document: Any) -> dict[str, Any]
- starter_profile · function · L909-L916 — def starter_profile() -> dict[str, Any]