True-North-Intelligent-Algorithms / tnia-python

A collection of useful python utilities from True North Intelligent Algorithms
BSD 3-Clause "New" or "Revised" License
27 stars 1 forks source link

Adding features to the interactive viewer (multichannel and "slabs") #3

Open eigenP opened 1 month ago

eigenP commented 1 month ago

Hi Brian,

I have been playing around with your 3d plotting functions and added multi-channel support, and the thick "slab" projection, into your interactive (ipywidgets) function. I have made one incompatible change (adding a vmin kwarg), but otherwise I believe everything else plays nicely with what was already in there.

You can give it a quick try using this snippet: (e.g. on google colab)

!curl -O https://raw.githubusercontent.com/eigenP/utils/main/tnia_plotting_3d.py
from tnia_plotting_3d import show_xyz_max_slice_interactive

from skimage.data import cells3d

img_raw = cells3d()
membranes = img_raw[:,0,...]
nuclei = img_raw[:,1,...]

show_xyz_max_slice_interactive([membranes, nuclei],
                               gamma= [0.5, 1.0],
                               vmin = [0.05, 0.1],
                               vmax = [0.9, 1.],
                               sz = 1.0,
                               colors = ['limegreen', 'magenta'],
                               )

and the result should be this: Untitled

P.S. Lmk if it is bad policy to keep a copy of these functions in my repo

bnorthan commented 1 month ago

Hi @eigenP

Thanks for the contribution. This is really useful. I will test it a bit and then can merge it to the main repo shortly.

No problem keeping your own copy. It is licensed under the BSD license https://github.com/True-North-Intelligent-Algorithms/tnia-python. The only requirement is that you redistribute a copy of the license, if you redistribute a derivative work. I am honestly not too concerned about that (I am happy for anybody to use my open source code, any way they want and not too worried if the license is redistributed) however sometimes people do get concerned about it, so as a general practice it is good too check any open source repo for the license and follow the guidelines.

Brian