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

Add a new button to import an existing layers from other plugins #74

Merged
merged 9 commits into from
Apr 25, 2023

Conversation

adamltyson
Copy link
Member

@adamltyson adamltyson commented Mar 15, 2023

Description

There's now a good number of segmentation plugins in napari. Following a conversation with @SaraMederos, it seems like a good idea to be able to "import" these results into brainreg-segment so that they can be analysed in the context of the atlas.
What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

What does this PR do?

  • Adds a Add region from selected layer to the region segmentation panel that will add the selected layer (e.g. from a segmentation plugin) to the list of layers to be analysed.

  • Adds a Add track from selected layer to the track segmentation panel that will add the selected layer (e.g. from another plugin) to the list of layers to be analysed.

References

Closes #73

How has this PR been tested?

No automated tests yet, as all the tests are broken in some way.

Is this a breaking change?

No

Does this PR require an update to the documentation?

Yes, it will, not added yet though.

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality (unit & integration)
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@adamltyson adamltyson marked this pull request as draft March 15, 2023 17:50
@adamltyson
Copy link
Member Author

Converted to draft as I'd like to get some feedback on the tool from a user POV, and also add similar functionality for tracks.

@adamltyson
Copy link
Member Author

Also need to add tests

@adamltyson adamltyson requested a review from a team March 15, 2023 17:51
@deprecated-napari-hub-preview-bot
Copy link

Preview page for your plugin is ready here:
https://preview.napari-hub.org/brainglobe/brainreg-segment/74
Updated: 2023-04-25T10:48:19.241060

@codecov
Copy link

codecov bot commented Mar 15, 2023

Codecov Report

Patch coverage: 78.12% and project coverage change: +0.61 🎉

Comparison is base (d0bfd87) 59.86% compared to head (ed2d4c0) 60.48%.

❗ Current head ed2d4c0 differs from pull request most recent head 5a09d31. Consider uploading reports for the commit 5a09d31 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #74      +/-   ##
==========================================
+ Coverage   59.86%   60.48%   +0.61%     
==========================================
  Files          20       20              
  Lines         887      916      +29     
==========================================
+ Hits          531      554      +23     
- Misses        356      362       +6     
Impacted Files Coverage Δ
brainreg_segment/layout/utils.py 37.50% <50.00%> (+4.16%) ⬆️
brainreg_segment/segmentation_panels/tracks.py 83.83% <75.00%> (-1.39%) ⬇️
brainreg_segment/segmentation_panels/regions.py 76.92% <78.57%> (-0.86%) ⬇️
brainreg_segment/regions/layers.py 100.00% <100.00%> (ø)
brainreg_segment/tracks/layers.py 100.00% <100.00%> (ø)

... and 5 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@adamltyson
Copy link
Member Author

Moved the test changes from this branch into #77

@adamltyson adamltyson changed the title Add a new button to import an existing region segmented using another plugin Add a new button to import an existing layers from other plugins Mar 16, 2023
@adamltyson adamltyson marked this pull request as ready for review March 16, 2023 16:45
Copy link
Member

@dstansby dstansby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three major comments:

  • See inline comments, I think worth checking the layer type and erroring when adding the existing layers in the functions that do the adding.
  • I can't get any of the info boxes to pop up, even when trying to add a layer that is the wrong type. Not sure what the best way to debug this is though...
  • This could really do with some user facing docs, but I guess we don't have anywhere to put them right now? Perhaps a simple markdown file with a short "how to import existing layers" section could be started, and then when a proper doc structure is added to the repo it can be migrated there.

brainreg_segment/regions/layers.py Outdated Show resolved Hide resolved
brainreg_segment/regions/layers.py Outdated Show resolved Hide resolved
brainreg_segment/tracks/layers.py Outdated Show resolved Hide resolved
@SaraMederos

This comment was marked as off-topic.

@adamltyson
Copy link
Member Author

Thanks @dstansby I've addressed these issues. I'll document this feature in the new docs site before the new version is released. @SaraMederos is also kindly developing a tutorial from the researchers point of view.

Copy link
Member

@dstansby dstansby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't checked this works as intended, but I have smoke checked it and the info boxes seem to be working now 👍

@dstansby dstansby merged commit 0b20454 into main Apr 25, 2023
11 checks passed
@dstansby dstansby deleted the import branch April 25, 2023 12:49
@adamltyson adamltyson mentioned this pull request Jun 27, 2023
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.

Allow structures segmented within napari layers from external tools to be analysed
3 participants