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

Improve bia-bob suggestions #60

Open
haesleinhuepf opened this issue Jul 16, 2024 · 3 comments
Open

Improve bia-bob suggestions #60

haesleinhuepf opened this issue Jul 16, 2024 · 3 comments

Comments

@haesleinhuepf
Copy link
Owner

For example, the alpha parameter of curtain would be useful, if bia-bob suggested it.

@haesleinhuepf
Copy link
Owner Author

Also stackview.crop deserves mentioning in bia-bob

@haesleinhuepf
Copy link
Owner Author

haesleinhuepf commented Aug 31, 2024

In this file, there are the suggestions we need to improve:

https://github.com/haesleinhuepf/stackview/blob/main/stackview/_bia_bob_plugins.py

It might be helpful to take some hints from this notebook:

https://github.com/haesleinhuepf/stackview/blob/main/docs/crop.ipynb

git-bob, think about how to improve stackview/_bia_bob_plugins.py

@haesleinhuepf
Copy link
Owner Author

This message was generated by git-bob (version: 0.2.4, model: gpt-4o-2024-08-06), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

To enhance bia-bob with additional suggestions as per the input files and comments, consider updating the list_bia_bob_plugins function in stackview/_bia_bob_plugins.py as follows:

def list_bia_bob_plugins():
    """List of function hints for bia_bob"""
    return """    * Displays an image with a slider and label showing mouse position and intensity.
    stackview.annotate(image, labels)
    
    * Allows cropping an image along all axes. Supports parameters like 'continuous_update', 'zoom_factor', 'slider_text', and 'axis_names'.
    stackview.crop(image, continuous_update=True, zoom_factor=0.75, slider_text="Slice", axis_names=["Z", "Y", "X"])
    
    * Showing an image stored in variable `image` and a segmented image stored in variable `labels` on top using an interative curtain. Also works with two images or two label images. Includes an 'alpha' parameter to set transparency of the curtain.
    stackview.curtain(image, labels, alpha=1)
    
    * Showing an image stored in variable `image` and a segmented image stored in variable `labels` on top with animated blending. Also works with two images or two label images.
    stackview.animate_curtain(image, labels)

    * Showing an animation / timelapse image stored in variable `image`.
    stackview.animate(image)
    
    * Save an animation / timelapse stored in variable `image` with specified frame delay to a file.
    stackview.animate(image, filename="output.gif", frame_delay_ms=100)
    
    * Display an image stored in a variable `image` (this also works with label images). Prefer stackview.insight over matplotlib.pyplot.imshow!
    stackview.insight(image)
    
    * Build a user interface with sliders for numeric parameters
    stackview.interact(func, image)
    
    * Display an image and allows slicing in three dimensions (Z, Y, and X).
    stackview.orthogonal(image)
    
    * Display an image with a slider and label showing the mouse position and intensity.
    stackview.picker(image)
    
    * Display two images side by side, with an additional overlay view of their overlap
    stackview.side_by_side(image1, image2)
    
    * Display an image with a slider to navigate through a stack.
    stackview.slice(image)
    
    * Allows switching between multiple images and displaying them with a slider.
    stackview.switch(images:list)
    
    * Allows plotting a scatterplot of a pandas dataframe while interactively choosing the columns and using a lasso tool for selecting data points
    stackview.scatterplot(dataframe, column_x, column_y, selection_column)
    
    * Allows plotting a scatterplot of a pandas dataframe in relation to a label image and optionally an image
    stackview.clusterplot(image=image, labels=label_image, df=dataframe, labels, column_x, column_y, selection_column, image)
    
    * Draw two connected scatterplots of a pandas dataframe in relation to a label image and optionally an image
    import ipywidgets as widgets
    from ipywidgets import HBox
    import stackview
    def update2(e=None):
        widget2.update()
    def update1(e=None):
        widget1.update()
    widget1 = stackview.scatterplot(df=dataframe, column_x="column1", column_y="column2", selection_changed_callback=update2)
    widget2 = stackview.scatterplot(df=dataframe, column_x="column3", column_y="column4", selection_changed_callback=update1)
    display(HBox([widget1, widget2])) # Arrange the widgets side by side using HBox
    """

This enhancement includes specific parameters and their descriptions for the stackview.crop and stackview.curtain functions, improving the usability of bia-bob for developers who leverage these functionalities.

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

No branches or pull requests

1 participant