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

BF: Image can no longer clear headerref

parent a72acc33
No related branches found
No related tags found
No related merge requests found
...@@ -262,6 +262,11 @@ class Nifti(notifier.Notifier, meta.Meta): ...@@ -262,6 +262,11 @@ class Nifti(notifier.Notifier, meta.Meta):
self.__isNeurological = isneuro self.__isNeurological = isneuro
def __del__(self):
"""Clears the reference to the ``nibabel`` header object. """
self.__header = None
@staticmethod @staticmethod
def determineShape(header): def determineShape(header):
"""This method is called by :meth:`__init__`. It figures out the actual """This method is called by :meth:`__init__`. It figures out the actual
...@@ -507,7 +512,7 @@ class Nifti(notifier.Notifier, meta.Meta): ...@@ -507,7 +512,7 @@ class Nifti(notifier.Notifier, meta.Meta):
new = Nifti(header) new = Nifti(header)
if not (self.sameSpace(new) and self.ndim == new.ndim): if not (self.sameSpace(new) and self.ndim == new.ndim):
raise ValueError('Incompatible header') raise ValueError('Incompatible header')
self.__header = new self.__header = header
@property @property
...@@ -1198,8 +1203,7 @@ class Image(Nifti): ...@@ -1198,8 +1203,7 @@ class Image(Nifti):
def __del__(self): def __del__(self):
"""Closes any open file handles, and clears some references. """ """Closes any open file handles, and clears some references. """
Nifti.__del__(self)
self.header = None
self.__nibImage = None self.__nibImage = None
self.__imageWrapper = None self.__imageWrapper = None
......
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