pre_process_lidc_idri.py 🚧¢

Source: LION/data_loaders/LIDC_IDRI/pre_process_lidc_idri.py

Warning

This file has not yet received a complete narrative and docstring audit. Its public source-level API is listed automatically below.

Download recovery and preprocessing utilities for LIDC-IDRI.

The script converts patient DICOM volumes and pylidc annotations into the per-slice NumPy layout consumed by LION.data_loaders.LIDC_IDRI. It can resume interrupted downloads, verify expected patient/file counts, and remove raw patients only after their processed outputs are complete.

LIDC_IDRI_PATIENT_COUNT
EXPECTED_PROCESSED_FILE_COUNT
EXPECTED_PROCESSED_PATIENT_DIR_COUNT
spec
foo
configure_pylidc(path_to_raw_dataset: pathlib.Path) None

Write pylidc’s user configuration for the selected raw DICOM root.

format_index(index: int) str

No docstring is available.

iter_lidc_patient_indices()

Return the canonical one-based LIDC-IDRI patient index range.

format_patient_id(index: int) str

No docstring is available.

get_nodule_boundaries(annotation: pl.Annotation) Tuple[int, int, int, int, int, int]

No docstring is available.

process_patient_mask(scan, path_to_processed_volume_folder: pathlib.Path) Dict

Rasterise all pylidc nodule annotations for one scan.

process_volume(scan: pl.Scan, path_to_processed_volume_folder: pathlib.Path)

Save one DICOM scan as indexed axial HU slices.

load_json(path: pathlib.Path, default)

No docstring is available.

write_json(path: pathlib.Path, data) None

No docstring is available.

get_raw_dicom_root(path_to_raw_dataset: pathlib.Path) pathlib.Path

No docstring is available.

get_raw_patient_dir(path_to_raw_dataset: pathlib.Path, patient_id: str) pathlib.Path | None

No docstring is available.

processed_patient_has_slices(path_to_processed_volume_folder: pathlib.Path) bool

No docstring is available.

remove_raw_patient_dir(path_to_raw_dataset: pathlib.Path, patient_id: str, dry_run: bool = False) None

No docstring is available.

flush_raw_delete_block(path_to_raw_dataset: pathlib.Path, patients_to_delete: List[str], dry_run: bool = False) None

No docstring is available.

remove_error_for_patient(error_list: List, patient_id: str) List

No docstring is available.

count_regular_files(path: pathlib.Path) int

No docstring is available.

processed_patient_ids(path_to_processed_dataset: pathlib.Path) List[str]

No docstring is available.

format_patient_list(patient_ids: List[str], limit: int = 20) str

No docstring is available.

patient_has_scan(patient_id: str) bool

No docstring is available.

print_download_recovery_hint() None

No docstring is available.

validate_processed_dataset_completeness(path_to_processed_dataset: pathlib.Path) None

No docstring is available.

compute_slice_thickness(path_to_processed_dataset: pathlib.Path)

No docstring is available.

pre_process_dataset(path_to_processed_dataset: pathlib.Path, path_to_raw_dataset: pathlib.Path | None = None, delete_raw_after_processing: bool = False, raw_delete_block_size: int = 1, dry_run_raw_delete: bool = False)

No docstring is available.

compute_diagnosis_file(diagnosis_file_path: pathlib.Path, diagnosis_dict_save_path: pathlib.Path)

No docstring is available.

compute_patient_with_nodule_subtetly(path_to_processed_dataset: pathlib.Path, nodule_subtelty: int, operator: str) None

No docstring is available.

parse_args() argparse.Namespace

No docstring is available.