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: src/adapters/Cornerstone/Segmentation_4X.js
+63-14
Original file line number
Diff line number
Diff line change
@@ -264,6 +264,8 @@ function _createSegFromImages(images, isMultiframe, options) {
264
264
* @param {*} metadataProvider.
265
265
* @param {bool} skipOverlapping - skip checks for overlapping segs, default value false.
266
266
* @param {number} tolerance - default value 1.e-3.
267
+
* @param {bool} binarizeFractionalSegs - binarize fractional segmentation by thresholding - default value true.
268
+
* @param {number} fractionalSegsThreshold - thresholding parameter for fractional segmentations - default value 0.8 (80% respect to the maximum value).
267
269
*
268
270
* @return {[]ArrayBuffer}a list of array buffer for each labelMap
269
271
* @return {Object} an object from which the segment metadata can be derived
"This segmentation object is actually binary... processing as such."
1269
+
);
1247
1270
1248
-
if(!onlyMaxAndZero){
1249
-
// This is a fractional segmentation, which is not currently supported.
1250
-
return;
1271
+
returnpixelData;
1251
1272
}
1252
1273
1253
-
log.warn(
1254
-
"This segmentation object is actually binary... processing as such."
1255
-
);
1274
+
// This is a fractional segmentation, which is not currently supported.
1275
+
if(binarizeFractionalSegs){
1276
+
console.warn(
1277
+
"This segmentation object is fractional. Fractional segmentations are not supported. Computing binary labelMap by thresholding (80% from the maximum value)."
1278
+
);
1279
+
// IDC: binarize fractional segmentation if requested
1280
+
1281
+
// we calculcate the maximum since unfortunatly it looks like
1282
+
// (at least for IDC datasets) the maximum value is the array
1283
+
// is not the DICOM attirbute MaximumFractionalValue
0 commit comments