Skip to content

Commit

Permalink
Merge pull request #648 from JuliaImages/teh/elim_deprecations
Browse files Browse the repository at this point in the history
Eliminate old deprecations and require 0.6
  • Loading branch information
timholy authored Jul 13, 2017
2 parents 2f78e6b + e8f6b47 commit d1b6719
Show file tree
Hide file tree
Showing 23 changed files with 22 additions and 3,128 deletions.
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ os:
- osx
dist: trusty # for a more recent ImageMagick
julia:
- 0.5
- 0.6
- nightly
# matrix:
# allow_failures:
# - julia: nightly
matrix:
allow_failures:
- julia: nightly
notifications:
email: false
# script:
Expand Down
4 changes: 2 additions & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
julia 0.5
julia 0.6.0
Reexport
Colors 0.7.0
ColorVectorSpace 0.2
Expand All @@ -15,5 +15,5 @@ SIUnits
Graphics 0.1
FileIO
Compat 0.19
StatsBase # for histrange
StatsBase 0.14 # for histrange
Requires
9 changes: 7 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
environment:
matrix:
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"

## uncomment the following lines to allow failures on nightly julia
## (tests will run but not make your overall status red)
matrix:
allow_failures:
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"

branches:
only:
- master
Expand Down
4 changes: 0 additions & 4 deletions src/Images.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ using Base: depwarn
using Base.Order: Ordering, ForwardOrdering, ReverseOrdering

using Compat
import Compat.view

# "deprecated imports" are below

Expand Down Expand Up @@ -66,8 +65,6 @@ Indicate that `x` should be interpreted as a [percentile](https://en.wikipedia.o
"""
immutable Percentile{T} <: Real p::T end

include("map-deprecated.jl")
include("overlays-deprecated.jl")
include("labeledarrays.jl")
include("algorithms.jl")
include("exposure.jl")
Expand All @@ -79,7 +76,6 @@ include("corner.jl")
include("distances.jl")
include("bwdist.jl")
using .FeatureTransform
include("deprecated.jl")
include("convexhull.jl")

export # types
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ The base β of the logarithm (a.k.a. entropy unit) is one of the following:
"""
entropy(img::AbstractArray; kind=:shannon) = entropy(_log(kind), img)
function entropy{Log<:Function}(logᵦ::Log, img)
hist = StatsBase.fit(Histogram, vec(img), nbins=256)
hist = StatsBase.fit(Histogram, vec(img), nbins=256, closed=:right)
counts = hist.weights
p = counts / length(img)
logp = logᵦ.(p)
Expand Down
79 changes: 0 additions & 79 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
@@ -1,82 +1,3 @@
export
AbstractImage,
AbstractImageDirect,
AbstractImageIndexed,
Image,
LabeledArray,
Overlay,
OverlayImage,
BitShift,
ClampMin,
ClampMax,
ClampMinMax,
Clamp,
Clamp01NaN,
MapInfo,
MapNone,
ScaleAutoMinMax,
ScaleMinMax,
ScaleMinMaxNaN,
ScaleSigned,
SliceData

const yx = ["y", "x"]
const xy = ["x", "y"]

SliceData(args...) = error("SliceData has been removed, please use julia's regular indexing operations")
reslice!(args...) = error("reslice! has been removed, along with SliceData; please use julia's regular indexing operations")
rerange!(args...) = error("reslice! has been removed, along with SliceData; please use julia's regular indexing operations")

# These should have been deprecated long ago
@deprecate uint32color(img) immap(mapinfo(UInt32, img), img)
@deprecate uint32color!(buf, img::AbstractArray) map!(mapinfo(UInt32, img), buf, img)
@deprecate uint32color!(buf, img::AbstractArray, mi::MapInfo) map!(mi, buf, img)
@deprecate uint32color!{T,N}(buf::Array{UInt32,N}, img::AbstractArray{T,N}) map!(mapinfo(UInt32, img), buf, img)
@deprecate uint32color!{T,N,N1}(buf::Array{UInt32,N}, img::ChannelView{T,N1}) map!(mapinfo(UInt32, img), buf, img, Val{1})
@deprecate uint32color!{T,N}(buf::Array{UInt32,N}, img::AbstractArray{T,N}, mi::MapInfo) map!(mi, buf, img)
@deprecate uint32color!{T,N,N1}(buf::Array{UInt32,N}, img::ChannelView{T,N1}, mi::MapInfo) map!(mi, buf, img, Val{1})

@deprecate flipx(img) flipdim(img, 2)
@deprecate flipy(img) flipdim(img, 1)
@deprecate flipz(img) flipdim(img, 3)

@deprecate ando3 KernelFactors.ando3
@deprecate ando4 KernelFactors.ando3
@deprecate ando5 KernelFactors.ando3
@deprecate gaussian2d() Kernel.gaussian(0.5)
@deprecate gaussian2d::Number) Kernel.gaussian(σ)
@deprecate gaussian2d::Number, filter_size) Kernel.gaussian((σ,σ), (filter_size...,))
@deprecate imaverage KernelFactors.boxcar
@deprecate imdog Kernel.DoG
@deprecate imlog Kernel.LoG
@deprecate imlaplacian Kernel.Laplacian

@deprecate extremefilt!(A::AbstractArray, ::Base.Order.ForwardOrdering, region=coords_spatial(A)) extremefilt!(A, max, region)
@deprecate extremefilt!(A::AbstractArray, ::Base.Order.ReverseOrdering, region=coords_spatial(A)) extremefilt!(A, min, region)
@deprecate extremefilt!{C<:AbstractRGB}(A::AbstractArray{C}, ::Base.Order.ForwardOrdering, region=coords_spatial(A)) extremefilt!(A, (x,y)->mapc(max,x,y), region)
@deprecate extremefilt!{C<:AbstractRGB}(A::AbstractArray{C}, ::Base.Order.ReverseOrdering, region=coords_spatial(A)) extremefilt!(A, (x,y)->mapc(min,x,y), region)

function restrict{S<:String}(img::AbstractArray, region::Union{Tuple{String,Vararg{String}}, Vector{S}})
depwarn("restrict(img, strings) is deprecated, please use restrict(img, axes) with an AxisArray", :restrict)
so = spatialorder(img)
regioni = Int[]
for i = 1:length(region)
push!(regioni, require_dimindex(img, region[i], so))
end
restrict(img, regioni)
end

function magnitude_phase(img::AbstractArray, method::AbstractString, border::AbstractString="replicate")
f = ImageFiltering.kernelfunc_lookup(method)
depwarn("magnitude_phase(img, method::AbstractString, [border]) is deprecated, use magnitude_phase(img, $f, [border]) instead", :magnitude_phase)
magnitude_phase(img, f, border)
end

Base.@deprecate_binding LabeledArray ColorizedArray
@deprecate ColorizedArray{T,N}(intensity::AbstractArray{T,N}, label::AbstractArray, colors::Vector{RGB}) ColorizedArray(intensity, IndirectArray(label, colors))

@deprecate imcomplement(img::AbstractArray) complement.(img)

function canny{T<:NumberLike}(img_gray::AbstractMatrix{T}, sigma::Number = 1.4, upperThreshold::Number = 0.90, lowerThreshold::Number = 0.10; percentile::Bool = true)
depwarn("canny(img, sigma, $upperThreshold, $lowerThreshold; percentile=$percentile) is deprecated.\n Please use canny(img, ($upperThreshold, $lowerThreshold), sigma) or canny(img, (Percentile($(100*upperThreshold)), Percentile($(100*lowerThreshold))), sigma)",:canny)
if percentile
Expand Down
2 changes: 1 addition & 1 deletion src/edge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ function padindexes{T,n}(img::AbstractArray{T,n}, dim, prepad, postpad, border::
M = size(img, dim)
I = Vector{Int}(M + prepad + postpad)
I = [(1 - prepad):(M + postpad);]
@compat if border == "replicate"
if border == "replicate"
I = min.(max.(I, 1), M)
elseif border == "circular"
I = 1 .+ mod.(I .- 1, M)
Expand Down
2 changes: 1 addition & 1 deletion src/exposure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function _histmatch(img::AbstractArray, oedges::Range, ohist::AbstractArray{Int}
ocdf = cumsum(ohist)
norm_ocdf = ocdf / ocdf[end]
lookup_table = zeros(Int, length(norm_cdf))
@compat for I in eachindex(cdf)
for I in eachindex(cdf)
lookup_table[I] = indmin(abs.(norm_ocdf .- norm_cdf[I]))
end
hist_matched_img = similar(img)
Expand Down
Loading

0 comments on commit d1b6719

Please sign in to comment.