Skip to content

Commit 2f315e1

Browse files
committed
Enforce monochrome 2 in legacy conversion
1 parent 1654cc1 commit 2f315e1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/highdicom/legacy/sop.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ def _convert_legacy_to_enhanced(
6868
'No data sets of single-frame legacy images provided.'
6969
) from e
7070

71+
if not all(
72+
ds.PhotometricInterpretation == 'MONOCHROME2' for ds in sf_datasets
73+
):
74+
raise ValueError(
75+
"Legacy datasets must have a photometric interpretation of "
76+
"'MONOCHROME2'."
77+
)
78+
7179
if mf_dataset is None:
7280
mf_dataset = Dataset()
7381

0 commit comments

Comments
 (0)