Skip to content

Commit d91cf57

Browse files
feat(ROI): add new property filledSurface (#314)
feat(ROI): add new property filledSurface (#314) * test: update snapshots with filledSurface property * refactor: calculate filledSurface without helper function * chore: fix prettier error
1 parent 09932c7 commit d91cf57

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/roi/Roi.ts

+5
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ export class Roi {
275275
return (2 * Math.sqrt(this.surface * Math.PI)) / this.perimeter;
276276
}
277277

278+
get filledSurface() {
279+
return this.surface + this.holesInfo.surface;
280+
}
281+
278282
/**
279283
* Calculates solidity of the ROI
280284
*/
@@ -327,6 +331,7 @@ export class Roi {
327331
perimeter: this.perimeter,
328332
convexHull: this.convexHull,
329333
mbr: this.mbr,
334+
filledSurface: this.filledSurface,
330335
centroid: this.centroid,
331336
};
332337
}

src/roi/__tests__/__snapshots__/computeRois.test.ts.snap

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ exports[`3x3 mask 1`] = `
6666
},
6767
},
6868
"fillRatio": 1,
69+
"filledSurface": 4,
6970
"height": 2,
7071
"id": 1,
7172
"mbr": {
@@ -165,6 +166,7 @@ exports[`3x3 mask 1`] = `
165166
},
166167
},
167168
"fillRatio": 1,
169+
"filledSurface": 1,
168170
"height": 1,
169171
"id": 2,
170172
"mbr": {
@@ -277,6 +279,7 @@ exports[`3x3 mask 2`] = `
277279
},
278280
},
279281
"fillRatio": 1,
282+
"filledSurface": 4,
280283
"height": 2,
281284
"id": -1,
282285
"mbr": {

0 commit comments

Comments
 (0)