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

pyqt scatter widget #270

Merged
merged 102 commits into from
Dec 17, 2024
Merged

pyqt scatter widget #270

merged 102 commits into from
Dec 17, 2024

Conversation

fjorka
Copy link
Contributor

@fjorka fjorka commented Jul 11, 2024

Description

This PR introduces a complete Scatter Widget based on PyQtGraph, intended to replace the Matplotlib-based Scatter Widget.

Rationale

  • Expected improved performance for large datasets.
  • Smooth navigation for zooming and panning within the plot.
  • Increased flexibility in customization.

Functionality

  • It preserves all functionality of the previous widget.
  • Documentation notebooks updated with the information and screenshots of the new widget.
  • New functionality includes:
    • Separate color controls for continuous and discrete data:
      • Continuous color control offers:
        • Histogram of values chosen for color.
        • Ability to change LUT.
        • Control over contrast.
      • Discrete color control offers:
        • Scrollable legend of colors.
        • Ability to change the color for a selected class.
    • Pseudohistogram plot when only one axis is defined.
    • Highlight of nearby data points under cursor.
    • Dynamic status display of cursor position and highlighted data points.
    • Expanded ROI annotations:
      • Lasso or rectangle tool (useful for thresholding).
      • Ability to use several disjointed ROIs for annotation.
      • Modifiable ROIs.
    • Dialog to choose Annotation name (previously Export).
    • Saving options:
      • When started with AnnData, the Save button opens a path dialog to choose a location for an AnnData file (supports h5ad, zarr, and csv).
      • When opened with the Napari viewer, it mimics the behavior of the Annotation Widget:
        • With backed sdata, Save will modify sdata of the selected layer.
        • Without backed sdata, no saving action.
      • The widget displays the status and saving possibility when started.

Next Steps Beyond This PR

There were some "next steps"/"open points" here. I moved them to this issue #333 to make them more discoverable.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@fjorka fjorka marked this pull request as draft July 11, 2024 13:51
@fjorka
Copy link
Contributor Author

fjorka commented Aug 28, 2024

The notebooks start with the instruction:

There are two options to install napari-spatialdata:

(1) Run `pip install napari-spatialdata`
or,
(2) Clone this [repo](https://github.com/scverse/napari-spatialdata) and run `pip install -e .`

However, following this instruction and starting napari (or scatter widget) will give an error ImportError: No Qt bindings could be found. What about asking explicitly for napari installation first d40fb7c which will inform a user about Qt?

@fjorka
Copy link
Contributor Author

fjorka commented Aug 28, 2024

To do:

  • add explanations in scatterwidget.ipynb and scatterwidget_annotation.ipynb about starting with AnnData and options for saving

There were some "next steps"/"open points" here. I moved them to this issue #333 to make them more discoverable.

@LucaMarconato
Copy link
Member

LucaMarconato commented Sep 3, 2024

There were some "next steps"/"open points" here. I moved them to this issue #333 to make them more discoverable.

@LucaMarconato
Copy link
Member

Thanks @fjorka and @melonora, we finished reviewing and adjusting some last open points, and now we are good to merge!

Really excited to ultimately release this! We will include this PR in a release X.com post that we will make in the near future.

I will consolidate the points open for follow up PRs in a separate issue.

@LucaMarconato LucaMarconato merged commit a5191c7 into scverse:main Dec 17, 2024
9 checks passed
@LucaMarconato
Copy link
Member

@fjorka @melonora I forgot about this file https://github.com/fjorka/napari-spatialdata/blob/7d60e030aff750ee08fd874b8c6b6425ec5fff79/tests/test_aaa.py, which if I got it right, was a work-in-progress implementation for an alternative approach to span the test napari viewer, in order to avoid the segfault problem with Python 3.9. I think the problem have disappeared due to having dropped the Python 3.9 support. So please @melonora in the follow up PR can you drop that file? Thanks.

@LucaMarconato
Copy link
Member

Actually there is still a problem with tests, I reported it here #335 so we can continue the discussion there. CC @melonora

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

Successfully merging this pull request may close these issues.

4 participants