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
Copy file name to clipboardExpand all lines: docs/Basics/Working with Images.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@ import ImageDemo from './image.demo.tsx'
6
6
7
7
In the context of digital technology and computing, images are represented as a grid of pixels, with each pixel containing information about color and intensity.
8
8
9
+
<ImageDemo />
10
+
9
11
### Types of images supported by ImagesJS
10
12
11
13
- Currently ImageJS supports images with these characteristics:
@@ -43,15 +45,17 @@ In ImageJS main properties of an image are:
43
45
44
46
- data: typed array with information about image's pixels.
45
47
46
-
-[Color model](../Glossary.md#color-model'internal link on glossary'): the abstract model of how pixel colors are formed.
48
+
-[Color model](../Glossary.md#color-model'internal link on color model'): the abstract model of how pixel colors are formed.
47
49
48
-
-[Bit depth](../Glossary.md#bit-depth'internal link on glossary'): number of bits allocated to each channel.
50
+
-[Bit depth](../Glossary.md#bit-depth'internal link on bit depth'): number of bits allocated to each channel.
49
51
50
-
-[Number of channels/components](../Glossary.md#channel'internal link on glossary'): number of color channels that each pixel has. Grey image has one, RGB-type of image has three.
52
+
-[Number of channels](../Glossary.md#channel'internal link on channels'): number of color channels that each pixel has. Grey image has one, RGB-type of image has three.
51
53
52
-
-[Metadata](../Glossary.md#metadata'internal link on metadata'): data about data.
54
+
-[Number of components](../Glossary.md#component'internal link on components'): number of color channels that each pixel has but without alpha channel.
53
55
54
-
The latter ones matter most in features that involve two images, like [hypotenuse method](../Features/Comparison/Hypotenuse.md'internal link on hypotenuse') or [subtraction method](../Features/Comparison/Subtraction.md'internal link on subtraction method'). It simply will not work if images are not compatible by bit depth, color model or size.
56
+
-[Alpha channel](../Glossary.md#alpha-channel'internal link on alpha-channel'): channel that represents the transparency or opacity levels of pixels.
57
+
58
+
-[Metadata](../Glossary.md#metadata'internal link on metadata'): data about data. A basic example would be date and time when an image was taken
55
59
56
60
### Features
57
61
@@ -65,4 +69,4 @@ Currently, there are several ways of processing an image:
65
69
66
70
-[Morphology](../Features/Morphology/Morphology.md'internal link on morphology'): enables shape analysis and shape identification.
67
71
68
-
<ImageDemo />
72
+
-[ROI analysis](../Features/Regions%20of%20interest/Regions%20of%20interest.md'internal link on roi analysis'): these features allow targeting and extracting relevant information from specific regions of interest.
Copy file name to clipboardExpand all lines: docs/Basics/Working with ROIs.md
+30-15Lines changed: 30 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ import { fromMask } from 'image-js';
15
15
const rois =fromMask(mask).getRois();
16
16
```
17
17
18
-
In general you don't need to worry about the intermediate object returned by `fromMask()`. You will mostly be working with the list of ROIs returned by `getRois()`. It contains all the useful properties which characterize the regions of interest, such as surface, perimeter, centroid etc.
18
+
In general you don't need to worry about the intermediate object returned by `fromMask()`. You will mostly be working with the list of ROIs returned by `getRois()`. It contains all the properties which characterize the region of interest, such as surface, perimeter, fill ratio, etc.
19
19
20
20
:::tip
21
21
In the options parameter,`getRois()` has a `kind` option which tells what kind of regions to return.
@@ -28,7 +28,8 @@ In the options parameter,`getRois()` has a `kind` option which tells what kind o
28
28
29
29
:::
30
30
Let's take a look at a real life example.
31
-
Here you have an image of particles under electron microscopy magnified where 1px = 0.2727 nm. Let's say we want to get the data about all the regions presented on the image and calculate their Feret diameters.
31
+
Here you have an image of particles under electron microscopy magnified at 1px = 0.2727 nm. Let's say we want to sort the data by size and observe its distribution.
32
+
It can be use in various fields, whether it is for quality control to see if all products have the same features and characteristics or for physical properties of material such as surface area and reactivity.
32
33
33
34

34
35
@@ -37,27 +38,41 @@ It can be done with with following code:
37
38
```ts
38
39
import { Image, fromMask } from'image-js';
39
40
40
-
//Convert image to grayscale, then apply a blur on it. This will smooth out the noise and avoid creating many small ROIs in the next steps(image 1).
41
+
//Convert image to grayscale, then apply a blur on it. This will
42
+
// smooth out the noise and avoid creating many small ROIs in the next steps(image 1).
//Use threshold to convert the grayscale image to a Mask. The default threshold algorithm is Otsu which will automatically determine the threshold between black and white pixels by minimizing intra-class intensity variance(image 2).
43
-
const mask =image.threshold();
44
+
//Clear border excludes border regions from mask if they don't
Each region of interest possesses many properties and characteristics (ROIs are highlighted in blue on Image 3).
56
-
Feret diameter is a rather advanced property, but there are also more general and basic ones, like surface or perimeter.
74
+
This will give us a map with stored number of regions per each size interval. This may be a basic example but such analysis is widely used in biology and medicine. It can provide valuable information about predominant cell size or find abnormalities in cells ratio.
57
75
58
-

76
+

59
77
60
-
If you need a further insight on ROIs level of elongation and shape, however, you can use Feret diameter by calling it with `roi.feret`.
61
-
In our current example, they are represented as two green segments(Image 4).
62
-
63
-
Properties shown here only represent a part of what ImageJS analysis is capable of. To learn more about our analysis tools you can visit Analysis section.
78
+
To learn more about our analysis tools you can visit our ROI Analysis section.
Copy file name to clipboardExpand all lines: docs/Features/Regions of interest/Regions of interest.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
This section is dedicated to analysis of mask and its specific regions. ImageJS is first and foremost an analyzer of particles and analysis of regions of interest. Therefore there are tools that help detecting particles as well as determining their size, shape position and direction.
1
+
This section is dedicated to regions' analysis of mask and its specific regions. Regions of Interest (ROI) are areas or regions within an image that are selected for further analysis, processing, or attention due to their relevance to a particular task or objective. ImageJS can be an analyzer of particles and analysis of regions of interest. Therefore there are tools that help detecting particles as well as determining their size, shape position and direction.
Copy file name to clipboardExpand all lines: docs/Getting started.md
+10-21Lines changed: 10 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,24 +39,23 @@ Local loading uses `readSync` function with indicated filepath:
39
39
```ts
40
40
import { readSync } from'image-js';
41
41
42
-
let parsedImage =readSync('../example.jpg');
42
+
const parsedImage =readSync('../example.jpg');
43
43
```
44
44
45
-
It gets an image
46
45
:::tip
47
46
Node.js can also load an image via `fetch` function. To get more information take a look at "Browser" part of this section.
48
47
:::
49
48
50
-
Once the image is loaded, it returns an instance of the `Image` class, so its methods can be applied. For example, if you want to apply an [invert filter](/Features/Filters/Invert.md'internal link on invert filter') you can use the invert method:
49
+
Once the image is loaded, it returns an instance of the `Image` class, so its methods can be applied.
51
50
52
51
```ts
53
-
image=image.invert();
52
+
constimage =parsedImage.invert();
54
53
```
55
54
56
55
To save an image use `writeSync` function:
57
56
58
57
```ts
59
-
writeSync('example.jpg', image);
58
+
writeSync('../example.jpg', image);
60
59
```
61
60
62
61
Image format is automatically identified based on the extension typed by the user. In this case it's `'.jpg'`.
@@ -66,9 +65,9 @@ So, in the end you should get a code like this.
0 commit comments