Skip to content

Include simshow function#56

Merged
johnnychen94 merged 10 commits intoJuliaImages:masterfrom
roflmaostc:more_features
Feb 20, 2023
Merged

Include simshow function#56
johnnychen94 merged 10 commits intoJuliaImages:masterfrom
roflmaostc:more_features

Conversation

@roflmaostc
Copy link
Copy Markdown
Member

@roflmaostc roflmaostc commented Nov 11, 2022

As discussed in #55

Would be happy to receive feedback :)

Right now it basically displays only 2D arrays.

I think it would be nice to have the option for 3D arrays to be shown as RGB, if possible.

For other 3D arrays I think we can just error because simshow is not a fully fledged viewer but instead a simple viewer for inline displays of arrays

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 11, 2022

Codecov Report

Base: 87.98% // Head: 88.32% // Increases project coverage by +0.34% 🎉

Coverage data is based on head (e0f6073) compared to base (245e0e4).
Patch coverage: 91.30% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #56      +/-   ##
==========================================
+ Coverage   87.98%   88.32%   +0.34%     
==========================================
  Files           6        7       +1     
  Lines         233      257      +24     
==========================================
+ Hits          205      227      +22     
- Misses         28       30       +2     
Impacted Files Coverage Δ
src/ImageShow.jl 50.00% <ø> (+50.00%) ⬆️
src/simshow.jl 91.30% <91.30%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@johnnychen94
Copy link
Copy Markdown
Member

johnnychen94 commented Nov 28, 2022

@tlnagy do you happen to have some suggestion/feedback on this? For instance, does this function suits your need for #41?

@roflmaostc
Copy link
Copy Markdown
Member Author

Hi!
Just wanted to ping this again :)

@tlnagy
Copy link
Copy Markdown

tlnagy commented Feb 5, 2023

Sorry for the delay @roflmaostc, but this looks a nifty and it works on my end:
image

It would be great if you add support for signed fixed point numbers (as discussed in #41 like @johnnychen94 mentioned), which currently have the awful behavior of:

image

I think something simple like subtyping on Gray{<: Fixed} and then centering the display at 0 (similar to the functions you already have implemented) would be fantastic.

@roflmaostc
Copy link
Copy Markdown
Member Author

Thank, I'll try to look into it!

I probably remove the parameter f inside simshow because it's rather useless.

@roflmaostc
Copy link
Copy Markdown
Member Author

@tlnagy do we introduce a new dependency for the FixedPointNumbers.jl?

@johnnychen94
Copy link
Copy Markdown
Member

FixedPointNumbers and Colors are always included as long as ImageCore is loaded https://github.com/JuliaImages/ImageCore.jl/blob/fc9ac05630ac07876963d412a295fade46e0094e/src/ImageCore.jl#L4-L6

@roflmaostc
Copy link
Copy Markdown
Member Author

Would it be OK to convert the FixedPointNumbers to Float for displaying it?

Error such this occur:

rgumentError: FixedPointNumbers.Q0f7 is an 8-bit type representing 256 values from -1.0 to 0.992; cannot represent 1

What should I do in this case? Even the operation arr = set_zero ? arr .- minimum(arr) : arr can't be represented in FixedPointNumbers in some cases.

So think I can't recycle the other functionalities very well (how would a gamma work?).

Is something like this ok?

 function simshow(arr::AbstractArray{Colors.Gray{T}}) where {T<:Fixed}
     return simshow(Array{Gray{Float64}}(arr))
 end

Copy link
Copy Markdown
Member

@johnnychen94 johnnychen94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a new function with no compatibility consideration, I'm fully supportive on merging this and giving it a try. But before merging I hope @tlnagy shares some comments on if this supports his usage (especially on how FixedPointNumbers are handled) -- I hope this function can be used by more people and not just one or two.

Co-authored-by: Johnny Chen <johnnychen94@hotmail.com>
@roflmaostc
Copy link
Copy Markdown
Member Author

What's the state of it?

I really use that every day and need to copy paste it all the time 😆

@johnnychen94
Copy link
Copy Markdown
Member

johnnychen94 commented Feb 20, 2023

I was waiting for more people involved because I'm not so active here these days; nevertheless, let's merge this and give it a try since it's a greenfield implementation, and I don't see it harmful to the existing codebase.

@johnnychen94 johnnychen94 merged commit 59fb11d into JuliaImages:master Feb 20, 2023
@roflmaostc
Copy link
Copy Markdown
Member Author

Should we advertise it a little more, like in: https://github.com/roflmaostc/SimpleImageView.jl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants