Skip to content

Commit 0633855

Browse files
actions-userK-Meech
andcommitted
markdown source builds
Auto-generated via `{sandpaper}` Source : 838a0c8 Branch : main Author : Stephen Thompson <s.thompson@ucl.ac.uk> Time : 2026-06-08 15:06:02 +0000 Message : Consistent layer numbering for filetypes and metadata (#126) * Consistent layer numberng * Update episodes/filetypes-and-metadata.md Co-authored-by: Kimberly Meechan <24316371+K-Meech@users.noreply.github.com> * Update episodes/filetypes-and-metadata.md Co-authored-by: Kimberly Meechan <24316371+K-Meech@users.noreply.github.com> * Update episodes/filetypes-and-metadata.md Co-authored-by: Kimberly Meechan <24316371+K-Meech@users.noreply.github.com> --------- Co-authored-by: Kimberly Meechan <24316371+K-Meech@users.noreply.github.com>
1 parent e36381a commit 0633855

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

filetypes-and-metadata.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -325,18 +325,18 @@ image_layer.scale = (0.35, 0.2047619, 0.2047619)
325325

326326
## Pixel size / scale
327327

328-
Copy and paste the following into Napari's console to get `image_layer_1`,
329-
`image_layer_2` and `image_layer_3` of the yeast image:
328+
Copy and paste the following into Napari's console to get `image_layer_0`,
329+
`image_layer_1` and `image_layer_2` of the yeast image:
330330

331331
```python
332-
image_layer_1 = viewer.layers[0]
333-
image_layer_2 = viewer.layers[1]
334-
image_layer_3 = viewer.layers[2]
332+
image_layer_0 = viewer.layers[0]
333+
image_layer_1 = viewer.layers[1]
334+
image_layer_2 = viewer.layers[2]
335335
```
336336

337337
1. Check the `.scale` of each layer - are they the same?
338-
2. Set the scale of layer 3 to (0.35, 0.4, 0.4) - what changes in the viewer?
339-
3. Set the scale of layer 3 to (0.35, 0.4, 0.2047619) - what changes in the
338+
2. Set the scale of `image_layer_2` to (0.35, 0.4, 0.4) - what changes in the viewer?
339+
3. Set the scale of `image_layer_2` to (0.35, 0.4, 0.2047619) - what changes in the
340340
viewer?
341341
4. Set the scale of all layers so they are half as wide and half as tall as
342342
their original size in the viewer
@@ -351,9 +351,9 @@ their original size in the viewer
351351
All layers have the same scale
352352

353353
```python
354+
print(image_layer_0.scale)
354355
print(image_layer_1.scale)
355356
print(image_layer_2.scale)
356-
print(image_layer_3.scale)
357357
```
358358
```output
359359
[0.35 0.2047619 0.2047619]
@@ -363,40 +363,40 @@ print(image_layer_3.scale)
363363

364364
### 2
365365

366-
![](fig/yeast-exercise-2.png){alt="Yeast image shown in Napari with layer 3
366+
![](fig/yeast-exercise-2.png){alt="Yeast image shown in Napari with layer 2
367367
twice as big in y and x"}
368368

369369
```python
370-
image_layer_3.scale = (0.35, 0.4, 0.4)
370+
image_layer_2.scale = (0.35, 0.4, 0.4)
371371
```
372-
You should see that layer 3 becomes about twice as wide and twice as tall as the
373-
other layers. This is because we set the pixel size in y and x (which used to
372+
You should see that layer 2 becomes about twice as wide and twice as tall as the
373+
other layers. This is because we set the pixel size in y and x (which used to
374374
be 0.2047619&mu;m) to about twice its original value (now 0.4&mu;m).
375375

376376
### 3
377377

378-
![](fig/yeast-exercise-3.png){alt="Yeast image shown in Napari with layer 3
378+
![](fig/yeast-exercise-3.png){alt="Yeast image shown in Napari with layer 2
379379
twice as big in y"}
380380

381381
```python
382-
image_layer_3.scale = (0.35, 0.4, 0.2047619)
382+
image_layer_2.scale = (0.35, 0.4, 0.2047619)
383383
```
384-
You should see that layer 3 appears squashed - with the same width as other
385-
layers, but about twice the height. This is because we set the pixel size in y
386-
(which used to be 0.2047619&mu;m) to about twice its original value (now
384+
You should see that layer 2 appears squashed - with the same width as other
385+
layers, but about twice the height. This is because we set the pixel size in y
386+
(which used to be 0.2047619&mu;m) to about twice its original value (now
387387
0.4&mu;m). Bear in mind that setting the pixel sizes inappropriately can lead
388388
to stretched or squashed images like this!
389389

390390
### 4
391391

392-
![](fig/yeast-exercise-4.png){alt="Yeast image shown in Napari with all layers
392+
![](fig/yeast-exercise-4.png){alt="Yeast image shown in Napari with all layers
393393
half size in y/x"}
394394

395395
We set the pixel size in y/x to half its original value of 0.2047619&mu;m:
396396
```python
397+
image_layer_0.scale = (0.35, 0.10238095, 0.10238095)
397398
image_layer_1.scale = (0.35, 0.10238095, 0.10238095)
398399
image_layer_2.scale = (0.35, 0.10238095, 0.10238095)
399-
image_layer_3.scale = (0.35, 0.10238095, 0.10238095)
400400
```
401401
:::::::::::::::::::::::::::::::::
402402

md5sum.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"episodes/what-is-an-image.md" "77453b0c3031890f96104617bcd46a49" "site/built/what-is-an-image.md" "2025-11-04"
99
"episodes/image-display.md" "0d8150fdf6516bc2abb026debedfa3dd" "site/built/image-display.md" "2025-11-04"
1010
"episodes/multi-dimensional-images.md" "36d8d27a775bf837aaa3cf77791779fa" "site/built/multi-dimensional-images.md" "2026-06-08"
11-
"episodes/filetypes-and-metadata.md" "1407632ccab788a7820067e7fd5969cf" "site/built/filetypes-and-metadata.md" "2026-06-08"
11+
"episodes/filetypes-and-metadata.md" "719c5682d05a8c1a15079df7fd782137" "site/built/filetypes-and-metadata.md" "2026-06-08"
1212
"episodes/designing-a-light-microscopy-experiment.md" "9a236fbc9a48f560a786077ea9662c9c" "site/built/designing-a-light-microscopy-experiment.md" "2025-11-04"
1313
"episodes/choosing-acquisition-settings.md" "1bf362eeea03fe66d4e170d9803dc649" "site/built/choosing-acquisition-settings.md" "2024-08-16"
1414
"episodes/quality-control-and-manual-segmentation.md" "f4f883be70cd5f8cf8f24d32815064b5" "site/built/quality-control-and-manual-segmentation.md" "2026-06-05"

0 commit comments

Comments
 (0)