Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions heudiconv/dicoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,6 @@ def validate_dicom(
Parse DICOM attributes. Returns None if not valid.
"""
mw = dw.wrapper_from_file(fl, force=True, stop_before_pixels=True)
# clean series signature
for sig in ("iop", "ICE_Dims", "SequenceName"):
try:
del mw.series_signature[sig]
except KeyError:
pass
# Workaround for protocol name in private siemens csa header
if not getattr(mw.dcm_data, "ProtocolName", "").strip():
mw.dcm_data.ProtocolName = (
Expand Down Expand Up @@ -203,6 +197,12 @@ def validate_dicom(
except AttributeError:
lgr.info("File {} is missing any StudyInstanceUID".format(fl))
file_studyUID = None
# clean series signature
for sig in ("iop", "ICE_Dims", "SequenceName"):
try:
del mw.series_signature[sig]
except KeyError:
pass
return mw, series_id, file_studyUID


Expand Down
11 changes: 9 additions & 2 deletions heudiconv/heuristics/reproin.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,11 @@ def infotodict(
# XXX: skip derived sequences, we don't store them to avoid polluting
# the directory, unless it is the motion corrected ones
# (will get _rec-moco suffix)
if skip_derived and curr_seqinfo.is_derived and not curr_seqinfo.is_motion_corrected:
if (
skip_derived
and curr_seqinfo.is_derived
and not curr_seqinfo.is_motion_corrected
):
skipped.append(curr_seqinfo.series_id)
lgr.debug("Ignoring derived data %s", curr_seqinfo.series_id)
continue
Expand Down Expand Up @@ -552,7 +556,10 @@ def infotodict(
# XXX if we have a known earlier study, we need to always
# increase the run counter for phasediff because magnitudes
# were not acquired
if get_study_hash([curr_seqinfo]) == "9d148e2a05f782273f6343507733309d":
if (
get_study_hash([curr_seqinfo])
== "9d148e2a05f782273f6343507733309d"
):
current_run += 1
else:
raise RuntimeError(
Expand Down