Commit b6cf8d8c authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

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

present
parent 081a43cc
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment