# Segmentation

We are going to identify particles inside the following image.

![](https://1564297567-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvpZTppa56OvfLm71ut%2F-MD6e3O0nKfk8Zys2RIG%2F-MDBmD2klG0GfVHXaDCG%2Fimage.png?alt=media\&token=5d8cea7f-55c1-4596-be6a-416a51b8eccb)

Please download the file.

{% file src="<https://1564297567-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvpZTppa56OvfLm71ut%2F-MD6e3O0nKfk8Zys2RIG%2F-MDBkhve-zRplX-26vSg%2FCell_Colony.jpg?alt=media&token=a38c9ac7-8651-4ede-b320-5cc67e594c09>" %}

Open Fiji and go to File -> Open and select the file.

We want to transform the image's data into a binary file where any algorithm can identify different pieces of it. First, let's check the Image pixel color histogram. Go to Image -> adjust threshold. Click Auto in the pop up window.

![](https://1564297567-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvpZTppa56OvfLm71ut%2F-MDBpbwlqhaVyw6qUtg-%2F-MDBssQ_BJpU-Y9LSmRZ%2Fimage.png?alt=media\&token=83414160-0dfb-43ff-88a0-f49ba0430deb)

The particles are the darker points or blobs inside the image. Some of the points ( the smaller ones ) are not painted in red, so we are going to play with the slides to include them as part of the data we have interested in. The first slide controls the lower bound of the threshold, and the second slide the upper bound. Keep the value of the former and increase the value of the latter.

![](https://1564297567-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvpZTppa56OvfLm71ut%2F-MDBy95JAqtQ7aQk7Tao%2F-MDByMWNvYNZkUWe2ltZ%2Fimage.png?alt=media\&token=16f2c132-3f45-4421-bfbc-36302d244b75)

Unfortunately, by increasing the maximum value of the threshold to include more points, some noise data has been added to the result image. This could be due to the background noise. Let's try to fix this. IN the menu bar Go to Image -> Duplicate and pre-append "bg" to the name of the file and click ok.

Go to Process -> Filters  and select Gaussian Blur. Check the Preview option, and play with different values in the pop up window.

![](https://1564297567-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvpZTppa56OvfLm71ut%2F-MDC1NEB7TLGnFJhWFLC%2F-MDC2iyCCHKC1RcqveKu%2Fimage.png?alt=media\&token=fb89caa6-44ae-439a-9304-1d6301cf21fc)

When you find the right value, do click on ok. This image represents an smoother version of the image, with a reduced level of noise. Let's operate the two images. In the menu bar go to Process -> Image calculator. In the Image 1 drop list select the original image, and in the Image 2 drop list select the background filtered image. Select Divide in the operation drop list.  Check Create new window and 32 bit float result.

![](https://1564297567-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvpZTppa56OvfLm71ut%2F-MDC81t6AuqjWw5zO85V%2F-MDC8X2GlY4jIiM6PfE2%2Fimage.png?alt=media\&token=38091213-a0ca-4997-b27a-7b03c85b1619)

We have a less noise version of the image. Transform it to 8 bit. Go to Image -> type and select 8 bit.

![](https://1564297567-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvpZTppa56OvfLm71ut%2F-MDC9Z-CqWFUR8QowG0a%2F-MDC9kcmtUYr-bl8mkM8%2Fimage.png?alt=media\&token=80b8a761-3c78-4308-b343-23631176b0ec)

Next, go to Process -> Binary -> Options and check Background. Click ok.  In our example objects of interest will be displayed white on black background

Now, let's see the histogram of this new image and fix the threshold. Select Image -> Adjust -> Threshold. Now can increase the upper limit, and more points will be painted red without including the background noise.

![](https://1564297567-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvpZTppa56OvfLm71ut%2F-MDCC-K8wu6YJJoqI2Tj%2F-MDCCZCrJXcqgcTmpiUA%2Fimage.png?alt=media\&token=fa2a90df-127d-4172-8a5f-3885bb480896)

Adjust the threshold as much as you like and then click on Apply.

![](https://1564297567-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvpZTppa56OvfLm71ut%2F-MDCCbf2YK3B8n6cpUpN%2F-MDCD-dRjBzNn8WCO8bt%2Fimage.png?alt=media\&token=bb737d9b-c46c-4287-a05c-3ec0bd51c84b)

At this point, you can pass the resulting image over to an algorithm to analyze it. For example, we can identify and level the particles.  On the Menu bar go to Analyze -> Analyze particles,  check the clear results option, in the show combo list select Outlines and click Ok.

![](https://1564297567-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvpZTppa56OvfLm71ut%2F-MDCD1CKk3c8_WvhOUbO%2F-MDCcwWAizXvH3EMwFvz%2Fimage.png?alt=media\&token=47641cc6-98fe-4fff-88a8-17b67589ea16)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ccv.brown.edu/visualization/fiji/fiji-fiji-is-just-imagej/segmentation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
