diff --git a/src/core.jl b/src/core.jl index 7d3870fd..5095a143 100644 --- a/src/core.jl +++ b/src/core.jl @@ -1294,6 +1294,8 @@ end permutedims{S<:AbstractString}(img::AbstractImage, pstr::Union{Vector{S}, Tuple{Vararg{S}}}, spatialprops::Vector = spatialproperties(img)) = permutedims(img, dimindexes(img, pstr...), spatialprops) +permutedims(A::AbstractArray, p) = permutedims(convert(Array, A), p) + function permutation_canonical(img) assert2d(img) p = spatialpermutation(spatialorder(Matrix), img) diff --git a/test/overlays.jl b/test/overlays.jl index 758f5fd4..5db14a22 100644 --- a/test/overlays.jl +++ b/test/overlays.jl @@ -64,4 +64,13 @@ facts("Overlay") do @fact isa(ovr, Images.Image) --> true @fact abs(ovr[1, 2] - RGB{Float32}(a[1, 2], b[1, 2], a[1, 2])) --> roughly(0, atol=1e-5) end + + context("permutation") do + L1 = convert(Image{Gray}, rand(Float32, 10,10)) + L2 = convert(Image{Gray}, rand(Float32, 10,10)) + L3 = convert(Image{Gray}, rand(Float32, 10,10)) + overlay = OverlayImage((L1, L2, L3), (colorant"red", colorant"blue", colorant"green"), ((0,1),(0,1),(0,1))) + permutedims(overlay, [2,1]) + permutedims(data(overlay), [2,1]) + end end