[med-svn] r17989 - trunk/packages/dicompyler/trunk/debian/patches

Andreas Tille tille at moszumanska.debian.org
Thu Sep 11 10:02:53 UTC 2014


Author: tille
Date: 2014-09-11 10:02:52 +0000 (Thu, 11 Sep 2014)
New Revision: 17989

Added:
   trunk/packages/dicompyler/trunk/debian/patches/enable_later_versions_of_matplotlib.patch
Modified:
   trunk/packages/dicompyler/trunk/debian/patches/series
Log:
Try to port dicompyler to current version of matplotlib


Added: trunk/packages/dicompyler/trunk/debian/patches/enable_later_versions_of_matplotlib.patch
===================================================================
--- trunk/packages/dicompyler/trunk/debian/patches/enable_later_versions_of_matplotlib.patch	                        (rev 0)
+++ trunk/packages/dicompyler/trunk/debian/patches/enable_later_versions_of_matplotlib.patch	2014-09-11 10:02:52 UTC (rev 17989)
@@ -0,0 +1,66 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Wed, 10 Sep 2014 23:21:42 +0200
+Description: Try to port dicompyler to current version of matplotlib
+ Patch is oriented at code found here:
+   http://sources.debian.net/src/psychopy/1.79.00%2Bgit16-g30c9343.dfsg-1/psychopy/visual/helpers.py/#L41
+
+--- a/dicompyler/dvhcalc.py
++++ b/dicompyler/dvhcalc.py
+@@ -12,7 +12,11 @@ import logging
+ logger = logging.getLogger('dicompyler.dvhcalc')
+ import numpy as np
+ import numpy.ma as ma
+-import matplotlib.nxutils as nx
++import matplotlib
++if matplotlib.__version__ > '1.2':
++    from matplotlib.path import Path as mpl_Path
++else:
++    from matplotlib import nxutils as nx
+ 
+ def get_dvh(structure, dose, limit=None, callback=None):
+     """Get a calculated cumulative DVH along with the associated parameters."""
+@@ -100,11 +104,17 @@ def calculate_dvh(structure, dose, limit
+             else:
+                 contour['inside'] = False
+                 for point in contour['data']:
+-                    if nx.pnpoly(point[0], point[1],
++                    if matplotlib.__version__ > '1.2':
++                        if mpl_Path(np.array(contours[largestIndex]['data'])).contains_point(point):
++                            contour['inside'] = True
++                            # Assume if one point is inside, all will be inside
++                            break
++                    else:
++                        if nx.pnpoly(point[0], point[1],
+                                  np.array(contours[largestIndex]['data'])):
+-                        contour['inside'] = True
+-                        # Assume if one point is inside, all will be inside
+-                        break
++                            contour['inside'] = True
++                            # Assume if one point is inside, all will be inside
++                            break
+                 # If the contour is inside, subtract it from the total histogram
+                 if contour['inside']:
+                     hist -= h
+@@ -161,7 +171,10 @@ def calculate_contour_areas(plane):
+ def get_contour_mask(doselut, dosegridpoints, contour):
+     """Get the mask for the contour with respect to the dose plane."""
+ 
+-    grid = nx.points_inside_poly(dosegridpoints, contour)
++    if matplotlib.__version__ > '1.2':
++        grid = mpl_Path(contour).contains_points(dosegridpoints)
++    else:
++        grid = nx.points_inside_poly(dosegridpoints, contour)
+     grid = grid.reshape((len(doselut[1]), len(doselut[0])))
+ 
+     return grid
+--- a/setup.py
++++ b/setup.py
+@@ -14,7 +14,7 @@ from setuptools import setup, find_packa
+ import sys
+ 
+ requires = [
+-    'matplotlib>=0.99, <=1.1.0',
++    'matplotlib>=0.99, <=1.3.1',
+     'numpy>=1.2.1',
+     'pillow>=2.5.1',
+     'pydicom>=0.9.5, <=0.9.8']

Modified: trunk/packages/dicompyler/trunk/debian/patches/series
===================================================================
--- trunk/packages/dicompyler/trunk/debian/patches/series	2014-09-11 09:25:05 UTC (rev 17988)
+++ trunk/packages/dicompyler/trunk/debian/patches/series	2014-09-11 10:02:52 UTC (rev 17989)
@@ -3,3 +3,4 @@
 wxpy30-more.patch
 enable_pydicom_0.9.8.patch
 allow_pillow_instead_of_pil.patch
+enable_later_versions_of_matplotlib.patch




More information about the debian-med-commit mailing list