Hey. I’m trying to work on julia’s EchogramImages library.
This is my error:
Error During Test at /home/pranjaliraturi/EchogramImages.jl/test/runtests.jl:6
Got exception outside of a @test
MethodError: no method matching imagesc(::Array{Float64,2}, ::Nothing, ::Nothing, ::Nothing)
Closest candidates are:
imagesc(::Any; vmin, vmax, cmap, size) at /home/pranjaliraturi/.julia/packages/EchogramImages/rVj6X/src/EchogramImages.jl:38
Stacktrace:
[1] top-level scope at /home/pranjaliraturi/EchogramImages.jl/test/runtests.jl:8
[2] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083
[3] top-level scope at /home/pranjaliraturi/EchogramImages.jl/test/runtests.jl:7
[4] include at ./boot.jl:326 [inlined]
[5] include_relative(::Module, ::String) at ./loading.jl:1038
[6] include(::Module, ::String) at ./sysimg.jl:29
[7] include(::String) at ./client.jl:403
[8] top-level scope at none:0
[9] eval(::Module, ::Any) at ./boot.jl:328
[10] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:85
[11] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:117 [inlined]
[12] (::getfield(REPL, Symbol(“##26#27”)){REPL.REPLBackend})() at ./task.jl:259
The following is my code:
using EchogramImages
using Test
using EchogramColorSchemes
using ColorSchemes
a = rand(100,100)
img = imagesc(a, nothing, nothing, nothing)
m,n = size(img)
@test m == 480
@test n == 640
@test cmap == cmap.colors
@test typeof(vmin) == AbstractFloat
@test typeof(vmax) == AbstractFloat
@test vmin <= @. img <= vmax
.
.
.
.
.
.
This is the function that was already created:
using Images
using MappedArrays
using IndirectArrays
using EchogramColorSchemes
using ColorSchemes
export imagesc, mat2gray, equalizedbins, quantize
“”"
imagesc(A; vmin = nothing, vmax = nothing, cmap= nothing, size=(480,640))
A is any numeric array
cmap can be a list of Colors or can come from EchogramColorSchemes.jl,
ColorSchemes.jl or PerceptualColourMaps.jl. The default nothing
currently means use EK80 colours.
Set size = nothing for full resolution.
vmin and vmax are minimum and maximum values.
“”"
function imagesc(A;
vmin = nothing,
vmax = nothing,
cmap= nothing,
size=(480,640))
if cmap == nothing
cmap = addwhite(EK80)
end
if isa(cmap,ColorScheme)
cmap = cmap.colors
end
.
.
.
.
.
end
I’m assuming it’s because I’m passing incompatible types in the function imagesc. However I assumed the function’s prototype from the function logic and my mentor was generous enough to give me a general idea of what was going on. Please let me know what’s up and I’ll try to fix it. All the help is appreciated!!