@@ -325,11 +325,27 @@ Try increasing the 'sigma' value to three and clicking run again:
325325of 3" width='40%'}
326326
327327You should see a new 'nuclei_gaussian_σ=3.0' layer that is much more heavily blurred.
328- If you used the ` + ` /` - ` buttons to set the sigma value, you may see many more
329- decimal places in the layer name e.g. 'nuclei_gaussian_σ=3.00000000000000'.
330- If so, double click on the layer name to re-name it to ` nuclei_gaussian_σ=3.0 ` .
331328
332- What's happening here? What exactly does a gaussian blur do? A gaussian blur is
329+ ::::::::::::::::::::::::::::::::::::: callout
330+
331+ ## Renaming Layer Names
332+
333+ The Gaussian filter plugin uses the special character ` σ ` in the layer names.
334+ This naming convention makes it difficult to type layer names in the Napari
335+ console (unless your keyboard has the ` σ ` character). To make life easier
336+ change the name of the added layer now. Double click on the layer name, delete ` σ `
337+ and change it to ` sigma `
338+
339+ ![ ] ( fig/layer-rename.png ) {alt="The mouse cursor hovers over a napari image layer named nuclei_gaussian_sigma=1.0." width='40%'}
340+
341+
342+ Similarly, if you used the ` + ` /` - ` buttons to set the sigma value, you may see excessive
343+ decimal places in the layer name e.g. ` nuclei_gaussian_σ=3.00000000000000 ` .
344+ If so, double click on the layer name to re-name it to ` nuclei_gaussian_sigma=3.0 ` .
345+
346+ :::::::::::::::::::::::::::::::::::::
347+
348+ What's happening here? What exactly does a gaussian blur do? A gaussian blur is
333349an example of a 'linear filter' which is used to manipulate pixel values in
334350images. When a filter is applied to an image, each pixel value is replaced by
335351some combination of the pixel values around it. For example, below is shown a
@@ -521,12 +537,12 @@ Now let's try thresholding our image again. Make sure you set your gaussian blur
521537sigma to three, then click 'Apply Gaussian Filter'.
522538
523539Then, we'll apply the same threshold as before, now to the
524- 'nuclei_gaussian_σ =3.0' layer:
540+ 'nuclei_gaussian_sigma =3.0' layer:
525541
526542``` python
527543
528544# Get the image data for the blurred nuclei
529- blurred = viewer.layers[" nuclei_gaussian_σ =3.0" ].data
545+ blurred = viewer.layers[" nuclei_gaussian_sigma =3.0" ].data
530546
531547# Create mask with a threshold of 8266
532548blurred_mask = blurred > 8266
@@ -578,7 +594,7 @@ Finally, open the `napari-matplotlib` histogram again with:
578594the nuclei image after a gaussian blur. The left contrast limit is set
579595to 0.134."}
580596
581- Make sure you have 'nuclei_gaussian_σ =3.0' selected in the layer list (should
597+ Make sure you have 'nuclei_gaussian_sigma =3.0' selected in the layer list (should
582598be highlighted in blue).
583599
584600You should see that this histogram now runs from 0 to 1, reflecting the new
@@ -588,7 +604,7 @@ threshold between the two peaks - around 0.134:
588604``` python
589605
590606# Get the image data for the blurred nuclei
591- blurred = viewer.layers[" nuclei_gaussian_σ =3.0" ].data
607+ blurred = viewer.layers[" nuclei_gaussian_sigma =3.0" ].data
592608
593609# Create mask with a threshold of 0.134
594610blurred_mask = blurred > 0.134
@@ -633,7 +649,7 @@ clear that some areas are still missed or incorrectly labelled.
633649## Automated thresholding
634650
635651First, let's clean up our layer list again. Make sure you only have the
636- 'nuclei', 'mask', 'blurred_mask' and 'nuclei_gaussian_σ =3.0' layers in the
652+ 'nuclei', 'mask', 'blurred_mask' and 'nuclei_gaussian_sigma =3.0' layers in the
637653layer list - select any others and remove them by clicking the ![ ] (
638654https://raw.githubusercontent.com/napari/napari/main/src/napari/resources/icons/delete.svg
639655){alt="A screenshot of Napari's delete layer button" height='30px'} icon. Then,
@@ -648,7 +664,7 @@ the most common methods is _Otsu thresholding_, which we will look at now.
648664
649665Let's go ahead and apply this to our blurred image:
650666
651- - Select 'nuclei_gaussian_σ =3.0' in the ` Image ` row
667+ - Select 'nuclei_gaussian_sigma =3.0' in the ` Image ` row
652668- Select 'otsu' as the method
653669- Click the 'Apply Thresholding' button
654670
0 commit comments