Skip to content
Snippets Groups Projects
Commit e7341f65 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

BF: Image creation does not fail if a sidecar file with invalid JSON is

present
parent 0a972e0c
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment