Skip to content

Commit

Permalink
Merge pull request #321 from ImagingDataCommons/bug/color_legacy_conv…
Browse files Browse the repository at this point in the history
…ersions

Enforce monochrome 2 for input files to legacy conversion
  • Loading branch information
CPBridge authored Feb 9, 2025
2 parents d5d2a0a + 2f315e1 commit 7c9c1c9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/highdicom/legacy/sop.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ def _convert_legacy_to_enhanced(
'No data sets of single-frame legacy images provided.'
) from e

if not all(
ds.PhotometricInterpretation == 'MONOCHROME2' for ds in sf_datasets
):
raise ValueError(
"Legacy datasets must have a photometric interpretation of "
"'MONOCHROME2'."
)

if mf_dataset is None:
mf_dataset = Dataset()

Expand Down

0 comments on commit 7c9c1c9

Please sign in to comment.