Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christoph Arthofer
fslpy
Commits
b6cf8d8c
Commit
b6cf8d8c
authored
Mar 29, 2020
by
Paul McCarthy
🚵
Browse files
BF: Image creation does not fail if a sidecar file with invalid JSON is
present
parent
081a43cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
fsl/data/image.py
View file @
b6cf8d8c
...
...
@@ -1162,11 +1162,19 @@ class Image(Nifti):
self
.
register
(
self
.
name
,
self
.
__headerChanged
,
topic
=
'transform'
)
self
.
register
(
self
.
name
,
self
.
__headerChanged
,
topic
=
'header'
)
# calculate min/max
# of image data
if
calcRange
:
self
.
calcRange
()
# try and load metadata
# from JSON sidecar files
if
self
.
dataSource
is
not
None
and
loadMeta
:
self
.
updateMeta
(
loadMetadata
(
self
))
try
:
self
.
updateMeta
(
loadMetadata
(
self
))
except
Exception
as
e
:
log
.
warning
(
'Failed to load metadata for %s: %s'
,
self
.
dataSource
,
e
)
self
.
__imageWrapper
.
register
(
self
.
__lName
,
self
.
__dataRangeChanged
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment