-
Notifications
You must be signed in to change notification settings - Fork 4
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
Ideas for dealing with multiple data types #1
Comments
Hi @MosGeo , I must admit, I also don't know how to solve these issues. I have the feeling it's an unsolved riddle in python and napari. As long as the tool still works for single channel 2D and 3D data, I will merge all pull-requests you send 🙂 |
Hi Mustafa @MosGeo , we have just released version 0.1.4 which now supports RGB images. Would you mind checking if it works for your use-case? Furthermore, I was wondering: You mentioned TCXYZS, what does the S stand for? Thanks! |
Hey Robert @haesleinhuepf I think S stands for scene. |
I am making a note that My first thought (especially for simplicity) is to crop in a for loop. Something like this:
If we move into larger datasets, we should consider setting up benchmarks to optimize slicing algorithms! |
So I just made something I have been working on public. It has Lots of features (cropping and masking, regular and irregular) Can you please check it out and let me know what you think. I still have not published it in pypi. Honestly, I don't want napari to have lots of "cropping" tools but I felt that my use case is different that I needed to start from scratch. https://github.com/MosGeo/napari-crop-and-mask
Might create some gifs later for illustrations of some of the features. I really like the irregular masking feature :) p.s. napari still does not like RGB images with nan values but cropping/masking works in terms of algorithms. |
Hi @MosGeo , Thanks for reaching out here to discuss these different implementations! I am also in favor of not having "repeated" tools here and there, especially in a same platform. So I gave it a quick trial in your plugin and it seems to work really well! It brings more functionalities that we have not implemented here yet, but are in our to-do list, like dask and in-place crop. I have two major comments that I list below, but overall I think, if you like and others too, we could reach an agreement to merge both implementations in a single thing and of course have you as author as well! So here comes my comments:
Sorry, I did not understand what you meant here. Let me know where you see these plugins going! Best, |
@zoccoler: Thanks! Inplace vs transform
Confusing and intimidating interface:
Core algorithms:The core.py file contains algorithms that does not rely on napari. It is just dask operations. So I am thinking this files (actually, a more organized one with better implementation) should be setting in another repo (dask-image https://github.com/dask/dask-image. @jni What do you think? Where I see this is going:
Do you think the two implementations should be merged to one? Do you see a path for that in terms of code (numpy vs dask)? |
Cropping, masking and interfaceI see! Masking and cropping could indeed be separated.
That's awesome! I think it would fit right in! Core algorithms and daskI think for now they could be kept here. If they are really generalizable and a feature of interest for dask, we could open an issue there and discuss. About whether to use dask or not, I think that could either be an option the user can set or an early check around the input (if it is a daskarray, process it as such, otherwise, do conventional numpy slicing). What do you think? Single repo
That would be cool and you could be a co-maintainer. Here, one main function does all the job for now. Maybe your interface would "just" need to call it (something similar to this line). Notice that the function here already does irregular cropping (not masking though) and that there is at least one user relying on it directly from code, so I would be careful about changing function names and input/output variables unless really necessary. |
@zoccoler so I modified things to make it clearer. Now, I have two widgets, one for cropping and one for masking. Advanced options are in QCollapsible so the two widgets are very clean now.
|
Hi @MosGeo , Cool! I just gave it a try and I love the new interface! In my opinion, the collapsible menus indeed made the interface much cleaner! How do you intend to proceed from here? |
I am starting to work on this functionality for my workflows. Initially, I was thinking of starting from your code and expanding on it and contribute it back and at the same time use it for myself. Now I hitting the first hurdle so I thought to get your opinion.
How should we deal with different data, specifically, I am trying to unify my workflows around dask arrays coming from aicsimageio. So the format for it is TCXYZS. I am not sure If we can generalize the cropping functionality to this format and the normal order of things that you have right now.
For dealing with RGB images, can we assume that the last index is a potential RGB, check if it is 3 and check "Is RGB" boolean by default. The user would be able to uncheck it. If it is checked, it would be easy to exclude it from the cropping.
The text was updated successfully, but these errors were encountered: