Restructuring

Corrupted instance drop

Identify and discard unreadable or corrupted instances from a study.

Problem

You’re loading a folder of DICOM files, and some are corrupted — truncated files, zero-byte placeholders, non-DICOM text files accidentally mixed in, or files with bad DICOM headers. You don’t want the entire load to fail because of one bad file. The app should skip corrupted files, load everything valid, and report which files were skipped.

Steps

Partial Failure (Happy Path)

  1. Open a mixed set of files (⌘O) — e.g. test.dcm (valid) + corrupted.dcm (bad header).

  2. The valid file loads successfully. The metadata sidebar is visible, and the Files tree shows only the valid study.

Complete Failure (All Files Corrupted)

  1. Open only corrupted files — e.g. corrupted.dcm alone.

  2. The metadata sidebar does not appear. An error message is displayed: “Load failed” / “Invalid DICOM file, expected header is missing”.

Skip Non-DICOM Files

  1. Load valid DICOMs + non-DICOM files — e.g. test.dcm, sr-test.dcm, and notes.txt (plain text) or empty.dcm (zero bytes).

  2. Both valid files load. The Files tree shows two study headers. The invalid files are silently skipped with console errors logged.

Expected Result

  • Mixed load: Valid files load; corrupted/non-DICOM files are skipped. The study tree only shows valid entries.
  • All corrupted: A clear error message is displayed (“Load failed: Invalid DICOM file, expected header is missing”). No partial UI state.
  • Console errors are logged for each skipped file, including the filename.
  • Zero-byte files, non-DICOM files, and files with corrupted DICOM headers are all handled gracefully.