@@ -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
3373371 . 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
340340viewer?
3413414 . Set the scale of all layers so they are half as wide and half as tall as
342342their original size in the viewer
@@ -351,9 +351,9 @@ their original size in the viewer
351351All layers have the same scale
352352
353353``` python
354+ print (image_layer_0.scale)
354355print (image_layer_1.scale)
355356print (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
367367twice 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
374374be 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
379379twice 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
3873870.4&mu ; m). Bear in mind that setting the pixel sizes inappropriately can lead
388388to 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
393393half size in y/x"}
394394
395395We 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 )
397398image_layer_1.scale = (0.35 , 0.10238095 , 0.10238095 )
398399image_layer_2.scale = (0.35 , 0.10238095 , 0.10238095 )
399- image_layer_3.scale = (0.35 , 0.10238095 , 0.10238095 )
400400```
401401:::::::::::::::::::::::::::::::::
402402
0 commit comments