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
+47-11Lines changed: 47 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ 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
@@ -90,7 +90,7 @@ const croppedImage = img.crop({
90
90
});
91
91
```
92
92
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.
93
+
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).
105
+
It is a more explicit and self-documenting code.It also eliminates confusion about array order (column vs row).
106
106
107
107
### Masks
108
108
@@ -122,7 +122,34 @@ const mask = new Mask(10, 10);
122
122
123
123
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
124
125
-
### Points
125
+
### Regions of Interest
126
+
127
+
API for handling of regions of interest has also been changed.
128
+
ROI creation methods like `fromMask()` and `fromWatershed()` are now standalone functions `fromMask()` and `watershed()`.
129
+
130
+
```ts
131
+
//Before
132
+
import { Image } from'image-js';
133
+
134
+
const roiManager =mask.getRoiManager();
135
+
roiManager.fromMask(mask);
136
+
const rois =roiManager.getRois();
137
+
```
138
+
139
+
```ts
140
+
//After
141
+
import { Image, fromMask } from'image-js';
142
+
143
+
const roiManager =fromMask(mask);
144
+
const rois =roiManager.getRois();
145
+
```
146
+
147
+
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.
148
+
149
+
For more information, please, visit these tutorials:
150
+
151
+
-[Image segmentation with `threshold()` and `fromMask()`](../docs/Tutorials/Image%20segmentation%20with%20threshold)
152
+
-[Image segmentation with `watershed()`](../docs/Tutorials/Image%20segmentation%20with%20watershed)
126
153
127
154
### Sobel and Scharr filters
128
155
@@ -174,9 +201,7 @@ Several methods have been renamed for consistency:
174
201
175
202
`img.colorDepth()` ➡️ `img.convertBitDepth()`
176
203
177
-
`img.fromWatershed()` ➡️ `img.watershed()`
178
-
179
-
Consistent naming follows common conventions ("draw\*" for rendering, "clone" for copying objects).
204
+
`img.mask()` ➡️ `img.threshold()`
180
205
181
206
### Compatibility requirements
182
207
@@ -187,18 +212,29 @@ Consistent naming follows common conventions ("draw\*" for rendering, "clone" fo
187
212
188
213
The following deprecated features have been removed:
189
214
215
+
#### Images
216
+
190
217
-`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.
218
+
-`paintLabels()`and `roi.paint()` - Features were removed due to dependency issues. We plan to add it back in the future updates.
192
219
-`warpingFourPoints()` - Use `getPerspectiveWarp()` + `transform()`.
193
220
- 32-bit color depth has been currently removed. We plan to add it back in the future updates as well.
194
221
-`CMYK` and `HSL` color models have been removed.
195
222
-`insert()` has been removed.
196
223
-`abs()` has been removed.
197
224
-`paintMasks()` has been removed. Use `paintMask()`+ `for` loop.
198
-
-`mergeRois()` has been removed.
199
225
-`clearBit()` and `toggleBit()` have been removed, due to changes in `Mask`
200
226
data representation (see ["Masks"](#masks)).
201
-
-`colsInfo()` and `rowsInfo()` in `Roi` have been removed.
227
+
228
+
#### ROIs and its management
229
+
230
+
-`colsInfo()` and `rowsInfo()` have been removed.
231
+
-`fromPoints()` has been removed.
232
+
-`fromMaxima()` has been removed.
233
+
-`fromMaskConnectedComponentLabelingAlgorithm()` and `getAnalysisMasks()` have been removed.
234
+
-`findCorrespondingRoi()` has been removed.
235
+
-`resetPainted()` has been removed.
236
+
-`mergeRoi()` and `mergeRois()` have been removed.
237
+
-`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()`.
287
+
`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