mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-28 22:54:02 +08:00
BUG: More Python3 fixes by Christoph Gohlke.
This commit is contained in:
@@ -12,7 +12,7 @@ Original author: Lee Kamentsky
|
||||
'''
|
||||
|
||||
import numpy as np
|
||||
import _ctmf
|
||||
from . import _ctmf
|
||||
from rank_order import rank_order
|
||||
|
||||
def median_filter(data, mask=None, radius=1, percent=50):
|
||||
@@ -59,7 +59,7 @@ def median_filter(data, mask=None, radius=1, percent=50):
|
||||
if max_ranked_data == 0:
|
||||
return data
|
||||
if max_ranked_data > 255:
|
||||
ranked_data = ranked_data * 255 / max_ranked_data
|
||||
ranked_data = ranked_data * 255 // max_ranked_data
|
||||
was_ranked = True
|
||||
else:
|
||||
ranked_data = data[mask]
|
||||
@@ -78,7 +78,7 @@ def median_filter(data, mask=None, radius=1, percent=50):
|
||||
# use the translation to look up the original value in the data.
|
||||
#
|
||||
if max_ranked_data > 255:
|
||||
result = translation[output.astype(np.uint32) * max_ranked_data / 255]
|
||||
result = translation[output.astype(np.uint32) * max_ranked_data // 255]
|
||||
else:
|
||||
result = translation[output]
|
||||
else:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from _mcp import MCP, MCP_Geometric, make_offsets
|
||||
from ._mcp import MCP, MCP_Geometric, make_offsets
|
||||
|
||||
def route_through_array(array, start, end, fully_connected=True, geometric=True):
|
||||
"""Simple example of how to use the MCP and MCP_Geometric classes.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import numpy as np
|
||||
import _spath
|
||||
from . import _spath
|
||||
|
||||
def shortest_path(arr, reach=1, axis=-1, output_indexlist=False):
|
||||
"""Find the shortest path through an n-d array from one side to another.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import numpy as np
|
||||
import _colormixer
|
||||
import _histograms
|
||||
from . import _colormixer
|
||||
from . import _histograms
|
||||
import threading
|
||||
|
||||
# utilities to make life easier for plugin writers.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import sys
|
||||
import os.path
|
||||
|
||||
import numpy as np
|
||||
@@ -7,6 +8,10 @@ from scikits.image import data_dir
|
||||
from scikits.image.io import ImageCollection, MultiImage
|
||||
|
||||
|
||||
if sys.version_info[0] > 2:
|
||||
basestring = str
|
||||
|
||||
|
||||
class TestImageCollection():
|
||||
pattern = [os.path.join(data_dir, pic) for pic in ['camera.png',
|
||||
'color.png']]
|
||||
|
||||
@@ -3,13 +3,18 @@
|
||||
from __future__ import with_statement
|
||||
|
||||
import os
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
import numpy as np
|
||||
from numpy.testing import *
|
||||
|
||||
from scikits.image import data_dir
|
||||
import cPickle
|
||||
|
||||
if sys.version_info[0] < 3:
|
||||
import cPickle
|
||||
else:
|
||||
import pickle as cPickle
|
||||
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore")
|
||||
|
||||
Reference in New Issue
Block a user