Commit ef3a10196a26b610e6b30be2a96ce83b2c8af902
1 parent
2f686c76
Exists in
master
Removed six from InVesalius
Showing
6 changed files
with
11 additions
and
19 deletions
Show diff stats
invesalius/data/geometry.py
... | ... | @@ -22,14 +22,13 @@ import math |
22 | 22 | |
23 | 23 | import numpy as np |
24 | 24 | import vtk |
25 | -from six import with_metaclass | |
26 | 25 | from pubsub import pub as Publisher |
27 | 26 | |
28 | 27 | import invesalius.constants as const |
29 | 28 | import invesalius.utils as utils |
30 | 29 | |
31 | 30 | |
32 | -class Box(with_metaclass(utils.Singleton, object)): | |
31 | +class Box(metaclass=utils.Singleton): | |
33 | 32 | """ |
34 | 33 | This class is a data structure for storing the |
35 | 34 | coordinates (min and max) of box used in crop-mask. | ... | ... |
invesalius/data/measures.py
1 | 1 | # -*- coding: UTF-8 -*- |
2 | 2 | |
3 | -from six import with_metaclass | |
4 | - | |
5 | 3 | import math |
6 | 4 | import random |
7 | 5 | import sys |
... | ... | @@ -57,7 +55,7 @@ else: |
57 | 55 | |
58 | 56 | DEBUG_DENSITY = False |
59 | 57 | |
60 | -class MeasureData(with_metaclass(utils.Singleton)): | |
58 | +class MeasureData(metaclass=utils.Singleton): | |
61 | 59 | """ |
62 | 60 | Responsible to keep measures data. |
63 | 61 | """ | ... | ... |
invesalius/data/slice_.py
... | ... | @@ -22,7 +22,6 @@ import tempfile |
22 | 22 | import numpy as np |
23 | 23 | import vtk |
24 | 24 | from scipy import ndimage |
25 | -from six import with_metaclass | |
26 | 25 | from pubsub import pub as Publisher |
27 | 26 | |
28 | 27 | import invesalius.constants as const |
... | ... | @@ -77,7 +76,7 @@ class SliceBuffer(object): |
77 | 76 | # Only one slice will be initialized per time (despite several viewers |
78 | 77 | # show it from distinct perspectives). |
79 | 78 | # Therefore, we use Singleton design pattern for implementing it. |
80 | -class Slice(with_metaclass(utils.Singleton, object)): | |
79 | +class Slice(metaclass=utils.Singleton): | |
81 | 80 | def __init__(self): |
82 | 81 | self.current_mask = None |
83 | 82 | self.blend_filter = None | ... | ... |
invesalius/data/styles.py
... | ... | @@ -30,7 +30,6 @@ import wx |
30 | 30 | from scipy import ndimage |
31 | 31 | from imageio import imsave |
32 | 32 | from scipy.ndimage import generate_binary_structure, watershed_ift |
33 | -from six import with_metaclass | |
34 | 33 | from skimage.morphology import watershed |
35 | 34 | from pubsub import pub as Publisher |
36 | 35 | |
... | ... | @@ -1127,7 +1126,7 @@ class ChangeSliceInteractorStyle(DefaultInteractorStyle): |
1127 | 1126 | self.last_position = position[1] |
1128 | 1127 | |
1129 | 1128 | |
1130 | -class EditorConfig(with_metaclass(utils.Singleton, object)): | |
1129 | +class EditorConfig(metaclass=utils.Singleton): | |
1131 | 1130 | def __init__(self): |
1132 | 1131 | self.operation = const.BRUSH_THRESH |
1133 | 1132 | self.cursor_type = const.BRUSH_CIRCLE |
... | ... | @@ -1394,7 +1393,7 @@ class WatershedProgressWindow(object): |
1394 | 1393 | self.dlg.Destroy() |
1395 | 1394 | |
1396 | 1395 | |
1397 | -class WatershedConfig(with_metaclass(utils.Singleton, object)): | |
1396 | +class WatershedConfig(metaclass=utils.Singleton): | |
1398 | 1397 | def __init__(self): |
1399 | 1398 | self.algorithm = "Watershed" |
1400 | 1399 | self.con_2d = 4 |
... | ... | @@ -2174,7 +2173,7 @@ class ReorientImageInteractorStyle(DefaultInteractorStyle): |
2174 | 2173 | buffer_.discard_image() |
2175 | 2174 | |
2176 | 2175 | |
2177 | -class FFillConfig(with_metaclass(utils.Singleton, object)): | |
2176 | +class FFillConfig(metaclass=utils.Singleton): | |
2178 | 2177 | def __init__(self): |
2179 | 2178 | self.dlg_visible = False |
2180 | 2179 | self.target = "2D" |
... | ... | @@ -2310,7 +2309,7 @@ class RemoveMaskPartsInteractorStyle(FloodFillMaskInteractorStyle): |
2310 | 2309 | self._progr_title = _(u"Remove part") |
2311 | 2310 | self._progr_msg = _(u"Removing part ...") |
2312 | 2311 | |
2313 | -class CropMaskConfig(with_metaclass(utils.Singleton, object)): | |
2312 | +class CropMaskConfig(metaclass=utils.Singleton): | |
2314 | 2313 | def __init__(self): |
2315 | 2314 | self.dlg_visible = False |
2316 | 2315 | |
... | ... | @@ -2411,7 +2410,7 @@ class CropMaskInteractorStyle(DefaultInteractorStyle): |
2411 | 2410 | Publisher.sendMessage('Reload actual slice') |
2412 | 2411 | |
2413 | 2412 | |
2414 | -class SelectPartConfig(with_metaclass(utils.Singleton, object)): | |
2413 | +class SelectPartConfig(metaclass=utils.Singleton): | |
2415 | 2414 | def __init__(self): |
2416 | 2415 | self.mask = None |
2417 | 2416 | self.con_3d = 6 |
... | ... | @@ -2517,7 +2516,7 @@ class SelectMaskPartsInteractorStyle(DefaultInteractorStyle): |
2517 | 2516 | self.config.mask = mask |
2518 | 2517 | |
2519 | 2518 | |
2520 | -class FFillSegmentationConfig(with_metaclass(utils.Singleton, object)): | |
2519 | +class FFillSegmentationConfig(metaclass=utils.Singleton): | |
2521 | 2520 | def __init__(self): |
2522 | 2521 | self.dlg_visible = False |
2523 | 2522 | self.target = "2D" | ... | ... |
invesalius/project.py
... | ... | @@ -29,7 +29,6 @@ import tempfile |
29 | 29 | import numpy as np |
30 | 30 | import vtk |
31 | 31 | import wx |
32 | -from six import with_metaclass | |
33 | 32 | |
34 | 33 | from pubsub import pub as Publisher |
35 | 34 | |
... | ... | @@ -52,7 +51,7 @@ else: |
52 | 51 | |
53 | 52 | # Only one project will be initialized per time. Therefore, we use |
54 | 53 | # Singleton design pattern for implementing it |
55 | -class Project(with_metaclass(Singleton, object)): | |
54 | +class Project(metaclass=Singleton): | |
56 | 55 | def __init__(self): |
57 | 56 | # Patient/ acquistion information |
58 | 57 | self.name = '' | ... | ... |
invesalius/session.py
... | ... | @@ -17,8 +17,6 @@ |
17 | 17 | # detalhes. |
18 | 18 | #-------------------------------------------------------------------------- |
19 | 19 | |
20 | -from six import with_metaclass | |
21 | - | |
22 | 20 | try: |
23 | 21 | import configparser as ConfigParser |
24 | 22 | except(ImportError): |
... | ... | @@ -51,7 +49,7 @@ SESSION_ENCODING = 'utf8' |
51 | 49 | |
52 | 50 | # Only one session will be initialized per time. Therefore, we use |
53 | 51 | # Singleton design pattern for implementing it |
54 | -class Session(with_metaclass(Singleton, object)): | |
52 | +class Session(metaclass=Singleton): | |
55 | 53 | |
56 | 54 | def __init__(self): |
57 | 55 | self.project_path = () | ... | ... |