Skip to content

Commit

Permalink
Speed up attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
RobBlackwell committed Apr 10, 2019
1 parent 3bd67f2 commit b5b4d48
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/EchogramImages.jl
Expand Up @@ -28,7 +28,7 @@ vmin and vmax are minimum and maximum values.
"""
function imagesc(A;
function imagesc(A::AbstractArray;
vmin = nothing,
vmax = nothing,
cmap= nothing,
Expand Down Expand Up @@ -63,7 +63,8 @@ function imagesc(A;
g = x -> (clamp(isnan(x) ? vmin : x, vmin, vmax) - vmin) / (vmax - vmin)
f = s->clamp(round(Int, (n-1)*g(s))+1, 1, n)

Ai = mappedarray(f, A) # like f.(A) but does not allocate significant memory
Ai = f.(A)
#Ai = mappedarray(f, A) # like f.(A) but does not allocate significant memory
IndirectArray(Ai, cmap) # colormap array

end
Expand Down

0 comments on commit b5b4d48

Please sign in to comment.