Skip to content
Snippets Groups Projects
Commit 8381891b authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Fixed if ImageWrapper.__init__ crashes, ImageWrapper.__del__ complains

because __taskThread attr does not exist.
parent 866eb387
No related branches found
No related tags found
No related merge requests found
......@@ -322,7 +322,7 @@ class Image(Nifti1, notifier.Notifier):
as properties (https://docs.python.org/2/library/functions.html#property):
============== ======================================================
============== ===========================================================
``name`` The name of this ``Image`` - defaults to the image
file name, sans-suffix.
......@@ -341,7 +341,7 @@ class Image(Nifti1, notifier.Notifier):
:meth:`__init__`, this may be calculated when the ``Image``
is created, or may be incrementally updated as more image
data is loaded from disk.
============== ======================================================
============== ===========================================================
The ``Image`` class implements the :class:`.Notifier` interface -
......@@ -409,7 +409,6 @@ class Image(Nifti1, notifier.Notifier):
file is opened by ``nibabel``. Ignored if ``loadData``
is ``True``.
:arg threaded: If ``True``, the :class:`.ImageWrapper` will use a
separate thread for data range calculation. Defaults
to ``False``. Ignored if ``loadData`` is ``True``.
......
......@@ -149,8 +149,9 @@ class ImageWrapper(notifier.Notifier):
data range is updated directly on reads/writes.
"""
self.__image = image
self.__name = name
self.__image = image
self.__name = name
self.__taskThread = None
# Save the number of 'real' dimensions,
# that is the number of dimensions minus
......@@ -177,9 +178,7 @@ class ImageWrapper(notifier.Notifier):
if loadData:
self.loadData()
if not threaded:
self.__taskThread = None
else:
if threaded:
self.__taskThread = async.TaskThread()
self.__taskThread.start()
......
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