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

Move images to _static folder #483

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_logo = "images/logo.png"
html_logo = "_static/images/logo.png"
html_sourcelink_suffix = ''
html_title = 'napari'

Expand Down Expand Up @@ -301,7 +301,7 @@ def napari_scraper(block, block_vars, gallery_conf):
'gallery_dirs': 'gallery', # path to where to save gallery generated output
'filename_pattern': '/*.py',
'ignore_pattern': 'README.rst|/*_.py',
'default_thumb_file': Path(__file__).parent / 'images' / 'logo.png',
'default_thumb_file': Path(__file__).parent / '_static' / 'images' / 'logo.png',
'plot_gallery': "'True'", # https://github.com/sphinx-gallery/sphinx-gallery/pull/304/files
'download_all_examples': False,
'min_reported_time': 10,
Expand Down
8 changes: 4 additions & 4 deletions docs/developers/contributing/documentation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,22 +397,22 @@ you will only be able to preview the documentation on CircleCI.
Simply click on **Details** next to the `Check the rendered docs here!` at the bottom
of your pull request:

![CircleCI check is highlighted](images/circleci-link.png)
![CircleCI check is highlighted](../../../_static/images/circleci-link.png)

#### Download documentation artifact

1. Click on **Details** next to
`Build & Deploy PR Docs / Build & Upload Artifact (pull_request)`:

![The "Build & Deploy PR Docs / Build & Upload Artifact" check is highlighted](images/doc-ci-1.png)
![The "Build & Deploy PR Docs / Build & Upload Artifact" check is highlighted](../../../_static/images/doc-ci-1.png)

2. Click on **Summary** on the top left corner:

![Summary link in the "Build & Deploy PR Docs / Build & Uplod Artifact" GitHub Action page](images/doc-ci-2.png)
![Summary link in the "Build & Deploy PR Docs / Build & Uplod Artifact" GitHub Action page](../../../_static/images/doc-ci-2.png)

3. Scroll down to **Artifacts** and click on **html** to download the built documentation:

!["html" link in the Artifacts section of the "Build & Deploy PR Docs / Build & Uplod Artifact" GitHub Action page is highlighted](images/doc-ci-3.png)
!["html" link in the Artifacts section of the "Build & Deploy PR Docs / Build & Uplod Artifact" GitHub Action page is highlighted](../../../_static/images/doc-ci-3.png)

4. Extract the compressed archive and open the `html/index.html` file on your preferred browser.
You can also use Python's `http.server` module to open a local server on
Expand Down
2 changes: 1 addition & 1 deletion docs/developers/contributing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ much as we can with unit tests, requiring fewer integration tests, and the least
of functional tests as depicted in the test pyramid below from
[softwaretestinghelp.com](https://www.softwaretestinghelp.com/the-difference-between-unit-integration-and-functional-testing/):

![Pyramid diagram depicting the relationship between time to write/execute three different types of tests and return on investment for those tests. The pyramid is split into three sections: the bottom, largest section is Unit testing, the middle section is Integration testing and the top is Functional testing. The size of the section is proportional to the quantity of tests of that type you should write. Moving up the pyramid, tests take longer to write and have a lower return on investment.](../../images/tests.png)
![Pyramid diagram depicting the relationship between time to write/execute three different types of tests and return on investment for those tests. The pyramid is split into three sections: the bottom, largest section is Unit testing, the middle section is Integration testing and the top is Functional testing. The size of the section is proportional to the quantity of tests of that type you should write. Moving up the pyramid, tests take longer to write and have a lower return on investment.](../../_static/images/tests.png)

Unit tests are at the base of the pyramid because they are the easiest to write and
the quickest to run. The time and effort to implement and maintain tests increases
Expand Down
12 changes: 6 additions & 6 deletions docs/developers/coredev/maintenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ The token should be named `GHA_TOKEN` and the required permissions are:
* **read and write** to pull requests
* **read and write** to code

![screenshot of token permissions in GitHub UI](../../images/update_token_permissions.png)
![screenshot of token permissions in GitHub UI](../../_static/images/update_token_permissions.png)

At the moment of writing this document, there is a difference in names between the summary of the token and the list of permissions.
The **code** permission is called **Contents** in the Edit view of the token.

![screenshot of token permissions](../../images/edit_token_permissions.png)
![screenshot of token permissions](../../_static/images/edit_token_permissions.png)

## Refreshing the token

To create a new token, go to the personal settings page and select _Developer settings_ at the bottom of the left menu. On the visible screen, expand the _Personal access tokens_ section and click the _Fine-grained token_ link.

![View on list of fine-grained tokens](../../images/fine_grained_token.png)
![View on list of fine-grained tokens](../../_static/images/fine_grained_token.png)

Then click the _Generate new token_ button in the upper right corner.

Expand All @@ -48,19 +48,19 @@ Fill the form:
4. Select **napari** to be the resource owner
5. Select _Only selected repositories_ and then select **napari/napari** repository

![screenshot of the token creation form](../../images/token_permission_form.png)
![screenshot of the token creation form](../../_static/images/token_permission_form.png)

6. Select the required permissions for repository metadata, pull requests, and code (contents)

![screenshot of the token creation form](../../images/token_permission_selection.png)
![screenshot of the token creation form](../../_static/images/token_permission_selection.png)

7. Click the _Generate token_ button
8. Copy token
9. Go to the napari repository settings
10. Expand the _Secrets and variables_ section and select _Actions_
11. Click the edit button for the `GHA_TOKEN` secret

![screenshot of the token creation form](../../images/secrets_section.png)
![screenshot of the token creation form](../../_static/images/secrets_section.png)

12. Paste a new token to the value field

Expand Down
6 changes: 3 additions & 3 deletions docs/guides/3D_interactivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
## Coordinate systems in napari
In napari, there are three main coordinate systems: (1) canvas, (2) world, and (3) layer. The canvas coordinates system is the 2D coordinate system of the canvas on which the scene is rendered. World coordinates are the nD coordinates of the entire scene. As the name suggests, layer coordinates are the nD coordinate system of the data in a given layer. Layer coordinates are specific to each layer's data and are related to the world coordinate system via the layer transforms.

![A diagram of the coordinate systems and components involved when interacting with layers in napari. The camera faces the 3D scene to generate a 2D image that is presented on the canvas.](images/3d_interaction_coordianates.png)
![A diagram of the coordinate systems and components involved when interacting with layers in napari. The camera faces the 3D scene to generate a 2D image that is presented on the canvas.](../_static/images/3d_interaction_coordianates.png)

## In 3D mode, clicks are lines
Since the 3D scene is rendered on a 2D surface (your screen), your mouse click does not map to a specific point in space. As the view is a [parallel projection](https://en.wikipedia.org/wiki/Parallel_projection), napari can determine a line through 3D space that intersects the canvas where the user clicked.

![A diagram that shows how clicking on a 2D position on the canvas corresponds to a 3D click line in the scene that starts from the 3D camera position.](images/3d_interaction_click_line.png)
![A diagram that shows how clicking on a 2D position on the canvas corresponds to a 3D click line in the scene that starts from the 3D camera position.](../_static/images/3d_interaction_click_line.png)

When a user clicks or moves the mouse in the canvas, napari emits a mouse event with the following properties:

Expand All @@ -25,7 +25,7 @@ When a user clicks or moves the mouse in the canvas, napari emits a mouse event
## Determining where the click intersects the data
Each napari layer has a method called `get_ray_intersections()` that will return the points on the data bounding box that a given line will intersect (`start_point ` and `end_point `). When the click line (`view_direction`) and position (`position`) are used as inputs, `start_point` and `end_point` are the end points of the segment click line that intersects the layer's axis-alinged data bounding box. `start_point` is the end point that is closest to the camera (i.e, the "first" intersection) and `end_point` is the end point that is farthest from the camera (i.e., the "last" intersection). You can use the line segment between `start_point` and `end_point` to interrogate the layer data that is "under" your cursor.

![A diagram that shows how the 3D click line starting from the camera position intersects with the 3D bounding box associated with a layer's data. There are two intersection points. A start point, which is the first intersection point, and the end point which is the second.](images/3d_interaction_ray_intersection.png)
![A diagram that shows how the 3D click line starting from the camera position intersects with the 3D bounding box associated with a layer's data. There are two intersection points. A start point, which is the first intersection point, and the end point which is the second.](../_static/images/3d_interaction_ray_intersection.png)

See the `get_ray_intersection()` docstrings below for details. Note that if the line does not intersect the data bounding box (i.e., the click was outside of the data), `start_point` and `end_point` are `None`. The `position` and `view_direction` should be provided as world coordinates if `world` is set to True and in layer coordinates if `world` is set to `False`.

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/contexts_expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Out[15]: False
But unlike a simple string, they can also provide type hinting, linting
capabilities, and IDE autocompletion (for napari developers).

![An IDE showing a type hint for an attribute of the LayerListContextKeys class.](images/context_type_hint.png)
![An IDE showing a type hint for an attribute of the LayerListContextKeys class.](../_static/images/context_type_hint.png)

A record of all registered context keys can be retrieved with the class method
`ContextKey.info()`
Expand Down
8 changes: 4 additions & 4 deletions docs/guides/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ with the layer from the viewer. These modes are accessible via the layer control
widget top buttons and via keyboard shortcuts (these shortcuts will vary depending on the layer type). Currently, there are two base modes:

* Pan and zoom
![image: Pan/zoom](../images/pan-zoom-tool.png)
![image: Pan/zoom](../_static/images/pan-zoom-tool.png)

The `pan_zoom` mode allows you to pan around and zoom in/out the layer. It's
the default mode selected. Note: zooming with the mouse-wheel should essentially always work!

* Transform
![image: Transform](../images/transform-tool.png)
![image: Transform](../_static/images/transform-tool.png)

The `transform` mode allows you to translate, rotate, and scale the layer
graphically. Note: While you can transform 3D layers, at present this mode is only usable in 2D viewer display mode.
Expand Down Expand Up @@ -106,7 +106,7 @@ other layers.

For example, the image below shows an image with the blending set to `additive`.

![napari viewer with an image of a cell. Layer controls are open in the left sidebar with the blending set to additive.](./images/blending.png)
![napari viewer with an image of a cell. Layer controls are open in the left sidebar with the blending set to additive.](../_static/images/blending.png)

## 3D rendering of images

Expand Down Expand Up @@ -154,7 +154,7 @@ distances from the camera according to a maximum intensity projection to create
the 2D image that is then displayed on the screen. This mode works well for many
biological images such as these cells growing in culture:

![napari viewer with an image of cells in a culture. Layer controls are open in the left sidebar and rendering set to mip.](./images/rendering.png)
![napari viewer with an image of cells in a culture. Layer controls are open in the left sidebar and rendering set to mip.](../_static/images/rendering.png)

When viewing 2D slices the rendering mode has no effect.

Expand Down
4 changes: 2 additions & 2 deletions docs/howtos/layers/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ sample image of your choice.

### Buttons

* `Pan/zoom` ![image: Pan/zoom tool](../../images/pan-zoom-tool.png) is the default mode
* `Pan/zoom` ![image: Pan/zoom tool](../../_static/images/pan-zoom-tool.png) is the default mode
of the layer and supports panning and zooming. Press the `1` key when the layer is selected
to use this mode.

* `Transform` ![image: Transform](../../images/transform-tool.png) enables you to
* `Transform` ![image: Transform](../../_static/images/transform-tool.png) enables you to
rotate, scale, or translate the layer. Note: at present this feature is limited to 2D viewer display mode.
To reset the transformation,
you can Option/Alt-click the transform button (a confirmation dialog will open to
Expand Down
8 changes: 4 additions & 4 deletions docs/howtos/layers/labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ layer:

Use this tool to manually erase a label on the `labels layer`. Other layers
will not be affected. The label eraser tool looks like this:
![image: eraser tool](../../images/labels-layer-eraser.png)
![image: eraser tool](../../_static/images/labels-layer-eraser.png)

* **Paintbrush**

Expand Down Expand Up @@ -260,7 +260,7 @@ mode by pressing the `6` key when the `labels layer` is selected.

### Transform mode

This mode is represented by ![image: Transform](../../images/transform-tool.png) in the
This mode is represented by ![image: Transform](../../_static/images/transform-tool.png) in the
`layer controls` panel. It enables you to rotate, scale, or translate the layer.
Note: at present this feature is limited to 2D viewer display mode.
To reset the transformation, you can Option/Alt-click the transform button (a
Expand Down Expand Up @@ -512,8 +512,8 @@ where the data is represented as a multiscale image is not editable.

All layers can be rendered in both 2D and 3D. One of the viewer buttons at the
bottom of the left panel can toggle between these 2 modes.
When in 2D, the button looks like this: ![image: 2D/3D button](../../images/3D-button.png), ready to switch to 3D mode.
When in 3D, the button looks like this: ![image: 2D/3D button](../../images/2D-button.png), ready to switch to 2D mode.
When in 2D, the button looks like this: ![image: 2D/3D button](../../_static/images/3D-button.png), ready to switch to 3D mode.
When in 3D, the button looks like this: ![image: 2D/3D button](../../_static/images/2D-button.png), ready to switch to 2D mode.

The number of dimensions sliders will be 2 or 3 less than the total number of
dimensions of the layer, allowing you to browse volumetric timeseries data and
Expand Down
14 changes: 7 additions & 7 deletions docs/howtos/layers/points.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ layer:
### Buttons

* **Deleting points**
![image: Delete points tool](../../images/point-deleting-tool.png)
![image: Delete points tool](../../_static/images/point-deleting-tool.png)

Points can be deleted after they have been selected. First select the point or
points to delete, then click on the `delete` button in the `layer controls`
panel or press the delete key on your keyboard.

* **Adding points**
![image: Add points tool](../../images/point-adding-tool.png)
![image: Add points tool](../../_static/images/point-adding-tool.png)

New points can be added using the point adding tool, shown above, from the
layer controls panel. Points can then be added by clicking in the canvas.
Expand All @@ -102,7 +102,7 @@ layer:
select all points in a layer and the *deselect* points from a slice.

* **Selecting points**
![image: Select points tool](../../images/point-selecting-tool.png)
![image: Select points tool](../../_static/images/point-selecting-tool.png)

Select a point using the tool (shown above) and then clicking on that point.
You can select multiple points by continuing to shift+click on additional
Expand All @@ -117,7 +117,7 @@ layer:
to move around the `points` layer as you create your selection.

* **Pan/zoom**
![image: Pan/zoom tool](../../images/pan-zoom-tool.png)
![image: Pan/zoom tool](../../_static/images/pan-zoom-tool.png)

The default mode of the points layer supports panning and zooming, as in the
image layer. This mode is represented by the magnifying glass in the layers
Expand All @@ -127,7 +127,7 @@ layer:
pan and zoom mode by pressing the `4` key when the points layer is selected.

* **Transform**
![image: Transform](../../images/transform-tool.png)
![image: Transform](../../_static/images/transform-tool.png)

Use this tool to rotate, scale, or translate the layer.
Note: at present this feature is limited to 2D viewer display mode. To reset the transformation,
Expand Down Expand Up @@ -197,8 +197,8 @@ layer:

All layers can be rendered in both 2D and 3D. The `Toggle ndisplay` button at
the bottom of the left panel toggles between these 2 modes.
When in 2D, the button looks like this: ![image: 2D/3D button](../../images/3D-button.png), ready to switch to 3D mode.
When in 3D, the button looks like this: ![image: 2D/3D button](../../images/2D-button.png), ready to switch to 2D mode.
When in 2D, the button looks like this: ![image: 2D/3D button](../../_static/images/3D-button.png), ready to switch to 3D mode.
When in 3D, the button looks like this: ![image: 2D/3D button](../../_static/images/2D-button.png), ready to switch to 2D mode.
You can also switch modes by pressing `Ctrl+y`.

Note that when entering 3D rendering mode the GUI `Add point`,
Expand Down
Loading
Loading