astrowidgets icon indicating copy to clipboard operation
astrowidgets copied to clipboard

Exploring reimplementation using bqplot

Open michiboo opened this issue 6 years ago • 8 comments

Today I spend some time to explore the possibility of using bqplot for implementation, image from FITS has to be convert to other standard format such as PNG, JPEG for it to work, my question is there better to convert FITS to these format?

My current way of converting it is using pillow.

michiboo avatar Mar 02 '19 15:03 michiboo

I think @mwcraig or @astrofrog would have to advise on the bqplot side. I think they use Qt mainly, but I am not sure. In the meantime, we ask for your patience.

pllim avatar Mar 04 '19 14:03 pllim

The bqplot implementation would probably use https://github.com/glue-viz/ipyastroimage as the Mark on the bqplot plot. That can take a numpy array, so I think we can avoid the conversion to another image format. I haven't had a chance to experiment much with https://github.com/glue-viz/ipyastroimage

I have a rough draft implementation of a really basic image viewer based on bqplot somewhere, will try to dig it up tomorrow.

mwcraig avatar Mar 07 '19 01:03 mwcraig

Hi, have you digged up the draft implementation? I would like to have a look! :)

michiboo avatar Mar 09 '19 10:03 michiboo

Found it, will upload soon (it had zero comments and didn't actually quite work 😮)

mwcraig avatar Mar 11 '19 02:03 mwcraig

Look in this, don't judge the code too harshly 😀

https://gist.github.com/mwcraig/303cfb6e3e970d137e91789245ff259d

You will need to change the image you are using, let me know if you need me to send an image.

mwcraig avatar Mar 11 '19 02:03 mwcraig

@mwcraig , what is the overlap with https://github.com/glue-viz/glue-jupyter ? Maarten seems to be involved in that too.

pllim avatar Mar 11 '19 14:03 pllim

@pllim -- not too much from what I understand.

Maarten developed ipyastroimage as a more astronomy-centric replacement for the Image mark in bqplot because they needed that for the jupyter version of glue. He released as a separate package so that we could use it also.

When I asked Tom R. about the api for astrowidgets his response was that glue didn't really have an API for images like that.

I don't think it makes much sense to do a ton of work on making new selection tools or trying to generate images with a bunch of linked plots, since glue is focusing on that.

I could see adding a glue-based image widget in the future and/or replacing whatever bqplot-based widget developed this summer with something from glue down the road. But my impression is that we would still need to do a fair bit of wrapping because the API here is so much different than what glue provides.

mwcraig avatar Mar 12 '19 12:03 mwcraig

Looks like they renamed ipyastroimage to bqplot-image-gl. I kinda went a slightly different route at #121 mainly because I forgot about this issue.

@mwcraig , I see that in your gist above, you had to do some Event hacking to get the cursor info. Do you think that will work inside the ImageWidget class or it has to be done inside the notebook itself?

pllim avatar Jan 29 '21 20:01 pllim