Skip to content

Commit 097eb9a

Browse files
committed
docs: replace an image with comparison
1 parent 954f6cf commit 097eb9a

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

docs/Tutorials/ROI analysis.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
In this tutorial we will talk about regions of interest, how to extract them and how to analyse them on an actual example.
2-
3-
## Synopsis
1+
In this tutorial we will talk about regions of interest, how to extract them and how to analyze them on an actual example.
42

53
## Regions' analysis
64

@@ -17,15 +15,15 @@ or, if an image has more complex background and many small elements positioned c
1715
const roiMap = watershed(image, { points, mask });
1816
```
1917

20-
| Good image for using threshold | Good image for using watershed |
21-
| ----------------------------------- | ----------------------------------- |
22-
| ![](./images/roiAnalysis/greys.png) | ![](./images/roiAnalysis/input.jpg) |
18+
You can see a good image to use threshold (on the left) and an image for watershed (on the right).
19+
20+
![Techniques comparison](./images/roiAnalysis/ThresholdOrWatershed.png)
2321

2422
:::caution
2523
Before taking on the analysis of regions of interest we recommend to take a look at the tutorials for `watershed` and `threshold`.
2624
:::
2725

28-
For the sake of simplicity we will use the same example as with a threshold method. However, we will put a little twist and use an image of [TIFF](https://en.wikipedia.org/wiki/TIFF 'wikipedia link on .tiff format') format. This format is great for storing and editing an image. It also allows adding metadata with extensive information about an image which we will examine a bit further in this tutorial. But for now let's not go too far ahead and take one step at a time.
26+
For the sake of simplicity we will use the same example as in a threshold method. However, we will put a little twist and use an image of [TIFF](https://en.wikipedia.org/wiki/TIFF 'wikipedia link on .tiff format') format. This format is great for storing and editing images. It also allows adding metadata with extensive information about an image which we will examine a bit further in this tutorial. But for now let's take one step at a time.
2927
To get regions of interest you need to extract them from a map:
3028

3129
```ts
@@ -75,7 +73,7 @@ for (const roi of rois) {
7573

7674
![Biggest rois](./images/roiAnalysis/biggestCells.jpg)
7775

78-
The selected regions can be investigated further. For instance, we can use property like `roundness` to see how close the region's shape is to a circle. Let's put arbitrarily 0.9 as a limit.
76+
The selected regions can be investigated further. For instance, we can use property like `roundness` to see how close the region's shape is to a circle. Let's put arbitrarily 0.9 as a limit (the coefficient for a perfect circle will be 1).
7977

8078
```ts
8179
let roundestRois = [];
@@ -146,23 +144,23 @@ This is just a fraction of tools that ImageJS possesses. There are multiple prop
146144
## Getting metadata from TIFF files
147145

148146
Another aspect worth inspecting is extracting image metadata. If an image is of TIFF format, you can extract some metadata tags that can provide additional information about an image. For instance, you can get data such as image length and width or learn about image quality through bit depth(`bitsPerSample`) or X and Y Resolutions.
149-
The metadata of TIFF format is split into two parts: `tiff` and `exif` which is another image format. We will focus on `tiff` part.
147+
The metadata of TIFF format is split into two parts: `tiff` and `exif` which is another image format. It can provide information about camera settings, for example. `exif`, however, is mostly used for storing metadata within image formats like JPEG. And since an `exif` part of returned metadata is empty we will focus on `tiff` part.
150148

151149
```ts
152150
const meta = image.meta.tiff;
153151
```
154152

155153
There you will have other two parts: one part will be comprised of a map with fields and then an object of TIFF meta tags which these fields' values are attributed to.
156154

157-
![](./images/roiAnalysis/metaDataScreen.png)
155+
![Metadata](./images/roiAnalysis/metaDataScreen.png)
158156

159157
### Getting extra data
160158

161159
Within metadata, you might be wondering what this huge mix of letters and numbers represents:
162160

163161
![](./images/roiAnalysis/extraData.jpg)
164162

165-
These are custom fields added with additional information about an image that the user. For instance, in this case you can get information about the microscope that was used, or the magnification level or the electrometric tension that was used while the image was taken. However, this data needs to be parsed, because it difficult to decipher it in its raw format.
163+
These are custom fields added with additional information about an image. For instance, in this case you can get information about the microscope that was used, or the magnification level or the electrometric tension that was used while the image was taken. However, this data needs to be parsed, because it is difficult to decipher in its raw format.
166164
To do so you need to identify what is the key id of this text. In our case it is 34682, but it might not always be the case so check it beforehand.
167165

168166
Next thing we need to do is to parse this text.
@@ -187,13 +185,14 @@ lines.forEach((a) => {
187185
});
188186
```
189187

190-
With this the data should be parsed.
188+
With this the data in the. console should look something like this.
191189

192190
![](./images/roiAnalysis/parsedExtraData.png)
193191

194192
### Getting pixel size
195193

196-
In this specific scenario we would also like to tell you about the way to calculate image's pixel size. Pixel size can be one of metadata fields but if this isn't the case we would like to show you how you can calculate it from existing data.
194+
In this specific scenario we would also like to tell you about the way to calculate image's pixel size. It is an important aspect to deduce image's detail sharpness and display's quality.
195+
Pixel size can be one of metadata fields but if this isn't the case we would like to show you how you can calculate it from existing data.
197196

198197
If there is no such field as "Pixel size" you can calculate DPI resolution and apply it with magnification.
199198
DPI resolution represents the number of dots per inch. To calculate it we need to look at three lines in our parsed extra data: `XResolution`, `YResolution` and `ResolutionUnit`.
Loading
-172 KB
Binary file not shown.
-11.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)