File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -169,12 +169,6 @@ def validate_dicom(
169
169
Parse DICOM attributes. Returns None if not valid.
170
170
"""
171
171
mw = dw .wrapper_from_file (fl , force = True , stop_before_pixels = True )
172
- # clean series signature
173
- for sig in ("iop" , "ICE_Dims" , "SequenceName" ):
174
- try :
175
- del mw .series_signature [sig ]
176
- except KeyError :
177
- pass
178
172
# Workaround for protocol name in private siemens csa header
179
173
if not getattr (mw .dcm_data , "ProtocolName" , "" ).strip ():
180
174
mw .dcm_data .ProtocolName = (
@@ -203,6 +197,12 @@ def validate_dicom(
203
197
except AttributeError :
204
198
lgr .info ("File {} is missing any StudyInstanceUID" .format (fl ))
205
199
file_studyUID = None
200
+ # clean series signature
201
+ for sig in ("iop" , "ICE_Dims" , "SequenceName" ):
202
+ try :
203
+ del mw .series_signature [sig ]
204
+ except KeyError :
205
+ pass
206
206
return mw , series_id , file_studyUID
207
207
208
208
Original file line number Diff line number Diff line change @@ -406,7 +406,11 @@ def infotodict(
406
406
# XXX: skip derived sequences, we don't store them to avoid polluting
407
407
# the directory, unless it is the motion corrected ones
408
408
# (will get _rec-moco suffix)
409
- if skip_derived and curr_seqinfo .is_derived and not curr_seqinfo .is_motion_corrected :
409
+ if (
410
+ skip_derived
411
+ and curr_seqinfo .is_derived
412
+ and not curr_seqinfo .is_motion_corrected
413
+ ):
410
414
skipped .append (curr_seqinfo .series_id )
411
415
lgr .debug ("Ignoring derived data %s" , curr_seqinfo .series_id )
412
416
continue
@@ -552,7 +556,10 @@ def infotodict(
552
556
# XXX if we have a known earlier study, we need to always
553
557
# increase the run counter for phasediff because magnitudes
554
558
# were not acquired
555
- if get_study_hash ([curr_seqinfo ]) == "9d148e2a05f782273f6343507733309d" :
559
+ if (
560
+ get_study_hash ([curr_seqinfo ])
561
+ == "9d148e2a05f782273f6343507733309d"
562
+ ):
556
563
current_run += 1
557
564
else :
558
565
raise RuntimeError (
You can’t perform that action at this time.
0 commit comments