Skip to content

Commit ffd338e

Browse files
committed
Minor LOGGING tweak
1 parent 4e218b6 commit ffd338e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bidscoin/bids.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,6 @@ def parse_x_protocol(pattern: str, dicomfile: Path) -> str:
426426
:return: The string extracted values from the dicom-file according to the given pattern
427427
"""
428428

429-
if not is_dicomfile_siemens(dicomfile):
430-
LOGGER.warning(f"Parsing {pattern} may fail because {dicomfile} does not seem to be a Siemens DICOM file")
431-
432429
regexp = '^' + pattern + '\t = \t(.*)\n'
433430
regex = re.compile(regexp.encode('utf-8'))
434431

@@ -438,6 +435,9 @@ def parse_x_protocol(pattern: str, dicomfile: Path) -> str:
438435
if match:
439436
return match.group(1).decode('utf-8')
440437

438+
if not is_dicomfile_siemens(dicomfile):
439+
LOGGER.warning(f"Parsing {pattern} may have failed because {dicomfile} does not seem to be a Siemens DICOM file")
440+
441441
LOGGER.warning(f"Pattern: '{regexp.encode('unicode_escape').decode()}' not found in: {dicomfile}")
442442
return ''
443443

0 commit comments

Comments
 (0)