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 axis labels to display() #1682

Merged
merged 4 commits into from
Dec 3, 2019
Merged

add axis labels to display() #1682

merged 4 commits into from
Dec 3, 2019

Conversation

kevinyamauchi
Copy link
Collaborator

Description

This PR adds axis labels to starfish.display() using the recently-added labeled axis support in napari (thanks, @HagaiHargil !).

Approach

I added the axis_labels keyword argument to the Viewer constructor in _display.py.

Question

Currently, I just create a list of the Axes Enum values. Is there a better way to do this? Maybe get the axes from the stack?

Testing:

I downloaded and viewed the test data from the ISS example notebook.

@ttung
Copy link
Collaborator

ttung commented Dec 2, 2019

Do we need to upgrade the napari version pin?

@kevinyamauchi
Copy link
Collaborator Author

@ttung, yeah we would need to bump to napari 0.2.6. I changed the constant in _display(). Where is the version pinned for pip install starfish[napari]? I am in the process of updating the docstrings.

@codecov-io
Copy link

codecov-io commented Dec 2, 2019

Codecov Report

Merging #1682 into master will decrease coverage by 0.09%.
The diff coverage is 16.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #1682     +/-   ##
=========================================
- Coverage   90.24%   90.15%   -0.1%     
=========================================
  Files         230      230             
  Lines        8745     8755     +10     
=========================================
+ Hits         7892     7893      +1     
- Misses        853      862      +9
Impacted Files Coverage Δ
starfish/core/_display.py 21.35% <16.66%> (-1.23%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0324fbd...7aba7a7. Read the comment docs.

@kevinyamauchi
Copy link
Collaborator Author

@ttung, if I read setup.py correctly, the napari version comes from the _display.py, so I think we are good there. I just updated the display() docstring.

Comment on lines 231 to 233
Axes.ROUND.value,
Axes.CH.value,
Axes.ZPLANE.value,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would grab these three from starfish/core/imagestack/dataorder.py

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will do!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ttung , it looks like AXES_DATA contains names and orders for round, channel, and z, but not x and y. Should I just assume (y, 3) and (x, 4)? Or is the axis ordering for y and x stored elsewhere?

Copy link
Collaborator Author

@kevinyamauchi kevinyamauchi Dec 2, 2019

Choose a reason for hiding this comment

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

(you can rotate views in napari, so the y and x axis names may get displayed)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Unfortunately, Y and X are not stored anywhere. It has always been assumed Y then X.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ttung, I changed it such that the axis order comes from starfish.core.imagestack.dataorder.

@kevinyamauchi kevinyamauchi requested a review from ttung December 2, 2019 23:17
@ttung ttung merged commit ff43229 into master Dec 3, 2019
@ttung ttung deleted the ky-add-viewer-axis-labels branch December 3, 2019 05:37
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.

3 participants