You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before taking on the analysis of regions of interest we recommend to take a look at the tutorials for `watershed` and `threshold`.
26
24
:::
27
25
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.
29
27
To get regions of interest you need to extract them from a map:
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).
79
77
80
78
```ts
81
79
let roundestRois = [];
@@ -146,23 +144,23 @@ This is just a fraction of tools that ImageJS possesses. There are multiple prop
146
144
## Getting metadata from TIFF files
147
145
148
146
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.
150
148
151
149
```ts
152
150
const meta =image.meta.tiff;
153
151
```
154
152
155
153
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.
Within metadata, you might be wondering what this huge mix of letters and numbers represents:
162
160
163
161

164
162
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.
166
164
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.
167
165
168
166
Next thing we need to do is to parse this text.
@@ -187,13 +185,14 @@ lines.forEach((a) => {
187
185
});
188
186
```
189
187
190
-
With this the data should be parsed.
188
+
With this the data in the. console should look something like this.
191
189
192
190

193
191
194
192
### Getting pixel size
195
193
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.
197
196
198
197
If there is no such field as "Pixel size" you can calculate DPI resolution and apply it with magnification.
199
198
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`.
0 commit comments