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
Matplotlib Image Figures #7
Comments
Hey Tim-Oliver @tibuch , that sounds awesome! Of course, your notebook is very welcome as PR, e.g. in that folder:
It looks well engineered and may of course be of interest to a broad audience. So yes, it would make sense to make it available on pypi. A potential alternative might be to send it as PR to @guiwitz' microfilm which has a similar purpose (and similar functionality) and is available on pypi already. Guillaume, what do you think? Best, |
It looks indeed like there's a lot of overlap with microfilm. The primary reason for making microfilm was the possibility of making multi-channel images à la Fiji, and I think that's missing from The nice thing in Also a general question for @haesleinhuepf: in many notebooks you use Cheers, |
I'm more and more using pyclesperanto's imshow because it supports showing 3D data and we mostly work in 3D. Its dependency towards OpenCL is a bit an issue. Anyway, matplotlibs imshow feels very clunky to me, especially when it comes to showing label images, blending them over raw data, using colorbars etc. See: https://haesleinhuepf.github.io/BioImageAnalysisNotebooks/15_gpu_acceleration/clesperanto.html#processing-images Note sure if proposing 3D/microscopy specific imshow functionality as PR to matplotlib or skimage is a way to go. Would it make sense to use microfilm instead @guiwitz ? |
By "showing 3D data" do you mean that you can pass a 3D array and the plotting function does a projection automatically for you, as done here: https://haesleinhuepf.github.io/BioImageAnalysisNotebooks/16_3d_image_visualization/10_nd_image_data.html#three-dimensional-image-stacks ? This is a great feature to allow people to quickly look at their images!
I agree with both points. Depending on OpenCL for potentially simply looking at images is too heavy. And regarding your second point, this is why I made microfilm: to avoid all the clunkiness of raw Matplotlib.
My impression is that Matplotlib want's to remain generalist and they sort of encourage the "building on top" approach that's used in pyclesperanto, microfilm or figure_utils.py. Regarding skimage, my impression from issue discussions is that they rather want to focus on algorithms and leave other areas like import, plotting etc. to other libraries (but I never contributed, so you may know better about this). Summary: I think it makes sense to have a "specialized" approach and I'm open to any reasonable solution. If you like microfilm I'm happy to add features to match some of pyclesperanto's. Currently I'm thinking of:
I think I will anyway add these features to microfilm as I like them. I'll leave it up to you to decide which solution you use in the end. I'm happy about any issue on microfilm to discuss API points (making a new function or adding options etc.) |
Hi @haesleinhuepf and @guiwitz, Thanks Robert for connecting us :) I did not know about microfilm! Looks very cool and I am happy to contribute to microfilm instead and then it might be interesting to get a microfilm example into this collection of BioImage Analysis Notebooks. I also made a function to merge single channel images into one: https://github.com/fmi-faim/py_course/blob/main/01-figures-in-python/figure_utils.py#L292. The main reason why I started this was to create figures where the images are scaled to have sufficient print-resolution: https://github.com/fmi-faim/py_course/blob/main/01-figures-in-python/figure_utils.py#L160 I have only glanced over microfilm so far, if you (@guiwitz) think that it makes sense to contribute the Cheers, |
Hi @tibuch, I think mostly microfilm should cover your needs. Regarding the output resolution, one can use the The main thing that I didn't implement is the inset which in the frame of microscopy can be really useful. If you want to try to integrate this into microfilm I'm happy to help. But I can also try to add the feature myself if you don't have time! Just to guide you: currently the image is implemented as a class called So for the inset case, one would have to:
Let me know what you think! |
Hi @guiwitz, The idea behind that function is to plot raw data at 300dpi. With the use-case that someone acquired an image with 2048x2048 pixels and wants to make a sharp figure. Then the figure should not be larger than 2048/300 * 2.54cm = 17cm squared on the poster. If it should be larger than that, one should use nearest neighbor interpolation to visualize pixels. I will try to add the insets to microfilm, but it will probably take a couple weeks Cheers, PS: I like the design choice that no object has to be created by the user! |
Hi Robert,
Super cool collection of notebooks!
One of my tasks is to teach users about bio-image analysis and I am in awe of the beauty of this collection. Thanks a lot for putting it together and making it publicly available. Instead of building my own collection I will totally use this and try to contribute where I can.
By coincidence one of the first things I did was a notebook and
figure_utils.py
that explains/helps users to plot their image data at a givenprint/display
resolution: https://github.com/fmi-faim/py_course/blob/main/01-figures-in-python/Figures.ipynbThe target audience would be users that want save results at a requested resolution with a scalebar for publications or posters.
I could find some plotting notebooks, but not one tackling this specific area. If you agree I would like to submit this work as a PR to the repo.
Currently the
figure_utils.py
is a standalone collection of utility functions not published via pip. Would you recommend to put it on pip?Best,
Tim-Oliver
PS: The license can be changed, currently it is MIT.
The text was updated successfully, but these errors were encountered: