Imaging Software


Figure 1

A mosaic of screenshots of some of Napari's  included sample data

Figure 2

A screenshot of the default Napari user  interface

Figure 3

A screenshot of a flourescence microscopy image  of some cells in Napari

Figure 4

A screenshot of Napari with the main user  interface sections labelled

Figure 5

Three screenshots of the cells image in napari, at  different z depths

Figure 6

Closeup of Napari's dimension slider with labels

Figure 7

Console A screenshot of Napari's console button


Figure 8

2D/3D A screenshot of Napari's 2D button / A screenshot of Napari's 3D button


Figure 9

A screenshot of 3D cells in Napari

Figure 10

Roll dimensions A screenshot of Napari's roll dimensions button


Figure 11

Three screenshots of the cells image in napari,  with different axes being visualised

Figure 12

Transpose dimensions A screenshot of Napari's transpose dimensions button


Figure 13

Two screenshots of the cells image in napari,  with dimensions swapped

Figure 14

Grid A screenshot of Napari's grid button


Figure 15

Home A screenshot of Napari's home button


Figure 16

A screenshot of Napari's layer list, showing two  image layers named 'nuclei' and 'membrane'

Figure 17

A screenshot of Napari with the nuclei and  membrane layer swapped

Figure 18

Cells image with blue nuclei and bright  red membranes

Figure 19

Points A screenshot of Napari's point layer button


Figure 20

Shapes A screenshot of Napari's shape layer button


Figure 21

Labels A screenshot of Napari's labels layer button


Figure 22

Remove layer A screenshot of Napari's delete layer button


Figure 23

Cells image with points marking multiple nuclei

Figure 24

  • Click the ‘add points’ button Screenshot of Napari's add points button

  • Figure 25

  • Click the ‘select points’ button Screenshot of Napari's select points button

  • What is an image?


    Figure 1

    Press the remove layer button A screenshot of Napari's delete layer button


    Figure 2

    A screenshot of a 2D image of human cells  undergoing mitosis in Napari

    Figure 3

    A screenshot of Napari - with the mouse cursor  hovering over a pixel and highlighting the corresponding pixel value

    Figure 4

    First, open Napari’s built-in Python console by pressing the console button A screenshot of Napari's console button. Note this can take a few seconds to open, so give it some time:


    Figure 5

    A screenshot of Napari's console

    Figure 6

    Note that you can also pop the console out into its own window by clicking the small A screenshot of Napari's float panel button icon on the left side.


    Figure 7

    A diagram comparing the array of numbers and image  display for a simplified image of an arrow

    Figure 8

    A screenshot of Napari - with the mouse cursor  hovering over a pixel and highlighting the corresponding coordinates

    Figure 9

    Diagram comparing a standard graph  coordinate system (left) and the image coordinate system (right)

    Figure 10

    A diagram showing how pixel coordinates change over a simple 4x4 image

    Image display


    Figure 1

    Diagram showing an image array (top) with three different colormap  options (bottom)

    Figure 2

    Diagram showing two image arrays - 8-bit vs 16-bit (top) with the same  display (bottom)

    Figure 3

    Screenshot of searching 'matplotlib' on napari hub

    Figure 4

    Screenshot of napari-matplotlib's activity tab on napari hub

    Figure 5

    Screenshot of plugin installation window in Napari

    Figure 6

    Screenshot of image histogram for mitosis image

    Figure 7

    Screenshot of image histogram for coins image

    Figure 8

    Screenshot of 4 small grayscale test images

    Figure 9

    Screenshot of 4 histograms, corresponding to the test images

    Figure 10

    Diagram showing an image array (top) with three different colormap  options (bottom)

    Figure 11

    Grey colormap shown as a colorbar with corresponding pixel values

    Figure 12

    Diagram showing histograms, colorbars and images for the gray, green,  viridis and inferno colormap applied on the coins image

    Figure 13

    Histogram, colorbar and image corresponding to coins coloured by the  gray colormap. Contrast limits 0 and 255.

    Figure 14

    Histogram, colorbar and image corresponding to coins coloured by the  gray colormap. Contrast limits 150 and 255.

    Figure 15

    Histogram, colorbar and image corresponding to coins coloured by the  gray colormap. Contrast limits 150 and 200.

    Figure 16

    Open the Napari console with the A screenshot of Napari's console button button and copy and paste the code below:


    Multi-dimensional images


    Figure 1

    A diagram comparing the array of numbers and image  display for a simplified image of an arrow

    Figure 2

    A screenshot of a 2D image of human cells  undergoing mitosis in Napari

    Figure 3

    Let’s remove the mitosis image by clicking the remove layer button A screenshot of Napari's delete layer button at the top right of the layer list. Then, let’s open a new 3D image:
    File > Open Sample > napari builtins > Brain (3D)


    Figure 4

    A screenshot of a head X-ray in Napari

    Figure 5

    A diagram comparing 2D and  3D image arrays

    Figure 6

    A screenshot of a flourescence microscopy image  of some cells in Napari

    Figure 7

    A diagram showing different kinds of channels  for a 4x4 image of a cell e.g. red / green / surface height / elasticity

    Figure 8

    A screenshot of Napari's layer list, showing two  image layers named 'nuclei' and 'membrane'

    Figure 9

    A diagram comparing image arrays with three  (z, y, x) and four (c, z, y, x) dimensions

    Figure 10

    Channels can be easily shown/hidden with the A screenshot of Napari's eye button icons


    Figure 11

    A screenshot of a 2D time series in Napari

    Figure 12

    This image is a 2D time series (tyx) of some human cells undergoing mitosis. The slider at the bottom now moves through time, rather than z or channels. Try moving the slider from left to right - you should see some nuclei divide and the total number of nuclei increase. You can also press the small A screenshot of Napari's play button icon at the left side of the slider to automatically move along it. The icon will change into a A screenshot of Napari's stop button- pressing this will stop the movement.


    Figure 13

    A diagram of a tyx image array

    Figure 14

    What do each of those dimensions represent? (e.g. t, c, z, y, x) Hint: try using the roll dimensions button A screenshot of Napari's roll dimensions button to view different combinations of axes.


    Figure 15

    If we press the roll dimensions button A screenshot of Napari's roll dimensions button once, we can see an image of various cells and nuclei. Moving the slider labelled ‘0’ seems to move up and down in this image (i.e. the z axis), while moving the slider labelled ‘3’ changes between highlighting different features like nuclei and cell edges (i.e. channels). Therefore, the remaining two axes (1 and 2) must be y and x. This means the image’s 4 dimensions are (z, y, x, c)


    Figure 16

    A screenshot of an H+E slide of skin layers  in Napari

    Figure 17

    A screenshot of an H+E slide of skin layers in  Napari, highlighting the (R,G,B) values

    Figure 18

    This shows the red, green and blue channels as separate image layers. Try inspecting each one individually by clicking the A screenshot of Napari's eye button icons to hide the other layers.


    Figure 19

    A screenshot of a colorwheel in Napari

    Figure 20

    RGB histogram of the Napari Skin sample image

    Figure 21

    Diagram of (R, G, B) values next to corresponding  colours

    Filetypes and metadata


    Figure 1

    A screenshot of yeast sample data shown in  Napari

    Figure 2

    A screenshot of napari-aicsimageio's OME Tree  Widget

    Figure 3

    Screenshot of metadata printed to Napari's  console

    Figure 4

    Yeast image shown in Napari with layer 3  twice as big in y and x

    Figure 5

    Yeast image shown in Napari with layer 3  twice as big in y

    Figure 6

    Yeast image shown in Napari with all layers  half size in y/x

    Figure 7

    Diagram of a line of 30 pixels - 10 with pixel  value 50, then 10 with pixel value 100, then 10 with pixel value 150

    Figure 8

    Open all four images in Napari. Zoom in very close to a bright nucleus, and try showing / hiding different layers with the A screenshot of Napari's eye button icon. How do they differ? How does each compare to timepoint 30 of the original ‘00001_01.ome’ image?


    Figure 9

    Diagram of an image pyramid with three  resolution levels

    Designing a light microscopy experiment


    Figure 1

    Screenshot of Napari's Skin sample image
    The image above is Napari’s Skin (RGB) sample image - it is a brightfield image of a hematoxylin and eosin stained slide of dermis and epidermis.

    Figure 2

    Phase gradient contrast image of SH-SY5Y cells
    The image above is a phase gradient contrast image of some SH-SY5Y cells (ZEISS Microscopy, CC BY 2.0, via Wikimedia Commons )

    Figure 3

    DIC image of some yeast cells - Saccharomyces cerevisiae
    The image above is a DIC image of some yeast cells (Saccharomyces cerevisiae) from Wikimedia Commons

    Figure 4

    Fluorescence microscopy image of some LLC-PK1 cells
    The image above is a fluorescence microscopy image of some LLC-PK1 cells (ZEISS Microscopy, CC BY 2.0, via Wikimedia Commons )

    Figure 5

    Screenshot of Napari's Kidney (3D + 3Ch) sample image
    The image above is Napari’s Kidney (3D + 3Ch) sample image. This was acquired with confocal fluorescence microscopy.

    Choosing acquisition settings


    Figure 1

    Left - the nuclei from Napari's Cells  (3D+2Ch) sample image. Right - same image with added gaussian noise

    Figure 2

    Diagram of a low signal-to-noise scenario.  Left - histogram with no noise. Middle - histogram with added noise (separate  histograms). Right - histogram with added noise (combined histogram).

    Figure 3

    Diagram of a high signal-to-noise scenario.  Left - histogram with no noise. Middle - histogram with added noise (separate  histograms). Right - histogram with added noise (combined histogram).

    Figure 4

    Diagram highlighting some of the  trade-offs of increasing spatial resolution

    Figure 5

    A 16x16 image of a  grayscale circle

    Figure 6

    An 8x8 image of a  grayscale circle

    Figure 7

    Left - a diagram of two round cells (blue, 10  micrometre wide) overlaid by a perfectly aligned 10 micrometre pixel grid.  Right - the equivalent image with a grayscale colormap

    Figure 8

    Left - a diagram of two round cells (blue, 10  micrometre wide) overlaid by a misaligned 10 micrometre pixel grid.  Right - the equivalent image with a grayscale colormap

    Figure 9

    Left - a diagram of two round cells (blue, 10  micrometre wide) overlaid by a 5 micrometre pixel grid.  Right - the equivalent image with a grayscale colormap

    Figure 10

    Top - a diagram of six round cells (blue, 5  micrometre wide) overlaid by a 10 micrometre pixel grid.  Bottom - the equivalent image with a grayscale colormap

    Figure 11

    Diagram of four example acquisition  image histograms (labelled a-d)

    Quality control and manual segmentation


    Figure 1

    A screenshot of a flourescence microscopy image  of some cells in Napari

    Figure 2

    If you need a refresher on how to use napari matplotlib, check out the image display episode. It may also be useful to zoom into parts of the image histogram by clicking the A screenshot of napari-matplotlib's zoom button icon at the top of histogram, then clicking and dragging a box around the region you want to zoom into. You can reset your histogram by clicking the A screenshot of napari-matplotlib's home button icon.


    Figure 3

    A histogram of the 29th z slice of Napari's  cell sample image

    Figure 4

    If we look at the brightest part of the image, near z=29, we can see that there are indeed pixel values over much of this possible range. At first glance, it may seem like there are no values at the right side of the histogram, but if we zoom in using the A screenshot of napari-matplotlib's zoom button icon we can clearly see pixels at these higher values.


    Figure 5

    A histogram of the 29th z slice of  Napari's cell sample image - zoomed in to the range from 25000 to 60000

    Figure 6

    First, let’s take a quick look at a rough semantic segmentation. Open Napari’s console by pressing the A screenshot of Napari's console button button, then copy and paste the code below. Don’t worry about the details of what’s happening in the code - we’ll look at some of these concepts like gaussian blur and otsu thresholding in later episodes!


    Figure 7

    A screenshot of a rough semantic  segmentation of nuclei in Napari

    Figure 8

    You should see an image appear that highlights the nuclei in brown. Try toggling the ‘semantic_seg’ layer on and off multiple times, by clicking the A screenshot of Napari's eye button icon next to its name in the layer list. You should see that the brown areas match the nucleus boundaries reasonably well.


    Figure 9

    A screenshot of a rough instance  segmentation of nuclei in Napari

    Figure 10

    You should see an image appear that highlights nuclei in different colours. Let’s hide the ‘semantic_seg’ layer by clicking the A screenshot of Napari's eye button icon next to its name in Napari’s layer list. Then try toggling the ‘instance_seg’ layer on and off multiple times, by clicking the corresponding A screenshot of Napari's eye button icon. You should see that the coloured areas match most of the nucleus boundaries reasonably well, although there are some areas that are less well labelled.


    Figure 11

  • Click the A screenshot of Napari's eye button icon next to ‘semantic_seg’ in the layer list to make it visible.

  • Figure 12

  • Click the A screenshot of Napari's eye button icon next to ‘instance_seg’ in the layer list to hide it.

  • Figure 13

    A screenshot highlighting the pixel  value of a nuclei segmentation in Napari

    Figure 14

  • Click the A screenshot of Napari's eye button icon next to ‘instance_seg’ in the layer list to make it visible.

  • Figure 15

  • Click the A screenshot of Napari's eye button icon next to ‘semantic_seg’ in the layer list to hide it.

  • Figure 16

  • Click the A screenshot of Napari's delete layer button icon to remove these layers.

  • Figure 17

    Then click on the A screenshot of Napari's labels layer button icon (at the top of the layer list) to create a new Labels layer.


    Figure 18

    A screenshot of the layer controls for  labels layers in Napari

    Figure 19

    Let’s start by painting an individual nucleus. Select the paintbrush by clicking the A screenshot of Napari's paintbrush button icon in the top row of the layer controls. Then click and drag across the image to label pixels. You can change the size of the brush using the ‘brush size’ slider in the layer controls. To return to normal movement, you can click the A screenshot of Napari's pan arrows button icon in the top row of the layer controls, or hold down spacebar to activate it temporarily (this is useful if you want to pan slightly while painting). To remove painted areas, you can activate the label eraser by clicking the A screenshot of Napari's erase button icon.


    Figure 20

    A screenshot of a single manually  painted nucleus in Napari

    Figure 21

    A screenshot of two manually painted nuclei  in Napari

    Figure 22

    When you paint with a new value, you’ll see that Napari automatically assigns it a new colour. This is because Labels layers use a special colormap/LUT for their pixel values. Recall from the image display episode that colormaps are a way to convert pixel values into corresponding colours for display. The colormap for Labels layers will assign random colours to each pixel value, trying to ensure that nearby values (like 2 vs 3) are given dissimilar colours. This helps to make it easier to distinguish different labels. You can shuffle the colours used by clicking the A screenshot of Napari's shuffle button icon in the top row of the layer controls. Note that the pixel value of 0 will always be shown as transparent - this is because it is usually used to represent the background.


    Figure 23

  • What does the A screenshot of Napari's fill button icon do?

  • Figure 24

  • What does the A screenshot of Napari's picker button icon do?

  • Figure 25

    A screenshot of Napari's fill button icon


    Figure 26

    A screenshot of Napari's picker button icon


    Filters and thresholding


    Figure 1

    Make sure you only have ‘nuclei’ in the layer list. Select any additional layers, then click the A screenshot of Napari's delete layer button icon to remove them. Also, select the nuclei layer (should be highlighted in blue), and change its colormap from ‘green’ to ‘gray’ in the layer controls.


    Figure 2

    A screenshot of nuclei in Napari using  the gray colormap

    Figure 3

    A histogram of the 29th z slice of Napari's  cell sample image

    Figure 4

    Left, nuclei with gray colormap.  Right, histogram of the same image. Both with left contrast limit set  to 8266.

    Figure 5

    Left, nuclei with gray colormap.  Right, histogram of the same image. Both with left contrast limit set  to 28263.

    Figure 6

    You should see a mask appear that highlights the nuclei in brown. If we set the nuclei contrast limits back to normal (select ‘nuclei’ in the layer list, then drag the left contrast limits node back to zero), then toggle on/off the mask or nuclei layers with the A screenshot of Napari's eye button icon, you should see that the brown areas match the nucleus boundaries reasonably well. They aren’t perfect though! The brown regions have a speckled appearance where some regions inside nuclei aren’t labelled and some areas in the background are incorrectly labelled.


    Figure 7

    Mask of nuclei (brown) overlaid on nuclei  image - created with manual thresholding

    Figure 8

    Test image containing a  rectangle, circle and triangle

    Figure 9

    Histogram of the  shape image

    Figure 10

    Screenshot of plugin  installation window for napari-segment-blobs-and-things-with-membranes

    Figure 11

    Screenshot of plugin  installation window for napari-simpleitk-image-processing

    Figure 12

    As before, make sure you only have ‘nuclei’ in the layer list. Select any additional layers, then click the A screenshot of Napari's delete layer button icon to remove them. Also, select the nuclei layer (should be highlighted in blue), and change its colormap from ‘green’ to ‘gray’ in the layer controls.


    Figure 13

    Nuclei image with gray colormap

    Figure 14

    Screenshot of settings for gaussian blur in  Napari

    Figure 15

    Nuclei image after gaussian blur with sigma  of 1

    Figure 16

    Nuclei image after gaussian blur with sigma  of 3

    Figure 17

    Small zoomed-in area of the nucleus image  with a pixel highlighted in red. Around this pixel is shown a  3x3 box.

    Figure 18

    Left - small area of the nucleus image with a  pixel highlighted in red. Around this pixel is shown a 3x3 box. Right - example  of a 3x3 kernel

    Figure 19

    Plot of a 1D gaussian function  comparing three different sigma values

    Figure 20

    Plot of a 2D gaussian function  comparing three different sigma values

    Figure 21

    An example of a 5x5 gaussian  kernel

    Figure 22

    Diagram of gaussian function with FWHM labelled

    Figure 23

    First, let’s clean up our layer list. Make sure you only have the ‘nuclei’ and ‘Result of gaussian_blur’ layers in the layer list - select any others and remove them by clicking the A screenshot of Napari's delete layer button icon. Also, close all filter settings panels on the right side of Napari (apart from the gaussian settings) by clicking the tiny A screenshot of Napari's hide button icon at their top left corner.


    Figure 24

    Let’s return to thresholding our image. Close the gaussian panel by clicking the tiny A screenshot of Napari's hide button icon at its top left corner. Then select the ‘blurred_mask’ in the layer list and remove it by clicking the A screenshot of Napari's delete layer button icon. Finally, open the napari-matplotlib histogram again with:
    Plugins > napari Matplotlib > Histogram


    Figure 25

    A histogram of the 29th z slice of  the nuclei image after a gaussian blur. The left contrast limit is set  to 0.134.

    Figure 26

    Mask of nuclei (brown) overlaid on  nuclei image - created with manual thresholding after gaussian blur

    Figure 27

    First, let’s clean up our layer list again. Make sure you only have the ‘nuclei’, ‘mask’, ‘blurred_mask’ and ‘Result of gaussian_blur’ layers in the layer list - select any others and remove them by clicking the A screenshot of Napari's delete layer button icon. Then, if you still have the napari-matplotlib histogram open, close it by clicking the tiny x icon in the top left corner.


    Figure 28

    Mask of nuclei (brown) overlaid on  nuclei image - created with Otsu thresholding after gaussian blur

    Figure 29

    This should produce a mask (in a new layer called ‘Result of threshold_otsu’) that is very similar to the one we created with a manual threshold. To make it easier to compare, we can rename some of our layers by double clicking on their name in the layer list - for example, rename ‘mask’ to ‘manual_mask’, ‘blurred_mask’ to ‘manual_blurred_mask’, and ‘Result of threshold_otsu’ to ‘otsu_blurred_mask’. Recall that you can change the colour of a mask by clicking the A screenshot of Napari's shuffle button icon in the top row of the layer controls. By toggling on/off the relevant A screenshot of Napari's eye button icons, you should see that Otsu chooses a slightly different threshold than we did in our ‘manual_blurred_mask’, labelling slightly smaller regions as nuclei in the final result.


    Figure 30

    Test image containing a  rectangle, circle and triangle

    Figure 31

    Recall that you can change the colour of a mask by clicking the A screenshot of Napari's shuffle button icon in the top row of the layer controls.


    Figure 32

    Mask of shapes (brown) overlaid on shapes image -  made with Otsu thresholding

    Figure 33

    Mask of shapes (brown) overlaid on shapes  image - made with triangle thresholding

    Figure 34

    Mask of shapes (brown) overlaid on shapes image -  made with Yen thresholding

    Figure 35

    Mask of shapes (brown) overlaid on shapes  image - made with multiple thresholds Otsu method

    Figure 36

    First, let’s clean up our layer list again. Make sure you only have the ‘nuclei’ layer in the layer list - select any others and remove them by clicking the A screenshot of Napari's delete layer button icon. Also, close all settings panels on the right side of Napari by clicking the tiny A screenshot of Napari's hide button icon at their top left corner.


    Figure 37

    Screenshot of the Napari assistant user  interface

    Figure 38

    Screenshot of settings for removing noise  in Napari

    Figure 39

    Screenshot of settings for binarize in  Napari

    Instance segmentation and measurements


    Figure 1

    We’ll be using the napari-skimage-regionprops plugin in this lesson. If it is not already installed you should do that now. Use the tool bar to navigate to Plugins > Install/Uninstall Plugins.... Type region into the filter bar at the top left and you should see napari-skimage-regionprops in the dialog like the image below. A screenshot of the plugin installation dialog for napari-skimage-regionprops If it is already installed, then nothing else needs to be done. If it is not installed, press install, and when finished, restart Napari.


    Figure 2

    Open Napari’s console by pressing the A screenshot of Napari's console button button, then copy and paste the code below.


    Figure 3

    A screenshot of a rough semantic segmentation of nuclei in Napari

    Figure 4

    A screenshot of an instance segmentation of nuclei with some incorrectly joined instances. You should see the above image in the Napari viewer. The different colours are used to represent different nuclei. The instance segmentation assigns a different integer value to each nucleus, so counting the number of nuclei can be done very easily by taking the maximum value of the instance segmentation image.


    Figure 5

    If you followed the instructions above the napari-skimage-regionprops plugin should already be installed. If not then do it now and restart Napari. If the plugin is installed you can use the toolbar to open tools > measurement tables > Regionsprops(skimage, nsr). You should see a dialog like this: A screenshot of the napari-skimage-regionprops plugin at startup.


    Figure 6

    Select nuclei(data) in the image drop down box and instance_seg(data) in the labels drop down box. You can choose to measure various shape properties with this plugin but for now let’s keep it simple, making sure that only the size and position tick boxes are selected. Click run. A table of numeric values should appear under the plugin dialog box, like the image below. A screenshot of the numeric value table created by the napari-skimage-regionprops plugin


    Figure 7

    Let’s start with label 3 which is the largest labelled nucleus. A screenshot of the region-props dialog highlighting the largest nucleus. According to the table, nucleus 3 is larger than the other nuclei (202258 pixels). In the what is an image lesson, we learnt to use the mouse pointer to find particular values in an image. Hovering the mouse pointer over the light purple nuclei at the bottom left of the image we see that these apparently four separate nuclei have been labelled as a single nucleus. Before we examine the reasons for this we’ll look at the other extreme value, the smallest nucleus.


    Figure 8

    The smallest nucleus is labelled 18, at the bottom of the table with a size of 7 pixels. We can use the position data (the centroid and bbox columns) in the table to help find this nucleus. We need to navigate to slice 33 and get the mouse near the top left corner (33 64 0) to find label 18 in the image. A screenshot region-props dialog highlighting the smallest nucleus. Nucleus 18 is right at the edge of the image, so is only a partial nucleus. Partial nuclei will need to be excluded from our analysis. We’ll do this later in the lesson with a clear border filter. However, first we need to solve the problem of joined nuclei.


    Figure 9

    You may remember from our first lesson that we can change to 3D view mode by pressing the Napari's 2D/3D toggle button. Try it now.


    Figure 10

    A screenshot of an instance segmentation of nuclei in 3D mode with some incorrectly joined instances. You should see the image rendered in 3D, with a clear join between the upper most light purple nucleus and its neighbour. So now we understand why the instance labelling has failed, what can we do to fix it?


    Figure 11

    A screenshot of a semantic segmentation mask before erosion. The first image shows the mask without any erosion for comparison.


    Figure 12

    A screenshot of a semantic segmentation mask eroded with a ball of radius 1. Erosion with a radius of 1 makes a small difference, but the nuclei remain joined.


    Figure 13

    A screenshot of a semantic segmentation mask eroded with a ball of radius 5. Erosion with a radius of 5 makes a more noticeable difference, but some nuclei remain joined.


    Figure 14

    A screenshot of a semantic segmentation mask eroded with a ball of radius 10. Erosion with a radius of 10 separates all nuclei.


    Figure 15

    Instance segmentation on the eroded segmentation mask Looking at the image above, there are no longer any incorrectly joined nuclei. The absolute number of nuclei found hasn’t changed much as the erosion process has removed some partial nuclei around the edges of the image.


    Figure 16

    Expanded instance segmentation on the eroded segmentation mask There are now 19 apparently correctly labelled nuclei that appear to be the same shape as in the original mask image.


    Figure 17

    A comparison between the expanded instance segmentation and the original semantic segmentation showing some mismatch between the borders. Looking at the above image we can see some small mismatches around the edges of most of the nuclei. It should be remembered when looking at this image that it is a single slice though a 3D image, so in some cases where the differences look large (for example the nucleus at the bottom right) they may still be only one pixel deep. Will the effect of this on the accuracy of our results be significant?


    Figure 18

    The instance segmentation with any nuclei crossing the image boundary removed We now have an image with 11 clearly labelled nuclei. You may notice that the smaller nucleus (dark orange) near the top left of the image has been removed even though we can’t see where it touches the image border. Remember that this is a 3D image and clear border removes nuclei touching any border. This nucleus has been removed because it touches the top or bottom (z axis) of the image. Let’s check the nuclei count as we did above.


    Additional resources