🚀1. Choosing the right parameters

It is recommended to test the GAT segmentation on representative images of neurons first before running the entire workflow. These macros can be found under GAT->Tools and will have "Test" as a prefix. This is to ensure that the segmentation is accurate.

There are 3 important parameters in GAT that may require fine tuning:

  • Probability

  • Rescaling Factor

  • Overlap Threshold

We will go into more detail about each and how to optimise them.

1.1 Optimising GAT segmentation

The model within GAT returns an image with probability or likelihood of pixels within an image belong to a cell. The values it return are from 0 to 1, with 1 being super confident. When you set a probability value in GAT, you are setting a threshold, where a higher value will lead to less objects and a lower value will lead to more objects. This can be useful if your image is quite bright and the model is picking up background or faint objects as being cells.

For example, the image below demonstrates cell detection with probability thresholds of 0.4, 0.6, 0.8 and 0.9.

High probability yields lower number of objects and reduce false positives, whereas lower probability will give more objects and thus reduce false negatives.

Determining the right probability

  • To determine the right probability value for your image, you can go to GAT -> Tools -> Test neuron probability

  • You can test this by downloading this sample image, with cropped Hu channel.

  • You can select mode of segmentation as Neuron segmentation.

  • If your image is of a neuronal subtype such as ChAT, nNOS etc.., then select Neuron subtype segmentation.

  • Enter the range of probability values: 0.4 to 0.9 and increment of 0.1

  • Keep everything else the same for now.

  • When you click Ok, GAT will process each image and when done will display all the different outputs.

  • The log window will also display the number of objects for each probability value.

This can help you figure out the right probability value. Use the same workflow for neuronal subtypes as well.

The other parameters that can be adjusted within GAT is the “Probability” and “Overlap Threshold” of the StarDist segmentation.

Default probability values in GAT:

  • Neuron: 0.5

  • Neuronal subtype: 0.4

Lowering Probability will help in detecting low stained cells or dim areas. However, it can also pick up background or false positives. Increasing probability will reduce the number of detected cells and keep bright objects.

The above parameters are all entered into the StarDist plugin in Fiji. For more details about StarDist and how it works, refer to this FAQ.

1.2 Testing segmentation on a tilescan/large image

  • Open a large tilescan image in FIJI. You can select Tilescan_GAT_ms_distal_colon_MP_hu.tif from the sample images. Select the rectangle tool and draw a rectangle around region you’d like to test the segmentation.

  • Right click outside the ROI, click duplicate followed by OK and you will get just that region as a separate image.

  • Go to GAT -> Tools -> Test Neuron rescaling.

  • As the image is already open, tick Image_already_open.

  • Use the following settings:

  • Click OK. It will ask you to select the image as we selected the image already open box. Select the cropped image and click OK.

  • It will now cycle through the rescaling factors, resize the images and run segmentation on them.

  • In the Log window, you will see the no of detected objects at each rescaling factor with corresponding pixel size:

1.3 Pixel size to rescaling factor conversion

Earlier versions of GAT used pixel size for segmentation. This was confusing and instead we have introduced a rescaling factor. To convert from pixel size to rescaling factor you can divide pixel size by 0.568. Example conversions:

Keep in mind this is the pixel size you would like to rescale the image to so that the algorithm performs accurate segmentation. It is not the pixel size of your image.

Last updated