-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Value range determined from whole volume, not first slice #261
base: master
Are you sure you want to change the base?
Conversation
I agree this would improve some things, but I also worry about the case where the first volume might have ~1000 slices: julia> using ImageView, BenchmarkTools
julia> a = rand(2048, 2048);
julia> @btime ImageView.default_clim($a)
18.510 ms (2 allocations: 128 bytes)
Observable{CLim{Float64}} with 0 listeners. Value:
CLim{Float64}(3.144755991169035e-7, 0.9999997443110233) Now multiply that by 1000 and you have 18s. Is it really worth that amount of time? Is there something else we could do instead? |
Hi Tim, sorry for taking so long to get back to you! |
…e efficiently. Allowed RGB arrays to be multi-dimensional instead of matrix only.
src/ImageView.jl
Outdated
elseif minval == maxval | ||
function fast_finite_extrema(a::AbstractArray) | ||
mini = a[1] | ||
maxi = a[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if a[1]
isn't finite?
I think we still might want to limit the number of points considered, e.g., if we've checked more than 10^8 points then I think we'd be safe. But otherwise I like this solution. |
…it of values to be checked.
….jl exports in previous commits
Done! :) |
Is this ok to merge? |
Hi,
this is a useful tool, thanks for developing it!
One minor improvement would be that the value range of grey scale volumes is computed over the whole volume instead of over the first slice.
Cheers,
Felix