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

Documentation for scale in image layer tutorial #66

Closed
wants to merge 1 commit into from
Closed
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
Binary file added assets/tutorials/scaling.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions fundamentals/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,18 @@ All our layers support a `name` property that can be set inside a text box insid

All our layers support a `scale` property and keyword argument that will rescale the layer multiplicatively according to the scale values (one for each dimension). This property can be particularly useful for viewing anisotropic volumes where the size of the voxel in the z dimension might be different then the size in the x and y dimensions.

In napari, you can scale the layers when creating an image layer or for an existing layer using the `scale` as a keyword argument or property respectively.

```python
# scaling while creating the image layer
napari.view_image(retina, name='retina', scale=[1,10,1,1])

# scaling an existing layer
viewer.layers['retina'].scale = [1,10,1,1]
```

![image]({{ '/assets/tutorials/scaling.gif' | relative_url }})

## translating layers

All our layers support a `translate` property and keyword argument that you can use to offset a layer relative to the other layers, which could be useful if you are trying to overlay two layers for image registration purposes.
Expand Down