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