diff --git a/src/ImageAxes.jl b/src/ImageAxes.jl index c13b307..ac04ddd 100644 --- a/src/ImageAxes.jl +++ b/src/ImageAxes.jl @@ -27,6 +27,10 @@ export # types timeaxis, timedim +ImageCore.HasDimNames(::Type{A}) where {A<:AxisArray} = HasDimNames{true}() +ImageCore.namedaxes(a::AxisArray) = NamedTuple{axisnames(a)}(axisvalues(a)) +Base.names(a::AxisArray) = axisnames(a) + """ TimeAxis{Ax} diff --git a/test/runtests.jl b/test/runtests.jl index 5484c10..99ee04f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -145,6 +145,8 @@ end @test @inferred(size_spatial(M)) == (5, 4) assert_timedim_last(P) @test_throws ErrorException assert_timedim_last(M) + @test @inferred(HasDimNames(A)) == HasDimNames{true}() + @test @inferred(namedaxes(A)) == NamedTuple{axisnames(A)}(axisvalues(A)) end # Possibly-ambiguous functions