Skip to content

Commit

Permalink
Merge pull request #24 from JuliaImages/teh/deps
Browse files Browse the repository at this point in the history
Fixes for removal of deprecations in ImageCore
  • Loading branch information
timholy authored Oct 27, 2017
2 parents 57471cc + eb4818b commit 3e9d83e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/ImageAxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export # types
TimeAxis,
StreamIndexStyle,
# functions
colordim,
data,
getindex!,
istimeaxis,
timeaxis,
Expand Down Expand Up @@ -131,15 +133,15 @@ using an axis for this purpose.
Note: if you want to recover information about the time axis, it is
generally better to use `timeaxis`.
"""
ImageCore.timedim{T,N}(img::AxisArray{T,N}) = _timedim(filter_time_axis(axes(img), ntuple(identity, Val{N})))
timedim{T,N}(img::AxisArray{T,N}) = _timedim(filter_time_axis(axes(img), ntuple(identity, Val{N})))
_timedim(dim::Tuple{Int}) = dim[1]
_timedim(::Tuple{}) = 0

ImageCore.nimages(img::AxisArray) = _nimages(timeaxis(img))
_nimages(::Void) = 1
_nimages(ax::Axis) = length(ax)

function ImageCore.colordim(img::AxisArray)
function colordim(img::AxisArray)
d = _colordim(1, axes(img))
d > ndims(img) ? 0 : d
end
Expand All @@ -158,6 +160,8 @@ ImageCore.spatialorder(img::AxisArray) = filter_space_axes(axes(img), axisnames(
ImageCore.size_spatial(img::AxisArray) = filter_space_axes(axes(img), size(img))
ImageCore.indices_spatial(img::AxisArray) = filter_space_axes(axes(img), indices(img))

data(img::AxisArray) = img.data

### Utilities for writing "simple algorithms" safely ###

# Check that the time dimension, if present, is last
Expand Down Expand Up @@ -382,7 +386,11 @@ _filter_time_axis(::Tuple{}, ::Tuple{}) = ()
# summary: print color types & fixed-point types compactly
function AxisArrays._summary{T<:Union{Fractional,Colorant},N}(io, A::AxisArray{T,N})
print(io, "$N-dimensional AxisArray{")
ImageCore.showcoloranttype(io, T)
if T<:Colorant
ColorTypes.colorant_string_with_eltype(io, T)
else
ColorTypes.showcoloranttype(io, T)
end
println(io, ",$N,...} with axes:")
end

Expand Down

0 comments on commit 3e9d83e

Please # to comment.