Skip to content

Commit 94cf3e2

Browse files
committed
Minor tweaks
1 parent ad27b84 commit 94cf3e2

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

bidscoin/plugins/events2bids.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ def has_support(self, file: Path, dataformat: Union[DataFormat, str]='') -> str:
3232
return ''
3333

3434
if file.suffix.lower() in ('.log',):
35-
return 'Presentation'
35+
try:
36+
with file.open('r') as fid:
37+
for n in (1,2,3):
38+
line = fid.readline()
39+
if line.startswith('Scenario -'):
40+
return 'Presentation'
41+
except Exception: pass
3642

3743
return ''
3844

@@ -50,7 +56,7 @@ def get_attribute(self, dataformat: Union[DataFormat, str], sourcefile: Path, at
5056
if dataformat == 'Presentation':
5157

5258
try:
53-
with sourcefile.open() as fid:
59+
with sourcefile.open('r') as fid:
5460
while '-' in (line := fid.readline()):
5561
key, value = line.split('-', 1)
5662
if attribute == key.strip():

bidscoin/utilities/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from importlib.util import find_spec
1313
from bidscoin import is_hidden, lsdirs, DEBUG
1414

15+
# Ignore pydicom warnings, such as "The value length (68) exceeds the maximum length of 64 allowed for VR LO" and "Invalid value for VR UI: [..]"
1516
config.INVALID_KEY_BEHAVIOR = 'IGNORE'
1617
config.IGNORE = 1
1718

0 commit comments

Comments
 (0)