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: blog/release.md
+49-12Lines changed: 49 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,12 +73,13 @@ This change makes the Image constructor more explicit by requiring you to specif
73
73
74
74
#### Coordinate System Changes
75
75
76
-
Coordinates are now represented using `Point` objects instead of arrays. This change affects methods that require coordinate input like cropping, drawing, and pixel manipulation.
76
+
Coordinates are now represented using `Point` objects instead of arrays. This change affects methods that require coordinate input like cropping, drawing, pixel manipulation etc.
77
77
78
78
```ts
79
79
// Before
80
80
const croppedImage =img.crop({
81
-
origin: [10, 10],
81
+
x:10,
82
+
y:10
82
83
width: 10,
83
84
height: 10,
84
85
});
@@ -90,7 +91,7 @@ const croppedImage = img.crop({
90
91
});
91
92
```
92
93
93
-
Images also include an `origin` that tracks their position relative to their parent image. When you crop an image, the cropped section remembers where it came from in the original image.
94
+
Images also include an `origin` that tracks their position relative to their parent's `origin`. When you crop an image, the cropped section remembers where it came from in the original image.
It is a more explicit and self-documenting code.It also eliminates confusion about array order (column vs row).
106
+
It is a more explicit and self-documenting code.It also eliminates confusion about array order (column vs row).
106
107
107
108
### Masks
108
109
@@ -122,7 +123,34 @@ const mask = new Mask(10, 10);
122
123
123
124
The new `Mask` class uses 1 byte per pixel (vs 8 pixels per byte), trading ~8x memory usage for significantly faster bit operations and simpler data manipulation.
124
125
125
-
### Points
126
+
### Regions of Interest
127
+
128
+
API for handling of regions of interest has also been changed.
129
+
ROI creation methods like `fromMask()` and `fromWatershed()` are now standalone functions `fromMask()` and `watershed()`.
130
+
131
+
```ts
132
+
//Before
133
+
import { Image } from'image-js';
134
+
135
+
const roiManager =mask.getRoiManager();
136
+
roiManager.fromMask(mask);
137
+
const rois =roiManager.getRois();
138
+
```
139
+
140
+
```ts
141
+
//After
142
+
import { Image, fromMask } from'image-js';
143
+
144
+
const roiManager =fromMask(mask);
145
+
const rois =roiManager.getRois();
146
+
```
147
+
148
+
This simplifies the process of creating a map of regions of interest and eliminates the need for a separate initialization step, providing a more direct and functional approach to ROI creation.
149
+
150
+
For more information, please, visit these tutorials:
151
+
152
+
-[Image segmentation with `threshold()` and `fromMask()`](../docs/Tutorials/Image%20segmentation%20with%20threshold)
153
+
-[Image segmentation with `watershed()`](../docs/Tutorials/Image%20segmentation%20with%20watershed)
126
154
127
155
### Sobel and Scharr filters
128
156
@@ -174,9 +202,7 @@ Several methods have been renamed for consistency:
174
202
175
203
`img.colorDepth()` ➡️ `img.convertBitDepth()`
176
204
177
-
`img.fromWatershed()` ➡️ `img.watershed()`
178
-
179
-
Consistent naming follows common conventions ("draw\*" for rendering, "clone" for copying objects).
205
+
`img.mask()` ➡️ `img.threshold()`
180
206
181
207
### Compatibility requirements
182
208
@@ -187,18 +213,29 @@ Consistent naming follows common conventions ("draw\*" for rendering, "clone" fo
187
213
188
214
The following deprecated features have been removed:
189
215
216
+
#### Images
217
+
190
218
-`countAlphaPixel()` - Use custom pixel counting with `getPixel()`
191
-
-`paintLabels()`- Feature was removed due to dependency issues. We plan to add it back in the future updates.
219
+
-`paintLabels()`and `roi.paint()` - Features were removed due to dependency issues. We plan to add it back in the future updates.
192
220
-`warpingFourPoints()` - Use `getPerspectiveWarp()` + `transform()`.
193
221
- 32-bit color depth has been currently removed. We plan to add it back in the future updates as well.
194
222
-`CMYK` and `HSL` color models have been removed.
195
223
-`insert()` has been removed.
196
224
-`abs()` has been removed.
197
225
-`paintMasks()` has been removed. Use `paintMask()`+ `for` loop.
198
-
-`mergeRois()` has been removed.
199
226
-`clearBit()` and `toggleBit()` have been removed, due to changes in `Mask`
200
227
data representation (see ["Masks"](#masks)).
201
-
-`colsInfo()` and `rowsInfo()` in `Roi` have been removed.
228
+
229
+
#### ROIs and its management
230
+
231
+
-`colsInfo()` and `rowsInfo()` have been removed.
232
+
-`fromPoints()` has been removed.
233
+
-`fromMaxima()` has been removed.
234
+
-`fromMaskConnectedComponentLabelingAlgorithm()` and `getAnalysisMasks()` have been removed.
235
+
-`findCorrespondingRoi()` has been removed.
236
+
-`resetPainted()` has been removed.
237
+
-`mergeRoi()` and `mergeRois()` have been removed.
238
+
-`minX`,`minY`,`meanX`,`meanY`,`maxX`,`maxY` have been removed. Use ROI's `position`, combined with its `width` and `height`.
`warpingFourPoints()` has been deprecated. Now you have [`getPerspectiveWarp()`](../docs/Features/Geometry/Get%20Perspective%20Warp%20Matrix) that returns a matrix that can be applied on the image of interest in a new `transform()`.
288
+
`warpingFourPoints()` has been removed. Now you have [`getPerspectiveWarp()`](../docs/Features/Geometry/Get%20Perspective%20Warp%20Matrix) that returns a matrix that can be applied on the image of interest in a new `transform()`.
0 commit comments