Skip to content
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

annotations in multiple image window #202

Closed
bencardoen opened this issue Dec 20, 2019 · 5 comments · Fixed by #207
Closed

annotations in multiple image window #202

bencardoen opened this issue Dec 20, 2019 · 5 comments · Fixed by #207

Comments

@bencardoen
Copy link

Hi,

Thanks for making this great library available

I have a question I can't seem to get the answer to, when I combine multiple images in a window as demonstrated in the readme, I'm unable to use the returned 'guidict' object to annotate on.

using ImageView, TestImages, Gtk.ShortNames
grid, frames, canvases = canvasgrid((2,2))  # 2 row, 2 columns
imshow(canvases[1,1], imga)
imshow(canvases[1,2], imgb)
imshow(canvases[2,1], imgc)
gd = imshow(canvases[2,2], imgd)
idx = annotate!(gd, AnnotationBox(x, y, X, Y, linewidth=1, color=RGB(0,1,0))) // This fails
win = Window(grid)
Gtk.showall(win)

The error I get is :

KeyError: key "gui" not found

Stacktrace:
 [1] getindex at ./dict.jl:478 [inlined]
 [2] #annotate!#90(::Bool, ::Function, ::Dict{String,Any}, ::AnnotationBox) at /home/bcardoen/.julia/packages/ImageView/bEIAo/src/annotations.jl:6
 [3] annotate!(::Dict{String,Any}, ::AnnotationBox) at /home/bcardoen/.julia/packages/ImageView/bEIAo/src/annotations.jl:6
 [4] top-level scope at In[60]:1

I understand why, the returned dict has a different hierarchy not matching the one when I call imshow(img) (rather than passing in the canvas).

I can't seem to figure out how to resolve this, is it possible to annotate on the subcanvas (gd), and if so how? Apologies if this is documented somewhere.

Thanks!

@andyDoucette
Copy link

I would like to +1 this post. It's currently getting in the way of me giving each canvas an annotated "title" - something that is quite important if you're going to show 20 images at the same time. Can someone look into this please?

timholy added a commit that referenced this issue Jan 26, 2020
This adds a function `annotations()` to create an empty annotation Dict.
@timholy
Copy link
Member

timholy commented Jan 26, 2020

@bencardoen, sorry I didn't remember this, it arrived just as I was leaving for Christmas break. Thanks for poking at it a bit. Fixed in #207.

Can someone look into this please?

@andyDoucette, you could be that someone, this is open source after all. It's generally not nice to ask others to do unpaid work for you.

@andyDoucette
Copy link

Hey, thanks Tim! I really appreciate it. I hear you about being open source and anyone can fix things, with enough effort. It is a bit daunting to go into someone else's code and presume I know enough about everything to fix more than I break. Plus, i figure whoever wrote the initial code knows much more about it than I do, so there's some efficiency in the world if they're willing to take a shot at it first. That said, I do realize this is a thankless gig, so i want to extend my gratitude again. If you send us your PayPal address maybe we can buy you a 🍺.

@bencardoen
Copy link
Author

Thanks so much @timholy, your package has been a huge help in visualizing scientific imaging.
I'm learning Julia, so if you tag issues or make issues for things on your todo-list I can try to help out?

@timholy
Copy link
Member

timholy commented Jan 26, 2020

@andyDoucette, no worries, and no need for the 🍺 unless we meet at JuliaCon sometime,it would be more fun that way. Just pitch in where you can with documentation improvements or whatever seems feasible when you notice stuff.

@bencardoen, very kind offer! i should be better about tagging issues suitable for beginners. A number of packages have "road to 1.0" issues though a good number of those issues might be complicated. I don't know if you ever use filtering, but there's a list at JuliaImages/ImageFiltering.jl#142. Some of those are pretty nontrivial, the benchmarks item is a good one though.

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 a pull request may close this issue.

3 participants