diff --git a/invesalius/data/geometry.py b/invesalius/data/geometry.py index 27cc93b..ba2543c 100644 --- a/invesalius/data/geometry.py +++ b/invesalius/data/geometry.py @@ -22,14 +22,13 @@ import math import numpy as np import vtk -from six import with_metaclass from pubsub import pub as Publisher import invesalius.constants as const import invesalius.utils as utils -class Box(with_metaclass(utils.Singleton, object)): +class Box(metaclass=utils.Singleton): """ This class is a data structure for storing the coordinates (min and max) of box used in crop-mask. diff --git a/invesalius/data/measures.py b/invesalius/data/measures.py index 48397aa..d0250bd 100644 --- a/invesalius/data/measures.py +++ b/invesalius/data/measures.py @@ -1,7 +1,5 @@ # -*- coding: UTF-8 -*- -from six import with_metaclass - import math import random import sys @@ -57,7 +55,7 @@ else: DEBUG_DENSITY = False -class MeasureData(with_metaclass(utils.Singleton)): +class MeasureData(metaclass=utils.Singleton): """ Responsible to keep measures data. """ diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index bb2bfbf..86d7d5b 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -22,7 +22,6 @@ import tempfile import numpy as np import vtk from scipy import ndimage -from six import with_metaclass from pubsub import pub as Publisher import invesalius.constants as const @@ -77,7 +76,7 @@ class SliceBuffer(object): # Only one slice will be initialized per time (despite several viewers # show it from distinct perspectives). # Therefore, we use Singleton design pattern for implementing it. -class Slice(with_metaclass(utils.Singleton, object)): +class Slice(metaclass=utils.Singleton): def __init__(self): self.current_mask = None self.blend_filter = None diff --git a/invesalius/data/styles.py b/invesalius/data/styles.py index 7f7a72d..248715b 100644 --- a/invesalius/data/styles.py +++ b/invesalius/data/styles.py @@ -30,7 +30,6 @@ import wx from scipy import ndimage from imageio import imsave from scipy.ndimage import generate_binary_structure, watershed_ift -from six import with_metaclass from skimage.morphology import watershed from pubsub import pub as Publisher @@ -1127,7 +1126,7 @@ class ChangeSliceInteractorStyle(DefaultInteractorStyle): self.last_position = position[1] -class EditorConfig(with_metaclass(utils.Singleton, object)): +class EditorConfig(metaclass=utils.Singleton): def __init__(self): self.operation = const.BRUSH_THRESH self.cursor_type = const.BRUSH_CIRCLE @@ -1394,7 +1393,7 @@ class WatershedProgressWindow(object): self.dlg.Destroy() -class WatershedConfig(with_metaclass(utils.Singleton, object)): +class WatershedConfig(metaclass=utils.Singleton): def __init__(self): self.algorithm = "Watershed" self.con_2d = 4 @@ -2174,7 +2173,7 @@ class ReorientImageInteractorStyle(DefaultInteractorStyle): buffer_.discard_image() -class FFillConfig(with_metaclass(utils.Singleton, object)): +class FFillConfig(metaclass=utils.Singleton): def __init__(self): self.dlg_visible = False self.target = "2D" @@ -2310,7 +2309,7 @@ class RemoveMaskPartsInteractorStyle(FloodFillMaskInteractorStyle): self._progr_title = _(u"Remove part") self._progr_msg = _(u"Removing part ...") -class CropMaskConfig(with_metaclass(utils.Singleton, object)): +class CropMaskConfig(metaclass=utils.Singleton): def __init__(self): self.dlg_visible = False @@ -2411,7 +2410,7 @@ class CropMaskInteractorStyle(DefaultInteractorStyle): Publisher.sendMessage('Reload actual slice') -class SelectPartConfig(with_metaclass(utils.Singleton, object)): +class SelectPartConfig(metaclass=utils.Singleton): def __init__(self): self.mask = None self.con_3d = 6 @@ -2517,7 +2516,7 @@ class SelectMaskPartsInteractorStyle(DefaultInteractorStyle): self.config.mask = mask -class FFillSegmentationConfig(with_metaclass(utils.Singleton, object)): +class FFillSegmentationConfig(metaclass=utils.Singleton): def __init__(self): self.dlg_visible = False self.target = "2D" diff --git a/invesalius/project.py b/invesalius/project.py index 60fd275..2f79620 100644 --- a/invesalius/project.py +++ b/invesalius/project.py @@ -29,7 +29,6 @@ import tempfile import numpy as np import vtk import wx -from six import with_metaclass from pubsub import pub as Publisher @@ -52,7 +51,7 @@ else: # Only one project will be initialized per time. Therefore, we use # Singleton design pattern for implementing it -class Project(with_metaclass(Singleton, object)): +class Project(metaclass=Singleton): def __init__(self): # Patient/ acquistion information self.name = '' diff --git a/invesalius/session.py b/invesalius/session.py index e5465ad..9c9901d 100644 --- a/invesalius/session.py +++ b/invesalius/session.py @@ -17,8 +17,6 @@ # detalhes. #-------------------------------------------------------------------------- -from six import with_metaclass - try: import configparser as ConfigParser except(ImportError): @@ -51,7 +49,7 @@ SESSION_ENCODING = 'utf8' # Only one session will be initialized per time. Therefore, we use # Singleton design pattern for implementing it -class Session(with_metaclass(Singleton, object)): +class Session(metaclass=Singleton): def __init__(self): self.project_path = () -- libgit2 0.21.2