https://github.com/JuliaImages/ImageBase.jl/pull/4/files#r691967154
Ideally, we should not dispatch on array type OffsetArray in
|
function restrict(A::OffsetArray{T,N}, dim::Integer) where {T,N} |
|
indsA = axes(A) |
|
newinds = map(UnitRange, ntuple(i->i==dim ? restrict_indices(indsA[dim]) : indsA[i], Val(N))) |
|
# By shifting it back to normal array, the internal for loop becomes faster because |
|
# it requires less indexing computation |
|
OffsetArray(restrict(A.parent, dim), newinds) |
|
end |
https://github.com/JuliaImages/ImageBase.jl/pull/4/files#r691967154
Ideally, we should not dispatch on array type
OffsetArrayinImageBase.jl/src/restrict.jl
Lines 137 to 143 in 9232149