Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/enh/filter_dicom_earlier' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
bpinsard committed Nov 30, 2024
2 parents 430900a + 5493d65 commit 065b99a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions heudiconv/dicoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ def validate_dicom(
Parse DICOM attributes. Returns None if not valid.
"""
mw = dw.wrapper_from_file(fl, force=True, stop_before_pixels=True)
if dcmfilter is not None and dcmfilter(mw.dcm_data):
lgr.warning("Ignoring %s because of DICOM filter", fl)
return None
# clean series signature
for sig in ("iop", "ICE_Dims", "SequenceName"):
try:
Expand All @@ -198,9 +201,6 @@ def validate_dicom(
except AttributeError as e:
lgr.warning('Ignoring %s since not quite a "normal" DICOM: %s', fl, e)
return None
if dcmfilter is not None and dcmfilter(mw.dcm_data):
lgr.warning("Ignoring %s because of DICOM filter", fl)
return None
if mw.dcm_data[0x0008, 0x0016].repval in (
"Raw Data Storage",
"GrayscaleSoftcopyPresentationStateStorage",
Expand Down

0 comments on commit 065b99a

Please sign in to comment.