[med-svn] [Git][med-team/invesalius][master] 9 commits: More pytorch dependency to recommends, also allow the cuda version. Closes: 1077501

Michael R. Crusoe (@crusoe) gitlab at salsa.debian.org
Tue Sep 10 12:26:24 BST 2024



Michael R. Crusoe pushed to branch master at Debian Med / invesalius


Commits:
7445e71f by Michael R. Crusoe at 2024-09-10T12:14:50+02:00
More pytorch dependency to recommends, also allow the cuda version. Closes: 1077501

- - - - -
21741ca1 by Michael R. Crusoe at 2024-09-10T12:38:19+02:00
d/control: explicit build-dep on setuptools. Closes: #1080608

- - - - -
80c5f2e9 by Michael R. Crusoe at 2024-09-10T12:42:24+02:00
d/rules: update launcher for newer numpy

- - - - -
1443d4df by Michael R. Crusoe at 2024-09-10T12:46:21+02:00
d/patches: fixed the Dep-3 metadata, the author's email address was missing

- - - - -
33a44ed4 by Michael R. Crusoe at 2024-09-10T13:12:29+02:00
Cherry-pick patch from upstream to remove all references to distutils

- - - - -
159687e3 by Michael R. Crusoe at 2024-09-10T13:25:23+02:00
Created a patch to avoid a SyntaxWarning

- - - - -
4b27c556 by Michael R. Crusoe at 2024-09-10T13:25:23+02:00
Fix build cleaning. Closes: #1047615

- - - - -
f32a8bef by Michael R. Crusoe at 2024-09-10T13:25:23+02:00
routine-update: Build-Depends: s/dh-python/dh-sequence-python3/

- - - - -
be22fe07 by Michael R. Crusoe at 2024-09-10T13:25:23+02:00
routine-update: Ready to upload to unstable

- - - - -


11 changed files:

- debian/changelog
- + debian/clean
- debian/control
- + debian/patches/0005-Distutils-is-being-deprecated-using-setuptools.patch
- + debian/patches/0006-mark-a-string-as-raw-to-deal-with-a-Windows-slash.patch
- debian/patches/11_add_auibar.patch
- debian/patches/11_python311.patch
- debian/patches/11_rm_gdcm_trace.patch
- debian/patches/11_wxpython_int_fix.patch
- debian/patches/series
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,20 @@
+invesalius (3.1.99998-5) unstable; urgency=medium
+
+  * Team upload.
+  * More pytorch dependency to recommends, also allow the cuda version.
+    Closes: 1077501
+  * d/control: explicit build-dep on setuptools. Closes: #1080608
+  * d/rules: update launcher for newer numpy
+  * d/patches: fixed the Dep-3 metadata, the author's email address was
+    missing
+  * Cherry-pick patch from upstream to remove all references to
+    distutils
+  * Created a patch to avoid several SyntaxWarnings
+  * Fix build cleaning. Closes: #1047615
+  * Build-Depends: s/dh-python/dh-sequence-python3/ (routine-update)
+
+ -- Michael R. Crusoe <crusoe at debian.org>  Tue, 10 Sep 2024 13:13:28 +0200
+
 invesalius (3.1.99998-4) unstable; urgency=medium
 
   * Added patch: python-3.11 gettext.translation doesn't have the 'codeset'


=====================================
debian/clean
=====================================
@@ -0,0 +1,6 @@
+invesalius3
+invesalius_cy/cy_mesh.cpp
+invesalius_cy/floodfill.cpp
+invesalius_cy/interpolation.c
+invesalius_cy/mips.c
+invesalius_cy/transforms.c


=====================================
debian/control
=====================================
@@ -6,8 +6,9 @@ Section: graphics
 Priority: optional
 Build-Depends: debhelper-compat (= 13),
                python3-dev,
+               python3-setuptools,
                cython3,
-               dh-python,
+               dh-sequence-python3,
                imagemagick,
                python3-numpy
 Build-Depends-Indep: python3
@@ -21,6 +22,7 @@ Package: invesalius
 Architecture: all
 Depends: ${python3:Depends},
          ${misc:Depends},
+         python3-setuptools,
          python3-numpy,
          python3-scipy,
          python3-skimage,
@@ -34,8 +36,8 @@ Depends: ${python3:Depends},
          python3-h5py,
          python3-imageio,
          python3-pubsub,
-         python3-torch,
          invesalius-bin
+Recommends: python3-torch | python3-torch-cuda
 Description: 3D medical imaging reconstruction software
  InVesalius generates 3D medical imaging reconstructions based on a sequence of
  2D DICOM files acquired with CT or MRI equipments. InVesalius is


=====================================
debian/patches/0005-Distutils-is-being-deprecated-using-setuptools.patch
=====================================
@@ -0,0 +1,213 @@
+From: Thiago Franco de Moraes <totonixsame at gmail.com>
+Date: Wed, 11 May 2022 17:16:14 -0300
+Subject: Distutils is being deprecated using setuptools
+
+---
+ invesalius/data/volume.py       |  6 +++---
+ invesalius/utils.py             |  6 +++---
+ invesalius_cy/cy_mesh.pyx       |  4 ++--
+ invesalius_cy/floodfill.pyx     |  2 +-
+ invesalius_cy/interpolation.pxd |  2 ++
+ invesalius_cy/interpolation.pyx |  3 ++-
+ invesalius_cy/mips.pyx          |  2 +-
+ invesalius_cy/transforms.pyx    |  2 +-
+ setup.py                        | 25 +++++++++++--------------
+ 9 files changed, 26 insertions(+), 26 deletions(-)
+
+diff --git a/invesalius/data/volume.py b/invesalius/data/volume.py
+index 4c6f1e8..f330d04 100644
+--- a/invesalius/data/volume.py
++++ b/invesalius/data/volume.py
+@@ -19,7 +19,7 @@
+ import plistlib
+ import os
+ import weakref
+-from distutils.version import LooseVersion
++from packaging.version import Version
+ 
+ import numpy
+ import vtk
+@@ -734,7 +734,7 @@ class VolumeMask:
+                 self._volume_mapper = vtk.vtkGPUVolumeRayCastMapper()
+                 self._volume_mapper.UseJitteringOn()
+ 
+-                if LooseVersion(vtk.vtkVersion().GetVTKVersion()) > LooseVersion('8.0'):
++                if Version(vtk.vtkVersion().GetVTKVersion()) > Version('8.0'):
+                     self._volume_mapper.SetBlendModeToIsoSurface()
+ 
+             #  else:
+@@ -776,7 +776,7 @@ class VolumeMask:
+             if not self._volume_mapper.IsA("vtkGPUVolumeRayCastMapper"):
+                 self._volume_property.SetScalarOpacityUnitDistance(pix_diag)
+             else:
+-                if LooseVersion(vtk.vtkVersion().GetVTKVersion()) > LooseVersion('8.0'):
++                if Version(vtk.vtkVersion().GetVTKVersion()) > Version('8.0'):
+                     self._volume_property.GetIsoSurfaceValues().SetValue(0, 127)
+ 
+             self._actor = vtk.vtkVolume()
+diff --git a/invesalius/utils.py b/invesalius/utils.py
+index 663f43a..606e64d 100644
+--- a/invesalius/utils.py
++++ b/invesalius/utils.py
+@@ -25,7 +25,7 @@ import math
+ import traceback
+ import collections.abc
+ 
+-from distutils.version import LooseVersion
++from packaging.version import Version
+ from functools import wraps
+ 
+ import numpy as np
+@@ -438,8 +438,8 @@ def UpdateCheck():
+         url = response.readline().rstrip().decode('utf8')
+ 
+         try:
+-            last_ver = LooseVersion(last)
+-            actual_ver = LooseVersion(const.INVESALIUS_VERSION)
++            last_ver = Version(last)
++            actual_ver = Version(const.INVESALIUS_VERSION)
+         except (ValueError, AttributeError):
+             return
+ 
+diff --git a/invesalius_cy/cy_mesh.pyx b/invesalius_cy/cy_mesh.pyx
+index 5b0a200..cbaa94e 100644
+--- a/invesalius_cy/cy_mesh.pyx
++++ b/invesalius_cy/cy_mesh.pyx
+@@ -1,5 +1,5 @@
+-# distutils: language = c++
+-# cython: language_level=3str
++#distutils: language = c++
++#cython: language_level=3
+ #cython: boundscheck=False
+ #cython: wraparound=False
+ #cython: initializedcheck=False
+diff --git a/invesalius_cy/floodfill.pyx b/invesalius_cy/floodfill.pyx
+index 91ed2e4..876e34e 100644
+--- a/invesalius_cy/floodfill.pyx
++++ b/invesalius_cy/floodfill.pyx
+@@ -1,4 +1,4 @@
+-#cython: language_level=3str
++#cython: language_level=3
+ 
+ import numpy as np
+ cimport numpy as np
+diff --git a/invesalius_cy/interpolation.pxd b/invesalius_cy/interpolation.pxd
+index b63cc41..8682674 100644
+--- a/invesalius_cy/interpolation.pxd
++++ b/invesalius_cy/interpolation.pxd
+@@ -1,3 +1,5 @@
++#cython: language_level=3
++
+ from .cy_my_types cimport image_t
+ 
+ cdef double interpolate(image_t[:, :, :], double, double, double) nogil
+diff --git a/invesalius_cy/interpolation.pyx b/invesalius_cy/interpolation.pyx
+index cbcce91..eb27542 100644
+--- a/invesalius_cy/interpolation.pyx
++++ b/invesalius_cy/interpolation.pyx
+@@ -1,4 +1,5 @@
+-#cython: language_level=3str
++#cython: language_level=3
++
+ # from interpolation cimport interpolate
+ 
+ import numpy as np
+diff --git a/invesalius_cy/mips.pyx b/invesalius_cy/mips.pyx
+index a0954c4..41cf359 100644
+--- a/invesalius_cy/mips.pyx
++++ b/invesalius_cy/mips.pyx
+@@ -1,4 +1,4 @@
+-#cython: language_level=3str
++#cython: language_level=3
+ 
+ #http://en.wikipedia.org/wiki/Local_maximum_intensity_projection
+ import numpy as np
+diff --git a/invesalius_cy/transforms.pyx b/invesalius_cy/transforms.pyx
+index 3b43b80..5d88b08 100644
+--- a/invesalius_cy/transforms.pyx
++++ b/invesalius_cy/transforms.pyx
+@@ -1,4 +1,4 @@
+-#cython: language_level=3str
++#cython: language_level=3
+ 
+ import numpy as np
+ cimport numpy as np
+diff --git a/setup.py b/setup.py
+index 9f69c99..28c2a77 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1,15 +1,12 @@
+-import distutils.cmd
+-import distutils.log
++import setuptools
++import logging
+ import os
+ import pathlib
+ import subprocess
+ import sys
+-from distutils.core import setup
+-from distutils.extension import Extension
+ 
+ import numpy
+-from Cython.Build import cythonize
+-from Cython.Distutils import build_ext
++from Cython.Build import cythonize, build_ext
+ 
+ if sys.platform == "darwin":
+     unix_copt = ["-Xpreprocessor", "-fopenmp", "-lomp"]
+@@ -43,7 +40,7 @@ class build_ext_subclass(build_ext):
+         build_ext.build_extensions(self)
+ 
+ 
+-class BuildPluginsCommand(distutils.cmd.Command):
++class BuildPluginsCommand(setuptools.Command):
+     """
+     A custom command to build all plugins with cython code.
+     """
+@@ -63,7 +60,7 @@ class BuildPluginsCommand(distutils.cmd.Command):
+         plugins_folder = inv_folder.joinpath("plugins")
+         for p in compilable_plugins:
+             plugin_folder = plugins_folder.joinpath(p)
+-            self.announce("Compiling plugin: {}".format(p), level=distutils.log.INFO)
++            self.announce("Compiling plugin: {}".format(p), level=logging.INFO)
+             os.chdir(plugin_folder)
+             subprocess.check_call(
+                 [sys.executable, "setup.py", "build_ext", "--inplace"]
+@@ -71,31 +68,31 @@ class BuildPluginsCommand(distutils.cmd.Command):
+             os.chdir(inv_folder)
+ 
+ 
+-setup(
++setuptools.setup(
+     cmdclass={
+         "build_ext": build_ext_subclass,
+         "build_plugins": BuildPluginsCommand,
+     },
+     ext_modules=cythonize(
+         [
+-            Extension(
++            setuptools.Extension(
+                 "invesalius_cy.mips",
+                 ["invesalius_cy/mips.pyx"],
+             ),
+-            Extension(
++            setuptools.Extension(
+                 "invesalius_cy.interpolation",
+                 ["invesalius_cy/interpolation.pyx"],
+             ),
+-            Extension(
++            setuptools.Extension(
+                 "invesalius_cy.transforms",
+                 ["invesalius_cy/transforms.pyx"],
+             ),
+-            Extension(
++            setuptools.Extension(
+                 "invesalius_cy.floodfill",
+                 ["invesalius_cy/floodfill.pyx"],
+                 language="c++",
+             ),
+-            Extension(
++            setuptools.Extension(
+                 "invesalius_cy.cy_mesh",
+                 ["invesalius_cy/cy_mesh.pyx"],
+                 language="c++",


=====================================
debian/patches/0006-mark-a-string-as-raw-to-deal-with-a-Windows-slash.patch
=====================================
@@ -0,0 +1,84 @@
+From: "Michael R. Crusoe" <crusoe at debian.org>
+Date: Tue, 10 Sep 2024 12:54:03 +0200
+Subject: mark a string as raw to deal with a Windows slash
+
+Forwarded: https://github.com/invesalius/invesalius3/pull/841
+---
+ app.py                             | 2 +-
+ invesalius/data/transformations.py | 6 +++---
+ invesalius/reader/bitmap_reader.py | 2 +-
+ invesalius/version.py              | 4 ++--
+ 4 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/app.py b/app.py
+index f0dfb43..40dd61f 100644
+--- a/app.py
++++ b/app.py
+@@ -504,7 +504,7 @@ def init():
+ 
+         #Click in the .inv3 file support
+         root = winreg.HKEY_CLASSES_ROOT
+-        key = "InVesalius 3.1\InstallationDir"
++        key = r"InVesalius 3.1\InstallationDir"
+         hKey = winreg.OpenKey (root, key, 0, winreg.KEY_READ)
+         value, type_ = winreg.QueryValueEx (hKey, "")
+         path = os.path.join(value,'dist')
+diff --git a/invesalius/data/transformations.py b/invesalius/data/transformations.py
+index afad1e9..e4721b5 100644
+--- a/invesalius/data/transformations.py
++++ b/invesalius/data/transformations.py
+@@ -30,7 +30,7 @@
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ # POSSIBILITY OF SUCH DAMAGE.
+ 
+-"""Homogeneous Transformation Matrices and Quaternions.
++r"""Homogeneous Transformation Matrices and Quaternions.
+ 
+ A library for calculating 4x4 matrices for translating, rotating, reflecting,
+ scaling, shearing, projecting, orthogonalizing, and superimposing arrays of
+@@ -887,7 +887,7 @@ def orthogonalization_matrix(lengths, angles):
+ 
+ 
+ def affine_matrix_from_points(v0, v1, shear=True, scale=True, usesvd=True):
+-    """Return affine transform matrix to register two point sets.
++    r"""Return affine transform matrix to register two point sets.
+ 
+     v0 and v1 are shape (ndims, \*) arrays of at least ndims non-homogeneous
+     coordinates, where ndims is the dimensionality of the coordinate space.
+@@ -996,7 +996,7 @@ def affine_matrix_from_points(v0, v1, shear=True, scale=True, usesvd=True):
+ 
+ 
+ def superimposition_matrix(v0, v1, scale=False, usesvd=True):
+-    """Return matrix to transform given 3D point set into second point set.
++    r"""Return matrix to transform given 3D point set into second point set.
+ 
+     v0 and v1 are shape (3, \*) or (4, \*) arrays of at least 3 points.
+ 
+diff --git a/invesalius/reader/bitmap_reader.py b/invesalius/reader/bitmap_reader.py
+index 426af7b..2abef91 100644
+--- a/invesalius/reader/bitmap_reader.py
++++ b/invesalius/reader/bitmap_reader.py
+@@ -118,7 +118,7 @@ class BitmapFiles:
+         self.bitmapfiles.append(bmp)
+ 
+     def Sort(self, x):
+-        c_re = re.compile("\d+")
++        c_re = re.compile(r"\d+")
+         if len(c_re.findall(x[6])) > 0:
+             return [int(i) for i in c_re.findall(x[6])]
+         else:
+diff --git a/invesalius/version.py b/invesalius/version.py
+index 4b7deaf..997d0a3 100644
+--- a/invesalius/version.py
++++ b/invesalius/version.py
+@@ -49,8 +49,8 @@ def get_svn_revision(path=None):
+     else:
+         # Versions >= 7 of the entries file are flat text.  The first line is
+         # the version number. The next set of digits after 'dir' is the revision.
+-        if re.match('(\d+)', entries):
+-            rev_match = re.search('\d+\s+dir\s+(\d+)', entries)
++        if re.match(r'(\d+)', entries):
++            rev_match = re.search(r'\d+\s+dir\s+(\d+)', entries)
+             if rev_match:
+                 rev = rev_match.groups()[0]
+         # Older XML versions of the file specify revision as an attribute of


=====================================
debian/patches/11_add_auibar.patch
=====================================
@@ -1,6 +1,12 @@
-Author: Thiago Franco de Moraes
+From: Thiago Franco de Moraes <totonixsame at gmail.com>
+Date: Tue, 10 Sep 2024 12:46:30 +0200
+Subject: Add missing widget
+
 Last-Update: 2022-07-26 19:23:03 -0300
-Description: Add missing widget
+---
+ invesalius/gui/widgets/auibar.py | 4031 ++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 4031 insertions(+)
+ create mode 100644 invesalius/gui/widgets/auibar.py
 
 diff --git a/invesalius/gui/widgets/auibar.py b/invesalius/gui/widgets/auibar.py
 new file mode 100644


=====================================
debian/patches/11_python311.patch
=====================================
@@ -1,6 +1,12 @@
-Author: Thiago Franco de Moraes
+From: Thiago Franco de Moraes <totonixsame at gmail.com>
+Date: Tue, 10 Sep 2024 12:46:30 +0200
+Subject: Python-3.11 gettext.translation doesn't have the 'codeset' parameter
+ anymore
+
 Last-Update: 2023-02-08 10:58:03 -0300
-Description: Python-3.11 gettext.translation doesn't have the 'codeset' parameter anymore
+---
+ invesalius/i18n.py | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
 
 diff --git a/invesalius/i18n.py b/invesalius/i18n.py
 index fe701f3..c222bd9 100644


=====================================
debian/patches/11_rm_gdcm_trace.patch
=====================================
@@ -1,6 +1,11 @@
-Author: Thiago Franco de Moraes
+From: Thiago Franco de Moraes <totonixsame at gmail.com>
+Date: Tue, 10 Sep 2024 12:46:30 +0200
+Subject: Trace_DebugOff and Trace_WarningOff was removed from gdcm.
+
 Last-Update: 2023-02-08 17:19:03 -0300
-Description: Trace_DebugOff and Trace_WarningOff was removed from gdcm.
+---
+ invesalius/reader/dicom_reader.py | 3 ---
+ 1 file changed, 3 deletions(-)
 
 diff --git a/invesalius/reader/dicom_reader.py b/invesalius/reader/dicom_reader.py
 index b7580b5..0062ef0 100644


=====================================
debian/patches/11_wxpython_int_fix.patch
=====================================
@@ -1,6 +1,18 @@
-Author: Thiago Franco de Moraes
+From: Thiago Franco de Moraes <totonixsame at gmail.com>
+Date: Tue, 10 Sep 2024 12:46:30 +0200
+Subject: Force integer positions
+
 Last-Update: 2022-07-22 17:49:36 -0300
-Description: Force integer positions
+---
+ invesalius/data/viewer_slice.py        | 8 ++++----
+ invesalius/gui/bitmap_preview_panel.py | 4 ++--
+ invesalius/gui/brain_seg_dialog.py     | 2 +-
+ invesalius/gui/dialogs.py              | 2 +-
+ invesalius/gui/dicom_preview_panel.py  | 4 +++-
+ invesalius/gui/frame.py                | 2 +-
+ invesalius/gui/task_surface.py         | 2 +-
+ invesalius/gui/widgets/gradient.py     | 8 ++++----
+ 8 files changed, 17 insertions(+), 15 deletions(-)
 
 diff --git a/invesalius/data/viewer_slice.py b/invesalius/data/viewer_slice.py
 index 51c9235..841731f 100644


=====================================
debian/patches/series
=====================================
@@ -2,3 +2,5 @@
 11_wxpython_int_fix.patch
 11_python311.patch
 11_rm_gdcm_trace.patch
+0005-Distutils-is-being-deprecated-using-setuptools.patch
+0006-mark-a-string-as-raw-to-deal-with-a-Windows-slash.patch


=====================================
debian/rules
=====================================
@@ -7,28 +7,24 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
 export PYBUILD_NAME=invesalius
 
 %:
-	dh $@ --with python3 --buildsystem=pybuild
+	dh $@ --buildsystem=pybuild
 
 override_dh_auto_build:
 	python3 setup.py build_ext --inplace
 
-override_dh_auto_clean:
-	# dh_auto_clean
-	rm -f invesalius3
+execute_after_dh_auto_clean:
+	rm -f invesalius_cy/*.so
 
 override_dh_compress:
 	dh_compress --exclude=LICENSE.pt.txt --exclude=.inv3
 
-override_dh_clean:
-	dh_clean
-	rm -rf build
-
 create-launcher:
 	echo '#!/bin/sh' > invesalius3
 	echo 'export INV_SAMPLE_DIR="/usr/share/doc/invesalius-examples/examples/"' >> invesalius3
 	echo 'export GDK_BACKEND=x11' >> invesalius3
 	echo 'export PYTHONPATH=$$PYTHONPATH:"/usr/lib/invesalius"' >> invesalius3
 	echo 'export INVESALIUS_LIBRARY_PATH="/usr/share/invesalius/"' >> invesalius3
+	echo 'export NUMPY_EXPERIMENTAL_DTYPE_API=1' >> invesalius3
 	echo 'cd $$INVESALIUS_LIBRARY_PATH' >> invesalius3
 	echo 'python3 app.py $$@' >> invesalius3
 



View it on GitLab: https://salsa.debian.org/med-team/invesalius/-/compare/e709ea4871b2aac170e3aafd4cd23becb2ea8a5c...be22fe0769c95df07cdaa8d1a23c5217c5aa2293

-- 
View it on GitLab: https://salsa.debian.org/med-team/invesalius/-/compare/e709ea4871b2aac170e3aafd4cd23becb2ea8a5c...be22fe0769c95df07cdaa8d1a23c5217c5aa2293
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240910/ae2076ec/attachment-0001.htm>


More information about the debian-med-commit mailing list