image-js 1.0.0-alpha.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -2
- package/README.md +37 -0
- package/dist/image-js.esm.js +33179 -0
- package/dist/image-js.esm.js.map +1 -0
- package/dist/image-js.esm.min.js +3 -0
- package/dist/image-js.esm.min.js.map +1 -0
- package/dist/image-js.umd.js +33324 -0
- package/dist/image-js.umd.js.map +1 -0
- package/dist/image-js.umd.min.js +3 -0
- package/dist/image-js.umd.min.js.map +1 -0
- package/dist-types/image-js.d.ts +4260 -0
- package/lib/Image.d.ts +447 -71
- package/lib/Image.d.ts.map +1 -1
- package/lib/Image.js +751 -127
- package/lib/Image.js.map +1 -1
- package/lib/Mask.d.ts +378 -0
- package/lib/Mask.d.ts.map +1 -0
- package/lib/Mask.js +557 -0
- package/lib/Mask.js.map +1 -0
- package/lib/Stack.d.ts +127 -0
- package/lib/Stack.d.ts.map +1 -0
- package/lib/Stack.js +165 -0
- package/lib/Stack.js.map +1 -0
- package/lib/align/affineTransfrom/affineFitFunction.d.ts +10 -0
- package/lib/align/affineTransfrom/affineFitFunction.d.ts.map +1 -0
- package/lib/align/affineTransfrom/affineFitFunction.js +21 -0
- package/lib/align/affineTransfrom/affineFitFunction.js.map +1 -0
- package/lib/align/affineTransfrom/applyAffineTransform.d.ts +10 -0
- package/lib/align/affineTransfrom/applyAffineTransform.d.ts.map +1 -0
- package/lib/align/affineTransfrom/applyAffineTransform.js +19 -0
- package/lib/align/affineTransfrom/applyAffineTransform.js.map +1 -0
- package/lib/align/affineTransfrom/createAffineTransformModel.d.ts +10 -0
- package/lib/align/affineTransfrom/createAffineTransformModel.d.ts.map +1 -0
- package/lib/align/affineTransfrom/createAffineTransformModel.js +23 -0
- package/lib/align/affineTransfrom/createAffineTransformModel.js.map +1 -0
- package/lib/align/affineTransfrom/drawResult.d.ts +12 -0
- package/lib/align/affineTransfrom/drawResult.d.ts.map +1 -0
- package/lib/align/affineTransfrom/drawResult.js +38 -0
- package/lib/align/affineTransfrom/drawResult.js.map +1 -0
- package/lib/align/affineTransfrom/getAffineTransform.d.ts +97 -0
- package/lib/align/affineTransfrom/getAffineTransform.d.ts.map +1 -0
- package/lib/align/affineTransfrom/getAffineTransform.js +145 -0
- package/lib/align/affineTransfrom/getAffineTransform.js.map +1 -0
- package/lib/align/affineTransfrom/getEuclideanDistance.d.ts +9 -0
- package/lib/align/affineTransfrom/getEuclideanDistance.d.ts.map +1 -0
- package/lib/align/affineTransfrom/getEuclideanDistance.js +10 -0
- package/lib/align/affineTransfrom/getEuclideanDistance.js.map +1 -0
- package/lib/align/affineTransfrom/getMatrixFromPoints.d.ts +10 -0
- package/lib/align/affineTransfrom/getMatrixFromPoints.d.ts.map +1 -0
- package/lib/align/affineTransfrom/getMatrixFromPoints.js +17 -0
- package/lib/align/affineTransfrom/getMatrixFromPoints.js.map +1 -0
- package/lib/align/affineTransfrom/getPointsFromMatrix.d.ts +9 -0
- package/lib/align/affineTransfrom/getPointsFromMatrix.d.ts.map +1 -0
- package/lib/align/affineTransfrom/getPointsFromMatrix.js +13 -0
- package/lib/align/affineTransfrom/getPointsFromMatrix.js.map +1 -0
- package/lib/align/affineTransfrom/utils/getSourceWithoutMargins.d.ts +11 -0
- package/lib/align/affineTransfrom/utils/getSourceWithoutMargins.d.ts.map +1 -0
- package/lib/align/affineTransfrom/utils/getSourceWithoutMargins.js +17 -0
- package/lib/align/affineTransfrom/utils/getSourceWithoutMargins.js.map +1 -0
- package/lib/align/alignMinDifference.d.ts +25 -0
- package/lib/align/alignMinDifference.d.ts.map +1 -0
- package/lib/align/alignMinDifference.js +79 -0
- package/lib/align/alignMinDifference.js.map +1 -0
- package/lib/align/index.d.ts +3 -0
- package/lib/align/index.d.ts.map +1 -0
- package/lib/align/index.js +3 -0
- package/lib/align/index.js.map +1 -0
- package/lib/compare/add.d.ts +10 -0
- package/lib/compare/add.d.ts.map +1 -0
- package/lib/compare/add.js +32 -0
- package/lib/compare/add.js.map +1 -0
- package/lib/compare/computePsnr.d.ts +11 -0
- package/lib/compare/computePsnr.d.ts.map +1 -0
- package/lib/compare/computePsnr.js +14 -0
- package/lib/compare/computePsnr.js.map +1 -0
- package/lib/compare/computeRmse.d.ts +18 -0
- package/lib/compare/computeRmse.d.ts.map +1 -0
- package/lib/compare/computeRmse.js +30 -0
- package/lib/compare/computeRmse.js.map +1 -0
- package/lib/compare/divide.d.ts +22 -0
- package/lib/compare/divide.d.ts.map +1 -0
- package/lib/compare/divide.js +31 -0
- package/lib/compare/divide.js.map +1 -0
- package/lib/compare/index.d.ts +7 -0
- package/lib/compare/index.d.ts.map +1 -0
- package/lib/compare/index.js +7 -0
- package/lib/compare/index.js.map +1 -0
- package/lib/compare/multiply.d.ts +22 -0
- package/lib/compare/multiply.d.ts.map +1 -0
- package/lib/compare/multiply.js +28 -0
- package/lib/compare/multiply.js.map +1 -0
- package/lib/compare/subtract.d.ts +13 -0
- package/lib/compare/subtract.d.ts.map +1 -0
- package/lib/compare/subtract.js +58 -0
- package/lib/compare/subtract.js.map +1 -0
- package/lib/compute/getExtrema.d.ts +33 -0
- package/lib/compute/getExtrema.d.ts.map +1 -0
- package/lib/compute/getExtrema.js +72 -0
- package/lib/compute/getExtrema.js.map +1 -0
- package/lib/compute/histogram.d.ts +12 -4
- package/lib/compute/histogram.d.ts.map +1 -1
- package/lib/compute/histogram.js +17 -11
- package/lib/compute/histogram.js.map +1 -1
- package/lib/compute/index.d.ts +5 -1
- package/lib/compute/index.d.ts.map +1 -1
- package/lib/compute/index.js +5 -6
- package/lib/compute/index.js.map +1 -1
- package/lib/compute/mean.d.ts +17 -0
- package/lib/compute/mean.d.ts.map +1 -0
- package/lib/compute/mean.js +37 -0
- package/lib/compute/mean.js.map +1 -0
- package/lib/compute/median.d.ts +16 -0
- package/lib/compute/median.d.ts.map +1 -0
- package/lib/compute/median.js +37 -0
- package/lib/compute/median.js.map +1 -0
- package/lib/compute/variance.d.ts +17 -0
- package/lib/compute/variance.d.ts.map +1 -0
- package/lib/compute/variance.js +33 -0
- package/lib/compute/variance.js.map +1 -0
- package/lib/correctColor/correctColor.d.ts +22 -0
- package/lib/correctColor/correctColor.d.ts.map +1 -0
- package/lib/correctColor/correctColor.js +75 -0
- package/lib/correctColor/correctColor.js.map +1 -0
- package/lib/correctColor/index.d.ts +2 -0
- package/lib/correctColor/index.d.ts.map +1 -0
- package/lib/correctColor/index.js +2 -0
- package/lib/correctColor/index.js.map +1 -0
- package/lib/correctColor/utils/formatData.d.ts +37 -0
- package/lib/correctColor/utils/formatData.d.ts.map +1 -0
- package/lib/correctColor/utils/formatData.js +60 -0
- package/lib/correctColor/utils/formatData.js.map +1 -0
- package/lib/correctColor/utils/getImageColors.d.ts +9 -0
- package/lib/correctColor/utils/getImageColors.d.ts.map +1 -0
- package/lib/correctColor/utils/getImageColors.js +19 -0
- package/lib/correctColor/utils/getImageColors.js.map +1 -0
- package/lib/correctColor/utils/referenceColorCard.d.ts +42 -0
- package/lib/correctColor/utils/referenceColorCard.d.ts.map +1 -0
- package/lib/correctColor/utils/referenceColorCard.js +146 -0
- package/lib/correctColor/utils/referenceColorCard.js.map +1 -0
- package/lib/draw/drawCircleOnImage.d.ts +28 -0
- package/lib/draw/drawCircleOnImage.d.ts.map +1 -0
- package/lib/draw/drawCircleOnImage.js +75 -0
- package/lib/draw/drawCircleOnImage.js.map +1 -0
- package/lib/draw/drawLineOnImage.d.ts +28 -0
- package/lib/draw/drawLineOnImage.d.ts.map +1 -0
- package/lib/draw/drawLineOnImage.js +27 -0
- package/lib/draw/drawLineOnImage.js.map +1 -0
- package/lib/draw/drawLineOnMask.d.ts +23 -0
- package/lib/draw/drawLineOnMask.d.ts.map +1 -0
- package/lib/draw/drawLineOnMask.js +19 -0
- package/lib/draw/drawLineOnMask.js.map +1 -0
- package/lib/draw/drawMarker.d.ts +36 -0
- package/lib/draw/drawMarker.d.ts.map +1 -0
- package/lib/draw/drawMarker.js +62 -0
- package/lib/draw/drawMarker.js.map +1 -0
- package/lib/draw/drawMarkers.d.ts +12 -0
- package/lib/draw/drawMarkers.d.ts.map +1 -0
- package/lib/draw/drawMarkers.js +17 -0
- package/lib/draw/drawMarkers.js.map +1 -0
- package/lib/draw/drawPoints.d.ts +22 -0
- package/lib/draw/drawPoints.d.ts.map +1 -0
- package/lib/draw/drawPoints.js +32 -0
- package/lib/draw/drawPoints.js.map +1 -0
- package/lib/draw/drawPolygonOnImage.d.ts +24 -0
- package/lib/draw/drawPolygonOnImage.d.ts.map +1 -0
- package/lib/draw/drawPolygonOnImage.js +44 -0
- package/lib/draw/drawPolygonOnImage.js.map +1 -0
- package/lib/draw/drawPolygonOnMask.d.ts +23 -0
- package/lib/draw/drawPolygonOnMask.d.ts.map +1 -0
- package/lib/draw/drawPolygonOnMask.js +35 -0
- package/lib/draw/drawPolygonOnMask.js.map +1 -0
- package/lib/draw/drawPolylineOnImage.d.ts +27 -0
- package/lib/draw/drawPolylineOnImage.d.ts.map +1 -0
- package/lib/draw/drawPolylineOnImage.js +26 -0
- package/lib/draw/drawPolylineOnImage.js.map +1 -0
- package/lib/draw/drawPolylineOnMask.d.ts +22 -0
- package/lib/draw/drawPolylineOnMask.d.ts.map +1 -0
- package/lib/draw/drawPolylineOnMask.js +18 -0
- package/lib/draw/drawPolylineOnMask.js.map +1 -0
- package/lib/draw/drawRectangle.d.ts +37 -0
- package/lib/draw/drawRectangle.d.ts.map +1 -0
- package/lib/draw/drawRectangle.js +50 -0
- package/lib/draw/drawRectangle.js.map +1 -0
- package/lib/draw/index.d.ts +12 -0
- package/lib/draw/index.d.ts.map +1 -0
- package/lib/draw/index.js +12 -0
- package/lib/draw/index.js.map +1 -0
- package/lib/draw/utils/deleteDuplicates.d.ts +8 -0
- package/lib/draw/utils/deleteDuplicates.d.ts.map +1 -0
- package/lib/draw/utils/deleteDuplicates.js +19 -0
- package/lib/draw/utils/deleteDuplicates.js.map +1 -0
- package/lib/draw/utils/roundPoint.d.ts +8 -0
- package/lib/draw/utils/roundPoint.d.ts.map +1 -0
- package/lib/draw/utils/roundPoint.js +12 -0
- package/lib/draw/utils/roundPoint.js.map +1 -0
- package/lib/featureMatching/descriptors/getBrief.d.ts +15 -0
- package/lib/featureMatching/descriptors/getBrief.d.ts.map +1 -0
- package/lib/featureMatching/descriptors/getBrief.js +29 -0
- package/lib/featureMatching/descriptors/getBrief.js.map +1 -0
- package/lib/featureMatching/descriptors/getBriefDescriptors.d.ts +43 -0
- package/lib/featureMatching/descriptors/getBriefDescriptors.d.ts.map +1 -0
- package/lib/featureMatching/descriptors/getBriefDescriptors.js +58 -0
- package/lib/featureMatching/descriptors/getBriefDescriptors.js.map +1 -0
- package/lib/featureMatching/descriptors/utils/getKeypointPatch.d.ts +18 -0
- package/lib/featureMatching/descriptors/utils/getKeypointPatch.d.ts.map +1 -0
- package/lib/featureMatching/descriptors/utils/getKeypointPatch.js +32 -0
- package/lib/featureMatching/descriptors/utils/getKeypointPatch.js.map +1 -0
- package/lib/featureMatching/descriptors/utils/sliceBrief.d.ts +21 -0
- package/lib/featureMatching/descriptors/utils/sliceBrief.d.ts.map +1 -0
- package/lib/featureMatching/descriptors/utils/sliceBrief.js +17 -0
- package/lib/featureMatching/descriptors/utils/sliceBrief.js.map +1 -0
- package/lib/featureMatching/featureMatching.types.d.ts +26 -0
- package/lib/featureMatching/featureMatching.types.d.ts.map +1 -0
- package/lib/featureMatching/featureMatching.types.js +2 -0
- package/lib/featureMatching/featureMatching.types.js.map +1 -0
- package/lib/featureMatching/index.d.ts +13 -0
- package/lib/featureMatching/index.d.ts.map +1 -0
- package/lib/featureMatching/index.js +13 -0
- package/lib/featureMatching/index.js.map +1 -0
- package/lib/featureMatching/keypoints/getBestKeypointsInRadius.d.ts +9 -0
- package/lib/featureMatching/keypoints/getBestKeypointsInRadius.d.ts.map +1 -0
- package/lib/featureMatching/keypoints/getBestKeypointsInRadius.js +30 -0
- package/lib/featureMatching/keypoints/getBestKeypointsInRadius.js.map +1 -0
- package/lib/featureMatching/keypoints/getFastKeypoints.d.ts +53 -0
- package/lib/featureMatching/keypoints/getFastKeypoints.d.ts.map +1 -0
- package/lib/featureMatching/keypoints/getFastKeypoints.js +71 -0
- package/lib/featureMatching/keypoints/getFastKeypoints.js.map +1 -0
- package/lib/featureMatching/keypoints/getFastScore.d.ts +13 -0
- package/lib/featureMatching/keypoints/getFastScore.d.ts.map +1 -0
- package/lib/featureMatching/keypoints/getFastScore.js +25 -0
- package/lib/featureMatching/keypoints/getFastScore.js.map +1 -0
- package/lib/featureMatching/keypoints/getHarrisScore.d.ts +20 -0
- package/lib/featureMatching/keypoints/getHarrisScore.d.ts.map +1 -0
- package/lib/featureMatching/keypoints/getHarrisScore.js +55 -0
- package/lib/featureMatching/keypoints/getHarrisScore.js.map +1 -0
- package/lib/featureMatching/keypoints/getIntensityCentroid.d.ts +11 -0
- package/lib/featureMatching/keypoints/getIntensityCentroid.d.ts.map +1 -0
- package/lib/featureMatching/keypoints/getIntensityCentroid.js +30 -0
- package/lib/featureMatching/keypoints/getIntensityCentroid.js.map +1 -0
- package/lib/featureMatching/keypoints/getIntensityMoment.d.ts +22 -0
- package/lib/featureMatching/keypoints/getIntensityMoment.d.ts.map +1 -0
- package/lib/featureMatching/keypoints/getIntensityMoment.js +27 -0
- package/lib/featureMatching/keypoints/getIntensityMoment.js.map +1 -0
- package/lib/featureMatching/keypoints/getOrientedFastKeypoints.d.ts +26 -0
- package/lib/featureMatching/keypoints/getOrientedFastKeypoints.d.ts.map +1 -0
- package/lib/featureMatching/keypoints/getOrientedFastKeypoints.js +38 -0
- package/lib/featureMatching/keypoints/getOrientedFastKeypoints.js.map +1 -0
- package/lib/featureMatching/keypoints/getPatchIntensityCentroid.d.ts +13 -0
- package/lib/featureMatching/keypoints/getPatchIntensityCentroid.d.ts.map +1 -0
- package/lib/featureMatching/keypoints/getPatchIntensityCentroid.js +31 -0
- package/lib/featureMatching/keypoints/getPatchIntensityCentroid.js.map +1 -0
- package/lib/featureMatching/keypoints/getPatchIntensityMoment.d.ts +27 -0
- package/lib/featureMatching/keypoints/getPatchIntensityMoment.d.ts.map +1 -0
- package/lib/featureMatching/keypoints/getPatchIntensityMoment.js +29 -0
- package/lib/featureMatching/keypoints/getPatchIntensityMoment.js.map +1 -0
- package/lib/featureMatching/keypoints/isFastKeypoint.d.ts +26 -0
- package/lib/featureMatching/keypoints/isFastKeypoint.d.ts.map +1 -0
- package/lib/featureMatching/keypoints/isFastKeypoint.js +74 -0
- package/lib/featureMatching/keypoints/isFastKeypoint.js.map +1 -0
- package/lib/featureMatching/keypoints/utils/getDistanceMatrix.d.ts +9 -0
- package/lib/featureMatching/keypoints/utils/getDistanceMatrix.d.ts.map +1 -0
- package/lib/featureMatching/keypoints/utils/getDistanceMatrix.js +26 -0
- package/lib/featureMatching/keypoints/utils/getDistanceMatrix.js.map +1 -0
- package/lib/featureMatching/keypoints/utils/getKeypointsInRadius.d.ts +10 -0
- package/lib/featureMatching/keypoints/utils/getKeypointsInRadius.d.ts.map +1 -0
- package/lib/featureMatching/keypoints/utils/getKeypointsInRadius.js +26 -0
- package/lib/featureMatching/keypoints/utils/getKeypointsInRadius.js.map +1 -0
- package/lib/featureMatching/matching/bruteForceMatch.d.ts +36 -0
- package/lib/featureMatching/matching/bruteForceMatch.d.ts.map +1 -0
- package/lib/featureMatching/matching/bruteForceMatch.js +33 -0
- package/lib/featureMatching/matching/bruteForceMatch.js.map +1 -0
- package/lib/featureMatching/matching/filterEuclideanDistance.d.ts +21 -0
- package/lib/featureMatching/matching/filterEuclideanDistance.d.ts.map +1 -0
- package/lib/featureMatching/matching/filterEuclideanDistance.js +43 -0
- package/lib/featureMatching/matching/filterEuclideanDistance.js.map +1 -0
- package/lib/featureMatching/matching/filterSmallestDistanceMatches.d.ts +9 -0
- package/lib/featureMatching/matching/filterSmallestDistanceMatches.d.ts.map +1 -0
- package/lib/featureMatching/matching/filterSmallestDistanceMatches.js +25 -0
- package/lib/featureMatching/matching/filterSmallestDistanceMatches.js.map +1 -0
- package/lib/featureMatching/matching/getCrosscheckMatches.d.ts +19 -0
- package/lib/featureMatching/matching/getCrosscheckMatches.d.ts.map +1 -0
- package/lib/featureMatching/matching/getCrosscheckMatches.js +55 -0
- package/lib/featureMatching/matching/getCrosscheckMatches.js.map +1 -0
- package/lib/featureMatching/matching/getHammingDistance.d.ts +10 -0
- package/lib/featureMatching/matching/getHammingDistance.d.ts.map +1 -0
- package/lib/featureMatching/matching/getHammingDistance.js +15 -0
- package/lib/featureMatching/matching/getHammingDistance.js.map +1 -0
- package/lib/featureMatching/utils/checkBorderDistance.d.ts +11 -0
- package/lib/featureMatching/utils/checkBorderDistance.d.ts.map +1 -0
- package/lib/featureMatching/utils/checkBorderDistance.js +14 -0
- package/lib/featureMatching/utils/checkBorderDistance.js.map +1 -0
- package/lib/featureMatching/utils/compareIntensity.d.ts +19 -0
- package/lib/featureMatching/utils/compareIntensity.d.ts.map +1 -0
- package/lib/featureMatching/utils/compareIntensity.js +18 -0
- package/lib/featureMatching/utils/compareIntensity.js.map +1 -0
- package/lib/featureMatching/utils/extractSquareImage.d.ts +11 -0
- package/lib/featureMatching/utils/extractSquareImage.d.ts.map +1 -0
- package/lib/featureMatching/utils/extractSquareImage.js +20 -0
- package/lib/featureMatching/utils/extractSquareImage.js.map +1 -0
- package/lib/featureMatching/utils/getColors.d.ts +11 -0
- package/lib/featureMatching/utils/getColors.d.ts.map +1 -0
- package/lib/featureMatching/utils/getColors.js +25 -0
- package/lib/featureMatching/utils/getColors.js.map +1 -0
- package/lib/featureMatching/utils/getGaussianPoints.d.ts +23 -0
- package/lib/featureMatching/utils/getGaussianPoints.d.ts.map +1 -0
- package/lib/featureMatching/utils/getGaussianPoints.js +46 -0
- package/lib/featureMatching/utils/getGaussianPoints.js.map +1 -0
- package/lib/featureMatching/utils/getKeypointColor.d.ts +11 -0
- package/lib/featureMatching/utils/getKeypointColor.d.ts.map +1 -0
- package/lib/featureMatching/utils/getKeypointColor.js +21 -0
- package/lib/featureMatching/utils/getKeypointColor.js.map +1 -0
- package/lib/featureMatching/utils/getMatchColor.d.ts +11 -0
- package/lib/featureMatching/utils/getMatchColor.d.ts.map +1 -0
- package/lib/featureMatching/utils/getMatchColor.js +20 -0
- package/lib/featureMatching/utils/getMatchColor.js.map +1 -0
- package/lib/featureMatching/utils/sortByDistance.d.ts +8 -0
- package/lib/featureMatching/utils/sortByDistance.d.ts.map +1 -0
- package/lib/featureMatching/utils/sortByDistance.js +11 -0
- package/lib/featureMatching/utils/sortByDistance.js.map +1 -0
- package/lib/featureMatching/utils/sortBySourceDest.d.ts +14 -0
- package/lib/featureMatching/utils/sortBySourceDest.d.ts.map +1 -0
- package/lib/featureMatching/utils/sortBySourceDest.js +29 -0
- package/lib/featureMatching/utils/sortBySourceDest.js.map +1 -0
- package/lib/featureMatching/visualize/Montage.d.ts +84 -0
- package/lib/featureMatching/visualize/Montage.d.ts.map +1 -0
- package/lib/featureMatching/visualize/Montage.js +113 -0
- package/lib/featureMatching/visualize/Montage.js.map +1 -0
- package/lib/featureMatching/visualize/drawKeypoints.d.ts +55 -0
- package/lib/featureMatching/visualize/drawKeypoints.d.ts.map +1 -0
- package/lib/featureMatching/visualize/drawKeypoints.js +58 -0
- package/lib/featureMatching/visualize/drawKeypoints.js.map +1 -0
- package/lib/featureMatching/visualize/drawMatches.d.ts +42 -0
- package/lib/featureMatching/visualize/drawMatches.d.ts.map +1 -0
- package/lib/featureMatching/visualize/drawMatches.js +52 -0
- package/lib/featureMatching/visualize/drawMatches.js.map +1 -0
- package/lib/featureMatching/visualize/overlapImages.d.ts +30 -0
- package/lib/featureMatching/visualize/overlapImages.d.ts.map +1 -0
- package/lib/featureMatching/visualize/overlapImages.js +35 -0
- package/lib/featureMatching/visualize/overlapImages.js.map +1 -0
- package/lib/featureMatching/visualize/scaleKeypoints.d.ts +9 -0
- package/lib/featureMatching/visualize/scaleKeypoints.d.ts.map +1 -0
- package/lib/featureMatching/visualize/scaleKeypoints.js +20 -0
- package/lib/featureMatching/visualize/scaleKeypoints.js.map +1 -0
- package/lib/filters/and.d.ts +16 -0
- package/lib/filters/and.d.ts.map +1 -0
- package/lib/filters/and.js +24 -0
- package/lib/filters/and.js.map +1 -0
- package/lib/filters/blur.d.ts +28 -4
- package/lib/filters/blur.d.ts.map +1 -1
- package/lib/filters/blur.js +16 -8
- package/lib/filters/blur.js.map +1 -1
- package/lib/filters/convolution.d.ts +67 -6
- package/lib/filters/convolution.d.ts.map +1 -1
- package/lib/filters/convolution.js +124 -81
- package/lib/filters/convolution.js.map +1 -1
- package/lib/filters/derivativeFilter.d.ts +38 -0
- package/lib/filters/derivativeFilter.d.ts.map +1 -0
- package/lib/filters/derivativeFilter.js +26 -0
- package/lib/filters/derivativeFilter.js.map +1 -0
- package/lib/filters/flip.d.ts +20 -0
- package/lib/filters/flip.d.ts.map +1 -0
- package/lib/filters/flip.js +23 -0
- package/lib/filters/flip.js.map +1 -0
- package/lib/filters/flipX.d.ts +8 -0
- package/lib/filters/flipX.d.ts.map +1 -0
- package/lib/filters/flipX.js +24 -0
- package/lib/filters/flipX.js.map +1 -0
- package/lib/filters/flipY.d.ts +8 -0
- package/lib/filters/flipY.d.ts.map +1 -0
- package/lib/filters/flipY.js +24 -0
- package/lib/filters/flipY.js.map +1 -0
- package/lib/filters/gaussianBlur.d.ts +44 -9
- package/lib/filters/gaussianBlur.d.ts.map +1 -1
- package/lib/filters/gaussianBlur.js +28 -23
- package/lib/filters/gaussianBlur.js.map +1 -1
- package/lib/filters/gradientFilter.d.ts +51 -0
- package/lib/filters/gradientFilter.d.ts.map +1 -0
- package/lib/filters/gradientFilter.js +49 -0
- package/lib/filters/gradientFilter.js.map +1 -0
- package/lib/filters/hypotenuse.d.ts +16 -0
- package/lib/filters/hypotenuse.d.ts.map +1 -0
- package/lib/filters/hypotenuse.js +36 -0
- package/lib/filters/hypotenuse.js.map +1 -0
- package/lib/filters/increaseContrast.d.ts +21 -0
- package/lib/filters/increaseContrast.d.ts.map +1 -0
- package/lib/filters/increaseContrast.js +49 -0
- package/lib/filters/increaseContrast.js.map +1 -0
- package/lib/filters/index.d.ts +14 -4
- package/lib/filters/index.d.ts.map +1 -1
- package/lib/filters/index.js +14 -9
- package/lib/filters/index.js.map +1 -1
- package/lib/filters/invert.d.ts +9 -8
- package/lib/filters/invert.d.ts.map +1 -1
- package/lib/filters/invert.js +26 -11
- package/lib/filters/invert.js.map +1 -1
- package/lib/filters/level.d.ts +46 -0
- package/lib/filters/level.d.ts.map +1 -0
- package/lib/filters/level.js +63 -0
- package/lib/filters/level.js.map +1 -0
- package/lib/filters/medianFilter.d.ts +26 -0
- package/lib/filters/medianFilter.d.ts.map +1 -0
- package/lib/filters/medianFilter.js +42 -0
- package/lib/filters/medianFilter.js.map +1 -0
- package/lib/filters/or.d.ts +16 -0
- package/lib/filters/or.d.ts.map +1 -0
- package/lib/filters/or.js +24 -0
- package/lib/filters/or.js.map +1 -0
- package/lib/filters/pixelate.d.ts +24 -0
- package/lib/filters/pixelate.d.ts.map +1 -0
- package/lib/filters/pixelate.js +105 -0
- package/lib/filters/pixelate.js.map +1 -0
- package/lib/geometry/getPerspectiveWarp.d.ts +37 -0
- package/lib/geometry/getPerspectiveWarp.d.ts.map +1 -0
- package/lib/geometry/getPerspectiveWarp.js +131 -0
- package/lib/geometry/getPerspectiveWarp.js.map +1 -0
- package/lib/geometry/index.d.ts +6 -1
- package/lib/geometry/index.d.ts.map +1 -1
- package/lib/geometry/index.js +5 -6
- package/lib/geometry/index.js.map +1 -1
- package/lib/geometry/resize.d.ts +49 -0
- package/lib/geometry/resize.d.ts.map +1 -0
- package/lib/geometry/resize.js +87 -0
- package/lib/geometry/resize.js.map +1 -0
- package/lib/geometry/rotate.d.ts +10 -0
- package/lib/geometry/rotate.d.ts.map +1 -0
- package/lib/geometry/rotate.js +47 -0
- package/lib/geometry/rotate.js.map +1 -0
- package/lib/geometry/transform.d.ts +39 -6
- package/lib/geometry/transform.d.ts.map +1 -1
- package/lib/geometry/transform.js +90 -36
- package/lib/geometry/transform.js.map +1 -1
- package/lib/geometry/transformRotate.d.ts +24 -0
- package/lib/geometry/transformRotate.d.ts.map +1 -0
- package/lib/geometry/transformRotate.js +38 -0
- package/lib/geometry/transformRotate.js.map +1 -0
- package/lib/index.d.ts +24 -8
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +24 -13
- package/lib/index.js.map +1 -1
- package/lib/load/decode.d.ts +4 -3
- package/lib/load/decode.d.ts.map +1 -1
- package/lib/load/decode.js +17 -23
- package/lib/load/decode.js.map +1 -1
- package/lib/load/decodeJpeg.d.ts +3 -2
- package/lib/load/decodeJpeg.d.ts.map +1 -1
- package/lib/load/decodeJpeg.js +20 -10
- package/lib/load/decodeJpeg.js.map +1 -1
- package/lib/load/decodePng.d.ts +4 -3
- package/lib/load/decodePng.d.ts.map +1 -1
- package/lib/load/decodePng.js +30 -30
- package/lib/load/decodePng.js.map +1 -1
- package/lib/load/decodeTiff.d.ts +17 -0
- package/lib/load/decodeTiff.d.ts.map +1 -0
- package/lib/load/decodeTiff.js +57 -0
- package/lib/load/decodeTiff.js.map +1 -0
- package/lib/load/fetchURL.d.ts +7 -0
- package/lib/load/fetchURL.d.ts.map +1 -0
- package/lib/load/fetchURL.js +13 -0
- package/lib/load/fetchURL.js.map +1 -0
- package/lib/load/getMetadata.d.ts +16 -0
- package/lib/load/getMetadata.d.ts.map +1 -0
- package/lib/load/getMetadata.js +15 -0
- package/lib/load/getMetadata.js.map +1 -0
- package/lib/load/index.d.ts +9 -6
- package/lib/load/index.d.ts.map +1 -1
- package/lib/load/index.js +9 -11
- package/lib/load/index.js.map +1 -1
- package/lib/load/load.types.d.ts +8 -0
- package/lib/load/load.types.d.ts.map +1 -0
- package/lib/load/load.types.js +2 -0
- package/lib/load/load.types.js.map +1 -0
- package/lib/load/read.d.ts +9 -4
- package/lib/load/read.d.ts.map +1 -1
- package/lib/load/read.js +15 -14
- package/lib/load/read.js.map +1 -1
- package/lib/load/readCanvas.d.ts +6 -1
- package/lib/load/readCanvas.d.ts.map +1 -1
- package/lib/load/readCanvas.js +11 -12
- package/lib/load/readCanvas.js.map +1 -1
- package/lib/load/readImg.d.ts +7 -2
- package/lib/load/readImg.d.ts.map +1 -1
- package/lib/load/readImg.js +11 -10
- package/lib/load/readImg.js.map +1 -1
- package/lib/maskAnalysis/getBorderPoints.d.ts +12 -0
- package/lib/maskAnalysis/getBorderPoints.d.ts.map +1 -0
- package/lib/maskAnalysis/getBorderPoints.js +53 -0
- package/lib/maskAnalysis/getBorderPoints.js.map +1 -0
- package/lib/maskAnalysis/getConvexHull.d.ts +9 -0
- package/lib/maskAnalysis/getConvexHull.d.ts.map +1 -0
- package/lib/maskAnalysis/getConvexHull.js +23 -0
- package/lib/maskAnalysis/getConvexHull.js.map +1 -0
- package/lib/maskAnalysis/getFeret.d.ts +11 -0
- package/lib/maskAnalysis/getFeret.d.ts.map +1 -0
- package/lib/maskAnalysis/getFeret.js +181 -0
- package/lib/maskAnalysis/getFeret.js.map +1 -0
- package/lib/maskAnalysis/getMbr.d.ts +9 -0
- package/lib/maskAnalysis/getMbr.d.ts.map +1 -0
- package/lib/maskAnalysis/getMbr.js +13 -0
- package/lib/maskAnalysis/getMbr.js.map +1 -0
- package/lib/maskAnalysis/index.d.ts +2 -0
- package/lib/maskAnalysis/index.d.ts.map +1 -0
- package/lib/maskAnalysis/index.js +2 -0
- package/lib/maskAnalysis/index.js.map +1 -0
- package/lib/maskAnalysis/maskAnalysis.types.d.ts +97 -0
- package/lib/maskAnalysis/maskAnalysis.types.d.ts.map +1 -0
- package/lib/maskAnalysis/maskAnalysis.types.js +2 -0
- package/lib/maskAnalysis/maskAnalysis.types.js.map +1 -0
- package/lib/maskAnalysis/utils/getAngle.d.ts +19 -0
- package/lib/maskAnalysis/utils/getAngle.d.ts.map +1 -0
- package/lib/maskAnalysis/utils/getAngle.js +41 -0
- package/lib/maskAnalysis/utils/getAngle.js.map +1 -0
- package/lib/maskAnalysis/utils/getExtendedBorderPoints.d.ts +12 -0
- package/lib/maskAnalysis/utils/getExtendedBorderPoints.d.ts.map +1 -0
- package/lib/maskAnalysis/utils/getExtendedBorderPoints.js +20 -0
- package/lib/maskAnalysis/utils/getExtendedBorderPoints.js.map +1 -0
- package/lib/maskAnalysis/utils/getMbrAngle.d.ts +8 -0
- package/lib/maskAnalysis/utils/getMbrAngle.d.ts.map +1 -0
- package/lib/maskAnalysis/utils/getMbrAngle.js +20 -0
- package/lib/maskAnalysis/utils/getMbrAngle.js.map +1 -0
- package/lib/maskAnalysis/utils/getMbrFromPoints.d.ts +10 -0
- package/lib/maskAnalysis/utils/getMbrFromPoints.d.ts.map +1 -0
- package/lib/maskAnalysis/utils/getMbrFromPoints.js +102 -0
- package/lib/maskAnalysis/utils/getMbrFromPoints.js.map +1 -0
- package/lib/maskAnalysis/utils/monotoneChainConvexHull.d.ts +18 -0
- package/lib/maskAnalysis/utils/monotoneChainConvexHull.d.ts.map +1 -0
- package/lib/maskAnalysis/utils/monotoneChainConvexHull.js +44 -0
- package/lib/maskAnalysis/utils/monotoneChainConvexHull.js.map +1 -0
- package/lib/morphology/bottomHat.d.ts +18 -0
- package/lib/morphology/bottomHat.d.ts.map +1 -0
- package/lib/morphology/bottomHat.js +38 -0
- package/lib/morphology/bottomHat.js.map +1 -0
- package/lib/morphology/cannyEdgeDetector.d.ts +44 -0
- package/lib/morphology/cannyEdgeDetector.d.ts.map +1 -0
- package/lib/morphology/cannyEdgeDetector.js +146 -0
- package/lib/morphology/cannyEdgeDetector.js.map +1 -0
- package/lib/morphology/clearBorder.d.ts +26 -0
- package/lib/morphology/clearBorder.d.ts.map +1 -0
- package/lib/morphology/clearBorder.js +19 -0
- package/lib/morphology/clearBorder.js.map +1 -0
- package/lib/morphology/close.d.ts +18 -0
- package/lib/morphology/close.d.ts.map +1 -0
- package/lib/morphology/close.js +33 -0
- package/lib/morphology/close.js.map +1 -0
- package/lib/morphology/dilate.d.ts +18 -0
- package/lib/morphology/dilate.d.ts.map +1 -0
- package/lib/morphology/dilate.js +191 -0
- package/lib/morphology/dilate.js.map +1 -0
- package/lib/morphology/erode.d.ts +18 -0
- package/lib/morphology/erode.d.ts.map +1 -0
- package/lib/morphology/erode.js +191 -0
- package/lib/morphology/erode.js.map +1 -0
- package/lib/morphology/floodFill.d.ts +26 -0
- package/lib/morphology/floodFill.d.ts.map +1 -0
- package/lib/morphology/floodFill.js +18 -0
- package/lib/morphology/floodFill.js.map +1 -0
- package/lib/morphology/index.d.ts +12 -0
- package/lib/morphology/index.d.ts.map +1 -0
- package/lib/morphology/index.js +12 -0
- package/lib/morphology/index.js.map +1 -0
- package/lib/morphology/morphologicalGradient.d.ts +18 -0
- package/lib/morphology/morphologicalGradient.d.ts.map +1 -0
- package/lib/morphology/morphologicalGradient.js +34 -0
- package/lib/morphology/morphologicalGradient.js.map +1 -0
- package/lib/morphology/multipleFloodFill.d.ts +36 -0
- package/lib/morphology/multipleFloodFill.d.ts.map +1 -0
- package/lib/morphology/multipleFloodFill.js +87 -0
- package/lib/morphology/multipleFloodFill.js.map +1 -0
- package/lib/morphology/open.d.ts +18 -0
- package/lib/morphology/open.d.ts.map +1 -0
- package/lib/morphology/open.js +35 -0
- package/lib/morphology/open.js.map +1 -0
- package/lib/morphology/solidFill.d.ts +20 -0
- package/lib/morphology/solidFill.d.ts.map +1 -0
- package/lib/morphology/solidFill.js +15 -0
- package/lib/morphology/solidFill.js.map +1 -0
- package/lib/morphology/topHat.d.ts +18 -0
- package/lib/morphology/topHat.d.ts.map +1 -0
- package/lib/morphology/topHat.js +36 -0
- package/lib/morphology/topHat.js.map +1 -0
- package/lib/operations/convertBitDepth.d.ts +16 -0
- package/lib/operations/convertBitDepth.d.ts.map +1 -0
- package/lib/operations/convertBitDepth.js +56 -0
- package/lib/operations/convertBitDepth.js.map +1 -0
- package/lib/operations/convertColor.d.ts +33 -3
- package/lib/operations/convertColor.d.ts.map +1 -1
- package/lib/operations/convertColor.js +114 -46
- package/lib/operations/convertColor.js.map +1 -1
- package/lib/operations/copyTo.d.ts +17 -0
- package/lib/operations/copyTo.d.ts.map +1 -0
- package/lib/operations/copyTo.js +36 -0
- package/lib/operations/copyTo.js.map +1 -0
- package/lib/operations/correctBackground.d.ts +27 -0
- package/lib/operations/correctBackground.d.ts.map +1 -0
- package/lib/operations/correctBackground.js +44 -0
- package/lib/operations/correctBackground.js.map +1 -0
- package/lib/operations/crop.d.ts +32 -0
- package/lib/operations/crop.d.ts.map +1 -0
- package/lib/operations/crop.js +48 -0
- package/lib/operations/crop.js.map +1 -0
- package/lib/operations/cropAlpha.d.ts +11 -0
- package/lib/operations/cropAlpha.d.ts.map +1 -0
- package/lib/operations/cropAlpha.js +70 -0
- package/lib/operations/cropAlpha.js.map +1 -0
- package/lib/operations/cropRectangle.d.ts +14 -0
- package/lib/operations/cropRectangle.d.ts.map +1 -0
- package/lib/operations/cropRectangle.js +75 -0
- package/lib/operations/cropRectangle.js.map +1 -0
- package/lib/operations/extendBorders.d.ts +30 -0
- package/lib/operations/extendBorders.d.ts.map +1 -0
- package/lib/operations/extendBorders.js +61 -0
- package/lib/operations/extendBorders.js.map +1 -0
- package/lib/operations/extract.d.ts +19 -0
- package/lib/operations/extract.d.ts.map +1 -0
- package/lib/operations/extract.js +41 -0
- package/lib/operations/extract.js.map +1 -0
- package/lib/operations/getMaskFromCannyEdge.d.ts +11 -0
- package/lib/operations/getMaskFromCannyEdge.d.ts.map +1 -0
- package/lib/operations/getMaskFromCannyEdge.js +35 -0
- package/lib/operations/getMaskFromCannyEdge.js.map +1 -0
- package/lib/operations/grey.d.ts +62 -0
- package/lib/operations/grey.d.ts.map +1 -0
- package/lib/operations/grey.js +84 -0
- package/lib/operations/grey.js.map +1 -0
- package/lib/operations/greyAlgorithms.d.ts +133 -0
- package/lib/operations/greyAlgorithms.d.ts.map +1 -0
- package/lib/operations/greyAlgorithms.js +205 -0
- package/lib/operations/greyAlgorithms.js.map +1 -0
- package/lib/operations/index.d.ts +16 -4
- package/lib/operations/index.d.ts.map +1 -1
- package/lib/operations/index.js +16 -9
- package/lib/operations/index.js.map +1 -1
- package/lib/operations/merge.d.ts +8 -0
- package/lib/operations/merge.d.ts.map +1 -0
- package/lib/operations/merge.js +51 -0
- package/lib/operations/merge.js.map +1 -0
- package/lib/operations/operations.types.d.ts +7 -0
- package/lib/operations/operations.types.d.ts.map +1 -0
- package/lib/operations/operations.types.js +2 -0
- package/lib/operations/operations.types.js.map +1 -0
- package/lib/operations/paintMaskOnImage.d.ts +33 -0
- package/lib/operations/paintMaskOnImage.d.ts.map +1 -0
- package/lib/operations/paintMaskOnImage.js +53 -0
- package/lib/operations/paintMaskOnImage.js.map +1 -0
- package/lib/operations/paintMaskOnMask.d.ts +27 -0
- package/lib/operations/paintMaskOnMask.d.ts.map +1 -0
- package/lib/operations/paintMaskOnMask.js +24 -0
- package/lib/operations/paintMaskOnMask.js.map +1 -0
- package/lib/operations/split.d.ts +6 -1
- package/lib/operations/split.d.ts.map +1 -1
- package/lib/operations/split.js +12 -8
- package/lib/operations/split.js.map +1 -1
- package/lib/operations/threshold.d.ts +55 -13
- package/lib/operations/threshold.d.ts.map +1 -1
- package/lib/operations/threshold.js +79 -45
- package/lib/operations/threshold.js.map +1 -1
- package/lib/operations/thresholds/huang.d.ts +7 -0
- package/lib/operations/thresholds/huang.d.ts.map +1 -0
- package/lib/operations/thresholds/huang.js +78 -0
- package/lib/operations/thresholds/huang.js.map +1 -0
- package/lib/operations/thresholds/intermodes.d.ts +7 -0
- package/lib/operations/thresholds/intermodes.d.ts.map +1 -0
- package/lib/operations/thresholds/intermodes.js +57 -0
- package/lib/operations/thresholds/intermodes.js.map +1 -0
- package/lib/operations/thresholds/isodata.d.ts +7 -0
- package/lib/operations/thresholds/isodata.d.ts.map +1 -0
- package/lib/operations/thresholds/isodata.js +50 -0
- package/lib/operations/thresholds/isodata.js.map +1 -0
- package/lib/operations/thresholds/li.d.ts +8 -0
- package/lib/operations/thresholds/li.d.ts.map +1 -0
- package/lib/operations/thresholds/li.js +73 -0
- package/lib/operations/thresholds/li.js.map +1 -0
- package/lib/operations/thresholds/maxEntropy.d.ts +8 -0
- package/lib/operations/thresholds/maxEntropy.d.ts.map +1 -0
- package/lib/operations/thresholds/maxEntropy.js +76 -0
- package/lib/operations/thresholds/maxEntropy.js.map +1 -0
- package/lib/operations/thresholds/mean.d.ts +8 -0
- package/lib/operations/thresholds/mean.d.ts.map +1 -0
- package/lib/operations/thresholds/mean.js +22 -0
- package/lib/operations/thresholds/mean.js.map +1 -0
- package/lib/operations/thresholds/minError.d.ts +8 -0
- package/lib/operations/thresholds/minError.d.ts.map +1 -0
- package/lib/operations/thresholds/minError.js +86 -0
- package/lib/operations/thresholds/minError.js.map +1 -0
- package/lib/operations/thresholds/minimum.d.ts +7 -0
- package/lib/operations/thresholds/minimum.d.ts.map +1 -0
- package/lib/operations/thresholds/minimum.js +74 -0
- package/lib/operations/thresholds/minimum.js.map +1 -0
- package/lib/operations/thresholds/moments.d.ts +8 -0
- package/lib/operations/thresholds/moments.d.ts.map +1 -0
- package/lib/operations/thresholds/moments.js +58 -0
- package/lib/operations/thresholds/moments.js.map +1 -0
- package/lib/operations/thresholds/otsu.d.ts +7 -1
- package/lib/operations/thresholds/otsu.d.ts.map +1 -1
- package/lib/operations/thresholds/otsu.js +7 -4
- package/lib/operations/thresholds/otsu.js.map +1 -1
- package/lib/operations/thresholds/percentile.d.ts +7 -0
- package/lib/operations/thresholds/percentile.d.ts.map +1 -0
- package/lib/operations/thresholds/percentile.js +35 -0
- package/lib/operations/thresholds/percentile.js.map +1 -0
- package/lib/operations/thresholds/renyiEntropy.d.ts +8 -0
- package/lib/operations/thresholds/renyiEntropy.d.ts.map +1 -0
- package/lib/operations/thresholds/renyiEntropy.js +127 -0
- package/lib/operations/thresholds/renyiEntropy.js.map +1 -0
- package/lib/operations/thresholds/shanbhag.d.ts +8 -0
- package/lib/operations/thresholds/shanbhag.d.ts.map +1 -0
- package/lib/operations/thresholds/shanbhag.js +72 -0
- package/lib/operations/thresholds/shanbhag.js.map +1 -0
- package/lib/operations/thresholds/triangle.d.ts +6 -1
- package/lib/operations/thresholds/triangle.d.ts.map +1 -1
- package/lib/operations/thresholds/triangle.js +7 -5
- package/lib/operations/thresholds/triangle.js.map +1 -1
- package/lib/operations/thresholds/yen.d.ts +8 -0
- package/lib/operations/thresholds/yen.d.ts.map +1 -0
- package/lib/operations/thresholds/yen.js +55 -0
- package/lib/operations/thresholds/yen.js.map +1 -0
- package/lib/point/operations.d.ts +10 -0
- package/lib/point/operations.d.ts.map +1 -0
- package/lib/point/operations.js +21 -0
- package/lib/point/operations.js.map +1 -0
- package/lib/roi/Roi.d.ts +218 -0
- package/lib/roi/Roi.d.ts.map +1 -0
- package/lib/roi/Roi.js +553 -0
- package/lib/roi/Roi.js.map +1 -0
- package/lib/roi/RoiMapManager.d.ts +59 -0
- package/lib/roi/RoiMapManager.d.ts.map +1 -0
- package/lib/roi/RoiMapManager.js +51 -0
- package/lib/roi/RoiMapManager.js.map +1 -0
- package/lib/roi/colorRois.d.ts +38 -0
- package/lib/roi/colorRois.d.ts.map +1 -0
- package/lib/roi/colorRois.js +41 -0
- package/lib/roi/colorRois.js.map +1 -0
- package/lib/roi/computeRois.d.ts +7 -0
- package/lib/roi/computeRois.d.ts.map +1 -0
- package/lib/roi/computeRois.js +81 -0
- package/lib/roi/computeRois.js.map +1 -0
- package/lib/roi/fromMask.d.ts +17 -0
- package/lib/roi/fromMask.d.ts.map +1 -0
- package/lib/roi/fromMask.js +139 -0
- package/lib/roi/fromMask.js.map +1 -0
- package/lib/roi/getBorderPoints.d.ts +12 -0
- package/lib/roi/getBorderPoints.d.ts.map +1 -0
- package/lib/roi/getBorderPoints.js +12 -0
- package/lib/roi/getBorderPoints.js.map +1 -0
- package/lib/roi/getMask.d.ts +17 -0
- package/lib/roi/getMask.d.ts.map +1 -0
- package/lib/roi/getMask.js +27 -0
- package/lib/roi/getMask.js.map +1 -0
- package/lib/roi/getRois.d.ts +33 -0
- package/lib/roi/getRois.d.ts.map +1 -0
- package/lib/roi/getRois.js +27 -0
- package/lib/roi/getRois.js.map +1 -0
- package/lib/roi/index.d.ts +11 -0
- package/lib/roi/index.d.ts.map +1 -0
- package/lib/roi/index.js +11 -0
- package/lib/roi/index.js.map +1 -0
- package/lib/roi/properties/getEllipse.d.ts +9 -0
- package/lib/roi/properties/getEllipse.d.ts.map +1 -0
- package/lib/roi/properties/getEllipse.js +96 -0
- package/lib/roi/properties/getEllipse.js.map +1 -0
- package/lib/roi/roi.types.d.ts +29 -0
- package/lib/roi/roi.types.d.ts.map +1 -0
- package/lib/roi/roi.types.js +2 -0
- package/lib/roi/roi.types.js.map +1 -0
- package/lib/roi/utils/colorMaps/getBinaryMap.d.ts +33 -0
- package/lib/roi/utils/colorMaps/getBinaryMap.d.ts.map +1 -0
- package/lib/roi/utils/colorMaps/getBinaryMap.js +27 -0
- package/lib/roi/utils/colorMaps/getBinaryMap.js.map +1 -0
- package/lib/roi/utils/colorMaps/getRainbowMap.d.ts +23 -0
- package/lib/roi/utils/colorMaps/getRainbowMap.d.ts.map +1 -0
- package/lib/roi/utils/colorMaps/getRainbowMap.js +37 -0
- package/lib/roi/utils/colorMaps/getRainbowMap.js.map +1 -0
- package/lib/roi/utils/colorMaps/getSaturationMap.d.ts +33 -0
- package/lib/roi/utils/colorMaps/getSaturationMap.d.ts.map +1 -0
- package/lib/roi/utils/colorMaps/getSaturationMap.js +32 -0
- package/lib/roi/utils/colorMaps/getSaturationMap.js.map +1 -0
- package/lib/roi/utils/getColorMap.d.ts +29 -0
- package/lib/roi/utils/getColorMap.d.ts.map +1 -0
- package/lib/roi/utils/getColorMap.js +19 -0
- package/lib/roi/utils/getColorMap.js.map +1 -0
- package/lib/roi/utils/hsvToRgb.d.ts +20 -0
- package/lib/roi/utils/hsvToRgb.d.ts.map +1 -0
- package/lib/roi/utils/hsvToRgb.js +53 -0
- package/lib/roi/utils/hsvToRgb.js.map +1 -0
- package/lib/roi/utils/rgbToNumber.d.ts +7 -0
- package/lib/roi/utils/rgbToNumber.d.ts.map +1 -0
- package/lib/roi/utils/rgbToNumber.js +9 -0
- package/lib/roi/utils/rgbToNumber.js.map +1 -0
- package/lib/roi/waterShed.d.ts +36 -0
- package/lib/roi/waterShed.d.ts.map +1 -0
- package/lib/roi/waterShed.js +91 -0
- package/lib/roi/waterShed.js.map +1 -0
- package/lib/save/encode.d.ts +24 -28
- package/lib/save/encode.d.ts.map +1 -1
- package/lib/save/encode.js +23 -23
- package/lib/save/encode.js.map +1 -1
- package/lib/save/encodeBmp.d.ts +9 -0
- package/lib/save/encodeBmp.d.ts.map +1 -0
- package/lib/save/encodeBmp.js +22 -0
- package/lib/save/encodeBmp.js.map +1 -0
- package/lib/save/encodeDataURL.d.ts +10 -0
- package/lib/save/encodeDataURL.d.ts.map +1 -0
- package/lib/save/encodeDataURL.js +15 -0
- package/lib/save/encodeDataURL.js.map +1 -0
- package/lib/save/encodeJpeg.d.ts +14 -3
- package/lib/save/encodeJpeg.d.ts.map +1 -1
- package/lib/save/encodeJpeg.js +16 -14
- package/lib/save/encodeJpeg.js.map +1 -1
- package/lib/save/encodePng.d.ts +11 -4
- package/lib/save/encodePng.d.ts.map +1 -1
- package/lib/save/encodePng.js +21 -6
- package/lib/save/encodePng.js.map +1 -1
- package/lib/save/index.d.ts +6 -5
- package/lib/save/index.d.ts.map +1 -1
- package/lib/save/index.js +6 -10
- package/lib/save/index.js.map +1 -1
- package/lib/save/write.d.ts +45 -6
- package/lib/save/write.d.ts.map +1 -1
- package/lib/save/write.js +58 -35
- package/lib/save/write.js.map +1 -1
- package/lib/save/writeCanvas.d.ts +30 -4
- package/lib/save/writeCanvas.d.ts.map +1 -1
- package/lib/save/writeCanvas.js +21 -14
- package/lib/save/writeCanvas.js.map +1 -1
- package/lib/ssim/compute_dssim.d.ts +12 -0
- package/lib/ssim/compute_dssim.d.ts.map +1 -0
- package/lib/ssim/compute_dssim.js +14 -0
- package/lib/ssim/compute_dssim.js.map +1 -0
- package/lib/ssim/compute_ssim.d.ts +42 -0
- package/lib/ssim/compute_ssim.d.ts.map +1 -0
- package/lib/ssim/compute_ssim.js +56 -0
- package/lib/ssim/compute_ssim.js.map +1 -0
- package/lib/ssim/index.d.ts +3 -0
- package/lib/ssim/index.d.ts.map +1 -0
- package/lib/ssim/index.js +3 -0
- package/lib/ssim/index.js.map +1 -0
- package/lib/stack/compute/histogram.d.ts +10 -0
- package/lib/stack/compute/histogram.d.ts.map +1 -0
- package/lib/stack/compute/histogram.js +21 -0
- package/lib/stack/compute/histogram.js.map +1 -0
- package/lib/stack/compute/maxImage.d.ts +9 -0
- package/lib/stack/compute/maxImage.d.ts.map +1 -0
- package/lib/stack/compute/maxImage.js +21 -0
- package/lib/stack/compute/maxImage.js.map +1 -0
- package/lib/stack/compute/meanImage.d.ts +9 -0
- package/lib/stack/compute/meanImage.d.ts.map +1 -0
- package/lib/stack/compute/meanImage.js +29 -0
- package/lib/stack/compute/meanImage.js.map +1 -0
- package/lib/stack/compute/medianImage.d.ts +9 -0
- package/lib/stack/compute/medianImage.d.ts.map +1 -0
- package/lib/stack/compute/medianImage.js +25 -0
- package/lib/stack/compute/medianImage.js.map +1 -0
- package/lib/stack/compute/minImage.d.ts +9 -0
- package/lib/stack/compute/minImage.d.ts.map +1 -0
- package/lib/stack/compute/minImage.js +22 -0
- package/lib/stack/compute/minImage.js.map +1 -0
- package/lib/stack/compute/sum.d.ts +9 -0
- package/lib/stack/compute/sum.d.ts.map +1 -0
- package/lib/stack/compute/sum.js +30 -0
- package/lib/stack/compute/sum.js.map +1 -0
- package/lib/stack/index.d.ts +8 -0
- package/lib/stack/index.d.ts.map +1 -0
- package/lib/stack/index.js +8 -0
- package/lib/stack/index.js.map +1 -0
- package/lib/stack/load/decodeStack.d.ts +9 -0
- package/lib/stack/load/decodeStack.d.ts.map +1 -0
- package/lib/stack/load/decodeStack.js +19 -0
- package/lib/stack/load/decodeStack.js.map +1 -0
- package/lib/stack/load/decodeTiff.d.ts +8 -0
- package/lib/stack/load/decodeTiff.d.ts.map +1 -0
- package/lib/stack/load/decodeTiff.js +17 -0
- package/lib/stack/load/decodeTiff.js.map +1 -0
- package/lib/stack/utils/checkImagesValid.d.ts +13 -0
- package/lib/stack/utils/checkImagesValid.d.ts.map +1 -0
- package/lib/stack/utils/checkImagesValid.js +29 -0
- package/lib/stack/utils/checkImagesValid.js.map +1 -0
- package/lib/stack/utils/checkProcessable.d.ts +24 -0
- package/lib/stack/utils/checkProcessable.d.ts.map +1 -0
- package/lib/stack/utils/checkProcessable.js +32 -0
- package/lib/stack/utils/checkProcessable.js.map +1 -0
- package/lib/stack/utils/getStackFromFolder.d.ts +8 -0
- package/lib/stack/utils/getStackFromFolder.d.ts.map +1 -0
- package/lib/stack/utils/getStackFromFolder.js +16 -0
- package/lib/stack/utils/getStackFromFolder.js.map +1 -0
- package/lib/utils/arrayPointsToObjects.d.ts +8 -0
- package/lib/utils/arrayPointsToObjects.d.ts.map +1 -0
- package/lib/utils/arrayPointsToObjects.js +13 -0
- package/lib/utils/arrayPointsToObjects.js.map +1 -0
- package/lib/utils/boolToNumber.d.ts +8 -0
- package/lib/utils/boolToNumber.d.ts.map +1 -0
- package/lib/utils/boolToNumber.js +16 -0
- package/lib/utils/boolToNumber.js.map +1 -0
- package/lib/utils/borderIterator.d.ts +9 -0
- package/lib/utils/borderIterator.d.ts.map +1 -0
- package/lib/utils/borderIterator.js +20 -0
- package/lib/utils/borderIterator.js.map +1 -0
- package/lib/utils/clamp.d.ts +15 -2
- package/lib/utils/clamp.d.ts.map +1 -1
- package/lib/utils/clamp.js +41 -5
- package/lib/utils/clamp.js.map +1 -1
- package/lib/utils/constants/channelLabels.d.ts +8 -0
- package/lib/utils/constants/channelLabels.d.ts.map +1 -0
- package/lib/utils/constants/channelLabels.js +8 -0
- package/lib/utils/constants/channelLabels.js.map +1 -0
- package/lib/utils/constants/colorModels.d.ts +14 -0
- package/lib/utils/constants/colorModels.d.ts.map +1 -0
- package/lib/utils/constants/colorModels.js +35 -0
- package/lib/utils/constants/colorModels.js.map +1 -0
- package/lib/utils/constants/kernels.d.ts +13 -0
- package/lib/utils/constants/kernels.d.ts.map +1 -0
- package/lib/utils/constants/kernels.js +63 -0
- package/lib/utils/constants/kernels.js.map +1 -0
- package/lib/utils/constants/kinds.d.ts +7 -0
- package/lib/utils/constants/kinds.d.ts.map +1 -0
- package/lib/utils/constants/kinds.js +19 -0
- package/lib/utils/constants/kinds.js.map +1 -0
- package/lib/utils/copyData.d.ts +5 -0
- package/lib/utils/copyData.d.ts.map +1 -0
- package/lib/utils/copyData.js +15 -0
- package/lib/utils/copyData.js.map +1 -0
- package/lib/utils/cross_platform.d.ts +11 -0
- package/lib/utils/cross_platform.d.ts.map +1 -0
- package/lib/utils/cross_platform.js +17 -0
- package/lib/utils/cross_platform.js.map +1 -0
- package/lib/utils/geometry/angles.d.ts +16 -0
- package/lib/utils/geometry/angles.d.ts.map +1 -0
- package/lib/utils/geometry/angles.js +24 -0
- package/lib/utils/geometry/angles.js.map +1 -0
- package/lib/utils/geometry/getCirclePoints.d.ts +30 -0
- package/lib/utils/geometry/getCirclePoints.d.ts.map +1 -0
- package/lib/utils/geometry/getCirclePoints.js +88 -0
- package/lib/utils/geometry/getCirclePoints.js.map +1 -0
- package/lib/utils/geometry/index.d.ts +2 -0
- package/lib/utils/geometry/index.d.ts.map +1 -0
- package/lib/utils/geometry/index.js +2 -0
- package/lib/utils/geometry/index.js.map +1 -0
- package/lib/utils/geometry/lines.d.ts +23 -0
- package/lib/utils/geometry/lines.d.ts.map +1 -0
- package/lib/utils/geometry/lines.js +10 -0
- package/lib/utils/geometry/lines.js.map +1 -0
- package/lib/utils/geometry/points.d.ts +67 -0
- package/lib/utils/geometry/points.d.ts.map +1 -0
- package/lib/utils/geometry/points.js +78 -0
- package/lib/utils/geometry/points.js.map +1 -0
- package/lib/utils/geometry/polygons.d.ts +16 -0
- package/lib/utils/geometry/polygons.d.ts.map +1 -0
- package/lib/utils/geometry/polygons.js +30 -0
- package/lib/utils/geometry/polygons.js.map +1 -0
- package/lib/utils/geometry/removeClosePoints.d.ts +28 -0
- package/lib/utils/geometry/removeClosePoints.d.ts.map +1 -0
- package/lib/utils/geometry/removeClosePoints.js +43 -0
- package/lib/utils/geometry/removeClosePoints.js.map +1 -0
- package/lib/utils/getDefaultColor.d.ts +10 -0
- package/lib/utils/getDefaultColor.d.ts.map +1 -0
- package/lib/utils/getDefaultColor.js +17 -0
- package/lib/utils/getDefaultColor.js.map +1 -0
- package/lib/utils/getIndex.d.ts +5 -0
- package/lib/utils/getIndex.d.ts.map +1 -0
- package/lib/utils/getIndex.js +12 -0
- package/lib/utils/getIndex.js.map +1 -0
- package/lib/utils/getMinMax.d.ts +11 -0
- package/lib/utils/getMinMax.d.ts.map +1 -0
- package/lib/utils/getMinMax.js +24 -0
- package/lib/utils/getMinMax.js.map +1 -0
- package/lib/utils/getOutputImage.d.ts +40 -8
- package/lib/utils/getOutputImage.d.ts.map +1 -1
- package/lib/utils/getOutputImage.js +120 -19
- package/lib/utils/getOutputImage.js.map +1 -1
- package/lib/utils/getRadius.d.ts +7 -0
- package/lib/utils/getRadius.d.ts.map +1 -0
- package/lib/utils/getRadius.js +12 -0
- package/lib/utils/getRadius.js.map +1 -0
- package/lib/utils/interpolateBorder.d.ts +53 -2
- package/lib/utils/interpolateBorder.d.ts.map +1 -1
- package/lib/utils/interpolateBorder.js +129 -43
- package/lib/utils/interpolateBorder.js.map +1 -1
- package/lib/utils/interpolatePixel.d.ts +14 -4
- package/lib/utils/interpolatePixel.d.ts.map +1 -1
- package/lib/utils/interpolatePixel.js +117 -22
- package/lib/utils/interpolatePixel.js.map +1 -1
- package/lib/utils/round.d.ts +5 -0
- package/lib/utils/round.d.ts.map +1 -1
- package/lib/utils/round.js +15 -10
- package/lib/utils/round.js.map +1 -1
- package/lib/utils/sampleBackgroundPoints.d.ts +34 -0
- package/lib/utils/sampleBackgroundPoints.d.ts.map +1 -0
- package/lib/utils/sampleBackgroundPoints.js +37 -0
- package/lib/utils/sampleBackgroundPoints.js.map +1 -0
- package/lib/utils/setBlendedPixel.d.ts +11 -0
- package/lib/utils/setBlendedPixel.d.ts.map +1 -0
- package/lib/utils/setBlendedPixel.js +36 -0
- package/lib/utils/setBlendedPixel.js.map +1 -0
- package/lib/utils/setBlendedVisiblePixel.d.ts +11 -0
- package/lib/utils/setBlendedVisiblePixel.d.ts.map +1 -0
- package/lib/utils/setBlendedVisiblePixel.js +14 -0
- package/lib/utils/setBlendedVisiblePixel.js.map +1 -0
- package/lib/utils/surroundingPixels.d.ts +9 -0
- package/lib/utils/surroundingPixels.d.ts.map +1 -0
- package/lib/utils/surroundingPixels.js +15 -0
- package/lib/utils/surroundingPixels.js.map +1 -0
- package/lib/utils/utils.types.d.ts +25 -0
- package/lib/utils/utils.types.d.ts.map +1 -0
- package/lib/utils/utils.types.js +2 -0
- package/lib/utils/utils.types.js.map +1 -0
- package/lib/utils/validators/assert.d.ts +12 -0
- package/lib/utils/validators/assert.d.ts.map +1 -0
- package/lib/utils/validators/assert.js +18 -0
- package/lib/utils/validators/assert.js.map +1 -0
- package/lib/utils/validators/checkKernel.d.ts +6 -0
- package/lib/utils/validators/checkKernel.d.ts.map +1 -0
- package/lib/utils/validators/checkKernel.js +10 -0
- package/lib/utils/validators/checkKernel.js.map +1 -0
- package/lib/utils/validators/checkPointIsInteger.d.ts +8 -0
- package/lib/utils/validators/checkPointIsInteger.d.ts.map +1 -0
- package/lib/utils/validators/checkPointIsInteger.js +11 -0
- package/lib/utils/validators/checkPointIsInteger.js.map +1 -0
- package/lib/utils/validators/checkProcessable.d.ts +25 -0
- package/lib/utils/validators/checkProcessable.d.ts.map +1 -0
- package/lib/utils/validators/checkProcessable.js +64 -0
- package/lib/utils/validators/checkProcessable.js.map +1 -0
- package/lib/utils/validators/validators.d.ts +39 -0
- package/lib/utils/validators/validators.d.ts.map +1 -0
- package/lib/utils/validators/validators.js +66 -0
- package/lib/utils/validators/validators.js.map +1 -0
- package/package.json +91 -20
- package/src/Image.ts +978 -163
- package/src/Mask.ts +731 -0
- package/src/Stack.ts +204 -0
- package/src/align/affineTransfrom/affineFitFunction.ts +27 -0
- package/src/align/affineTransfrom/applyAffineTransform.ts +27 -0
- package/src/align/affineTransfrom/createAffineTransformModel.ts +31 -0
- package/src/align/affineTransfrom/drawResult.ts +56 -0
- package/src/align/affineTransfrom/getAffineTransform.ts +310 -0
- package/src/align/affineTransfrom/getEuclideanDistance.ts +11 -0
- package/src/align/affineTransfrom/getMatrixFromPoints.ts +20 -0
- package/src/align/affineTransfrom/getPointsFromMatrix.ts +17 -0
- package/src/align/affineTransfrom/utils/getSourceWithoutMargins.ts +30 -0
- package/src/align/alignMinDifference.ts +114 -0
- package/src/align/index.ts +2 -0
- package/src/compare/add.ts +34 -0
- package/src/compare/computePsnr.ts +17 -0
- package/src/compare/computeRmse.ts +33 -0
- package/src/compare/divide.ts +50 -0
- package/src/compare/index.ts +6 -0
- package/src/compare/multiply.ts +48 -0
- package/src/compare/subtract.ts +86 -0
- package/src/compute/getExtrema.ts +103 -0
- package/src/compute/histogram.ts +32 -10
- package/src/compute/index.ts +5 -1
- package/src/compute/mean.ts +48 -0
- package/src/compute/median.ts +50 -0
- package/src/compute/variance.ts +41 -0
- package/src/correctColor/correctColor.ts +109 -0
- package/src/correctColor/index.ts +1 -0
- package/src/correctColor/utils/formatData.ts +86 -0
- package/src/correctColor/utils/getImageColors.ts +23 -0
- package/src/correctColor/utils/referenceColorCard.ts +175 -0
- package/src/draw/drawCircleOnImage.ts +123 -0
- package/src/draw/drawLineOnImage.ts +64 -0
- package/src/draw/drawLineOnMask.ts +45 -0
- package/src/draw/drawMarker.ts +108 -0
- package/src/draw/drawMarkers.ts +25 -0
- package/src/draw/drawPoints.ts +74 -0
- package/src/draw/drawPolygonOnImage.ts +80 -0
- package/src/draw/drawPolygonOnMask.ts +69 -0
- package/src/draw/drawPolylineOnImage.ts +56 -0
- package/src/draw/drawPolylineOnMask.ts +37 -0
- package/src/draw/drawRectangle.ts +123 -0
- package/src/draw/index.ts +11 -0
- package/src/draw/utils/deleteDuplicates.ts +21 -0
- package/src/draw/utils/roundPoint.ts +13 -0
- package/src/featureMatching/descriptors/getBrief.ts +42 -0
- package/src/featureMatching/descriptors/getBriefDescriptors.ts +108 -0
- package/src/featureMatching/descriptors/utils/getKeypointPatch.ts +59 -0
- package/src/featureMatching/descriptors/utils/sliceBrief.ts +34 -0
- package/src/featureMatching/featureMatching.types.ts +26 -0
- package/src/featureMatching/index.ts +12 -0
- package/src/featureMatching/keypoints/getBestKeypointsInRadius.ts +39 -0
- package/src/featureMatching/keypoints/getFastKeypoints.ts +157 -0
- package/src/featureMatching/keypoints/getFastScore.ts +37 -0
- package/src/featureMatching/keypoints/getHarrisScore.ts +73 -0
- package/src/featureMatching/keypoints/getIntensityCentroid.ts +34 -0
- package/src/featureMatching/keypoints/getIntensityMoment.ts +43 -0
- package/src/featureMatching/keypoints/getOrientedFastKeypoints.ts +67 -0
- package/src/featureMatching/keypoints/getPatchIntensityCentroid.ts +39 -0
- package/src/featureMatching/keypoints/getPatchIntensityMoment.ts +56 -0
- package/src/featureMatching/keypoints/isFastKeypoint.ts +101 -0
- package/src/featureMatching/keypoints/utils/getDistanceMatrix.ts +35 -0
- package/src/featureMatching/keypoints/utils/getKeypointsInRadius.ts +34 -0
- package/src/featureMatching/matching/bruteForceMatch.ts +79 -0
- package/src/featureMatching/matching/filterEuclideanDistance.ts +71 -0
- package/src/featureMatching/matching/filterSmallestDistanceMatches.ts +33 -0
- package/src/featureMatching/matching/getCrosscheckMatches.ts +69 -0
- package/src/featureMatching/matching/getHammingDistance.ts +20 -0
- package/src/featureMatching/utils/checkBorderDistance.ts +22 -0
- package/src/featureMatching/utils/compareIntensity.ts +35 -0
- package/src/featureMatching/utils/extractSquareImage.ts +27 -0
- package/src/featureMatching/utils/getColors.ts +34 -0
- package/src/featureMatching/utils/getGaussianPoints.ts +64 -0
- package/src/featureMatching/utils/getKeypointColor.ts +29 -0
- package/src/featureMatching/utils/getMatchColor.ts +27 -0
- package/src/featureMatching/utils/sortByDistance.ts +12 -0
- package/src/featureMatching/utils/sortBySourceDest.ts +27 -0
- package/src/featureMatching/visualize/Montage.ts +165 -0
- package/src/featureMatching/visualize/drawKeypoints.ts +146 -0
- package/src/featureMatching/visualize/drawMatches.ts +107 -0
- package/src/featureMatching/visualize/overlapImages.ts +67 -0
- package/src/featureMatching/visualize/scaleKeypoints.ts +24 -0
- package/src/filters/and.ts +33 -0
- package/src/filters/blur.ts +42 -7
- package/src/filters/convolution.ts +190 -128
- package/src/filters/derivativeFilter.ts +71 -0
- package/src/filters/flip.ts +35 -0
- package/src/filters/flipX.ts +32 -0
- package/src/filters/flipY.ts +34 -0
- package/src/filters/gaussianBlur.ts +75 -29
- package/src/filters/gradientFilter.ts +103 -0
- package/src/filters/hypotenuse.ts +62 -0
- package/src/filters/increaseContrast.ts +69 -0
- package/src/filters/index.ts +14 -4
- package/src/filters/invert.ts +42 -11
- package/src/filters/level.ts +131 -0
- package/src/filters/medianFilter.ts +83 -0
- package/src/filters/or.ts +33 -0
- package/src/filters/pixelate.ts +178 -0
- package/src/geometry/getPerspectiveWarp.ts +169 -0
- package/src/geometry/index.ts +6 -1
- package/src/geometry/resize.ts +166 -0
- package/src/geometry/rotate.ts +63 -0
- package/src/geometry/transform.ts +180 -40
- package/src/geometry/transformRotate.ts +65 -0
- package/src/index.ts +24 -8
- package/src/load/decode.ts +18 -16
- package/src/load/decodeJpeg.ts +20 -4
- package/src/load/decodePng.ts +30 -27
- package/src/load/decodeTiff.ts +63 -0
- package/src/load/fetchURL.ts +13 -0
- package/src/load/getMetadata.ts +18 -0
- package/src/load/index.ts +9 -6
- package/src/load/load.types.ts +7 -0
- package/src/load/read.ts +15 -12
- package/src/load/readCanvas.ts +11 -9
- package/src/load/readImg.ts +15 -9
- package/src/maskAnalysis/getBorderPoints.ts +70 -0
- package/src/maskAnalysis/getConvexHull.ts +29 -0
- package/src/maskAnalysis/getFeret.ts +239 -0
- package/src/maskAnalysis/getMbr.ts +17 -0
- package/src/maskAnalysis/index.ts +1 -0
- package/src/maskAnalysis/maskAnalysis.types.ts +100 -0
- package/src/maskAnalysis/utils/getAngle.ts +40 -0
- package/src/maskAnalysis/utils/getExtendedBorderPoints.ts +30 -0
- package/src/maskAnalysis/utils/getMbrAngle.ts +25 -0
- package/src/maskAnalysis/utils/getMbrFromPoints.ts +112 -0
- package/src/maskAnalysis/utils/monotoneChainConvexHull.ts +65 -0
- package/src/morphology/bottomHat.ts +64 -0
- package/src/morphology/cannyEdgeDetector.ts +209 -0
- package/src/morphology/clearBorder.ts +41 -0
- package/src/morphology/close.ts +59 -0
- package/src/morphology/dilate.ts +261 -0
- package/src/morphology/erode.ts +261 -0
- package/src/morphology/floodFill.ts +38 -0
- package/src/morphology/index.ts +11 -0
- package/src/morphology/morphologicalGradient.ts +66 -0
- package/src/morphology/multipleFloodFill.ts +135 -0
- package/src/morphology/open.ts +62 -0
- package/src/morphology/solidFill.ts +29 -0
- package/src/morphology/topHat.ts +62 -0
- package/src/operations/convertBitDepth.ts +74 -0
- package/src/operations/convertColor.ts +143 -66
- package/src/operations/copyTo.ts +79 -0
- package/src/operations/correctBackground.ts +71 -0
- package/src/operations/crop.ts +94 -0
- package/src/operations/cropAlpha.ts +108 -0
- package/src/operations/cropRectangle.ts +112 -0
- package/src/operations/extendBorders.ts +119 -0
- package/src/operations/extract.ts +76 -0
- package/src/operations/getMaskFromCannyEdge.ts +41 -0
- package/src/operations/grey.ts +139 -0
- package/src/operations/greyAlgorithms.ts +248 -0
- package/src/operations/index.ts +16 -4
- package/src/operations/merge.ts +66 -0
- package/src/operations/operations.types.ts +6 -0
- package/src/operations/paintMaskOnImage.ts +111 -0
- package/src/operations/paintMaskOnMask.ts +59 -0
- package/src/operations/split.ts +11 -4
- package/src/operations/threshold.ts +113 -58
- package/src/operations/thresholds/huang.ts +84 -0
- package/src/operations/thresholds/intermodes.ts +61 -0
- package/src/operations/thresholds/isodata.ts +53 -0
- package/src/operations/thresholds/li.ts +80 -0
- package/src/operations/thresholds/maxEntropy.ts +88 -0
- package/src/operations/thresholds/mean.ts +22 -0
- package/src/operations/thresholds/minError.ts +101 -0
- package/src/operations/thresholds/minimum.ts +77 -0
- package/src/operations/thresholds/moments.ts +59 -0
- package/src/operations/thresholds/otsu.ts +7 -1
- package/src/operations/thresholds/percentile.ts +39 -0
- package/src/operations/thresholds/renyiEntropy.ts +145 -0
- package/src/operations/thresholds/shanbhag.ts +80 -0
- package/src/operations/thresholds/triangle.ts +8 -2
- package/src/operations/thresholds/yen.ts +59 -0
- package/src/point/operations.ts +29 -0
- package/src/roi/Roi.ts +661 -0
- package/src/roi/RoiMapManager.ts +97 -0
- package/src/roi/colorRois.ts +68 -0
- package/src/roi/computeRois.ts +90 -0
- package/src/roi/fromMask.ts +182 -0
- package/src/roi/getBorderPoints.ts +20 -0
- package/src/roi/getMask.ts +41 -0
- package/src/roi/getRois.ts +65 -0
- package/src/roi/index.ts +10 -0
- package/src/roi/properties/getEllipse.ts +124 -0
- package/src/roi/roi.types.ts +23 -0
- package/src/roi/utils/colorMaps/getBinaryMap.ts +67 -0
- package/src/roi/utils/colorMaps/getRainbowMap.ts +59 -0
- package/src/roi/utils/colorMaps/getSaturationMap.ts +70 -0
- package/src/roi/utils/getColorMap.ts +46 -0
- package/src/roi/utils/hsvToRgb.ts +61 -0
- package/src/roi/utils/rgbToNumber.ts +8 -0
- package/src/roi/waterShed.ts +146 -0
- package/src/save/encode.ts +41 -43
- package/src/save/encodeBmp.ts +24 -0
- package/src/save/encodeDataURL.ts +25 -0
- package/src/save/encodeJpeg.ts +22 -13
- package/src/save/encodePng.ts +30 -6
- package/src/save/index.ts +6 -5
- package/src/save/write.ts +129 -50
- package/src/save/writeCanvas.ts +45 -19
- package/src/ssim/compute_dssim.ts +21 -0
- package/src/ssim/compute_ssim.ts +94 -0
- package/src/ssim/index.ts +2 -0
- package/src/stack/compute/histogram.ts +26 -0
- package/src/stack/compute/maxImage.ts +31 -0
- package/src/stack/compute/meanImage.ts +37 -0
- package/src/stack/compute/medianImage.ts +30 -0
- package/src/stack/compute/minImage.ts +32 -0
- package/src/stack/compute/sum.ts +37 -0
- package/src/stack/index.ts +7 -0
- package/src/stack/load/decodeStack.ts +26 -0
- package/src/stack/load/decodeTiff.ts +19 -0
- package/src/stack/utils/checkImagesValid.ts +35 -0
- package/src/stack/utils/checkProcessable.ts +61 -0
- package/src/stack/utils/getStackFromFolder.ts +17 -0
- package/src/types/bresenham-zingl.d.ts +50 -0
- package/src/utils/arrayPointsToObjects.ts +15 -0
- package/src/utils/boolToNumber.ts +17 -0
- package/src/utils/borderIterator.ts +22 -0
- package/src/utils/clamp.ts +46 -3
- package/src/utils/constants/channelLabels.ts +9 -0
- package/src/utils/constants/colorModels.ts +45 -0
- package/src/utils/constants/kernels.ts +73 -0
- package/src/utils/constants/kinds.ts +26 -0
- package/src/utils/copyData.ts +21 -0
- package/src/utils/cross_platform.ts +18 -0
- package/src/utils/geometry/angles.ts +26 -0
- package/src/utils/geometry/getCirclePoints.ts +123 -0
- package/src/utils/geometry/index.ts +1 -0
- package/src/utils/geometry/lines.ts +26 -0
- package/src/utils/geometry/points.ts +102 -0
- package/src/utils/geometry/polygons.ts +32 -0
- package/src/utils/geometry/removeClosePoints.ts +82 -0
- package/src/utils/getDefaultColor.ts +20 -0
- package/src/utils/getIndex.ts +26 -0
- package/src/utils/getMinMax.ts +27 -0
- package/src/utils/getOutputImage.ts +149 -32
- package/src/utils/getRadius.ts +11 -0
- package/src/utils/interpolateBorder.ts +193 -40
- package/src/utils/interpolatePixel.ts +162 -27
- package/src/utils/round.ts +13 -8
- package/src/utils/sampleBackgroundPoints.ts +84 -0
- package/src/utils/setBlendedPixel.ts +54 -0
- package/src/utils/setBlendedVisiblePixel.ts +22 -0
- package/src/utils/surroundingPixels.ts +14 -0
- package/src/utils/utils.types.ts +32 -0
- package/src/utils/validators/assert.ts +18 -0
- package/src/utils/validators/checkKernel.ts +11 -0
- package/src/utils/validators/checkPointIsInteger.ts +12 -0
- package/src/utils/validators/checkProcessable.ts +95 -0
- package/src/utils/validators/validators.ts +82 -0
- package/lib/load/checkHeader.d.ts +0 -8
- package/lib/load/checkHeader.d.ts.map +0 -1
- package/lib/load/checkHeader.js +0 -21
- package/lib/load/checkHeader.js.map +0 -1
- package/lib/operations/convertDepth.d.ts +0 -3
- package/lib/operations/convertDepth.d.ts.map +0 -1
- package/lib/operations/convertDepth.js +0 -40
- package/lib/operations/convertDepth.js.map +0 -1
- package/lib/types.d.ts +0 -12
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js +0 -16
- package/lib/types.js.map +0 -1
- package/lib/utils/kinds.d.ts +0 -9
- package/lib/utils/kinds.d.ts.map +0 -1
- package/lib/utils/kinds.js +0 -22
- package/lib/utils/kinds.js.map +0 -1
- package/lib/utils/validators.d.ts +0 -7
- package/lib/utils/validators.d.ts.map +0 -1
- package/lib/utils/validators.js +0 -19
- package/lib/utils/validators.js.map +0 -1
- package/lib-esm/Image.d.ts +0 -161
- package/lib-esm/Image.d.ts.map +0 -1
- package/lib-esm/Image.js +0 -246
- package/lib-esm/Image.js.map +0 -1
- package/lib-esm/compute/histogram.d.ts +0 -15
- package/lib-esm/compute/histogram.d.ts.map +0 -1
- package/lib-esm/compute/histogram.js +0 -21
- package/lib-esm/compute/histogram.js.map +0 -1
- package/lib-esm/compute/index.d.ts +0 -2
- package/lib-esm/compute/index.d.ts.map +0 -1
- package/lib-esm/compute/index.js +0 -2
- package/lib-esm/compute/index.js.map +0 -1
- package/lib-esm/filters/blur.d.ts +0 -10
- package/lib-esm/filters/blur.d.ts.map +0 -1
- package/lib-esm/filters/blur.js +0 -12
- package/lib-esm/filters/blur.js.map +0 -1
- package/lib-esm/filters/convolution.d.ts +0 -11
- package/lib-esm/filters/convolution.d.ts.map +0 -1
- package/lib-esm/filters/convolution.js +0 -114
- package/lib-esm/filters/convolution.js.map +0 -1
- package/lib-esm/filters/gaussianBlur.d.ts +0 -19
- package/lib-esm/filters/gaussianBlur.d.ts.map +0 -1
- package/lib-esm/filters/gaussianBlur.js +0 -46
- package/lib-esm/filters/gaussianBlur.js.map +0 -1
- package/lib-esm/filters/index.d.ts +0 -5
- package/lib-esm/filters/index.d.ts.map +0 -1
- package/lib-esm/filters/index.js +0 -5
- package/lib-esm/filters/index.js.map +0 -1
- package/lib-esm/filters/invert.d.ts +0 -10
- package/lib-esm/filters/invert.d.ts.map +0 -1
- package/lib-esm/filters/invert.js +0 -14
- package/lib-esm/filters/invert.js.map +0 -1
- package/lib-esm/geometry/index.d.ts +0 -2
- package/lib-esm/geometry/index.d.ts.map +0 -1
- package/lib-esm/geometry/index.js +0 -2
- package/lib-esm/geometry/index.js.map +0 -1
- package/lib-esm/geometry/transform.d.ts +0 -13
- package/lib-esm/geometry/transform.d.ts.map +0 -1
- package/lib-esm/geometry/transform.js +0 -46
- package/lib-esm/geometry/transform.js.map +0 -1
- package/lib-esm/index.d.ts +0 -9
- package/lib-esm/index.d.ts.map +0 -1
- package/lib-esm/index.js +0 -9
- package/lib-esm/index.js.map +0 -1
- package/lib-esm/load/checkHeader.d.ts +0 -8
- package/lib-esm/load/checkHeader.d.ts.map +0 -1
- package/lib-esm/load/checkHeader.js +0 -18
- package/lib-esm/load/checkHeader.js.map +0 -1
- package/lib-esm/load/decode.d.ts +0 -8
- package/lib-esm/load/decode.d.ts.map +0 -1
- package/lib-esm/load/decode.js +0 -23
- package/lib-esm/load/decode.js.map +0 -1
- package/lib-esm/load/decodeJpeg.d.ts +0 -7
- package/lib-esm/load/decodeJpeg.d.ts.map +0 -1
- package/lib-esm/load/decodeJpeg.js +0 -14
- package/lib-esm/load/decodeJpeg.js.map +0 -1
- package/lib-esm/load/decodePng.d.ts +0 -7
- package/lib-esm/load/decodePng.d.ts.map +0 -1
- package/lib-esm/load/decodePng.js +0 -65
- package/lib-esm/load/decodePng.js.map +0 -1
- package/lib-esm/load/index.d.ts +0 -7
- package/lib-esm/load/index.d.ts.map +0 -1
- package/lib-esm/load/index.js +0 -7
- package/lib-esm/load/index.js.map +0 -1
- package/lib-esm/load/read.d.ts +0 -12
- package/lib-esm/load/read.d.ts.map +0 -1
- package/lib-esm/load/read.js +0 -20
- package/lib-esm/load/read.js.map +0 -1
- package/lib-esm/load/readCanvas.d.ts +0 -3
- package/lib-esm/load/readCanvas.d.ts.map +0 -1
- package/lib-esm/load/readCanvas.js +0 -15
- package/lib-esm/load/readCanvas.js.map +0 -1
- package/lib-esm/load/readImg.d.ts +0 -3
- package/lib-esm/load/readImg.d.ts.map +0 -1
- package/lib-esm/load/readImg.js +0 -14
- package/lib-esm/load/readImg.js.map +0 -1
- package/lib-esm/operations/convertColor.d.ts +0 -6
- package/lib-esm/operations/convertColor.d.ts.map +0 -1
- package/lib-esm/operations/convertColor.js +0 -73
- package/lib-esm/operations/convertColor.js.map +0 -1
- package/lib-esm/operations/convertDepth.d.ts +0 -3
- package/lib-esm/operations/convertDepth.d.ts.map +0 -1
- package/lib-esm/operations/convertDepth.js +0 -37
- package/lib-esm/operations/convertDepth.js.map +0 -1
- package/lib-esm/operations/index.d.ts +0 -5
- package/lib-esm/operations/index.d.ts.map +0 -1
- package/lib-esm/operations/index.js +0 -5
- package/lib-esm/operations/index.js.map +0 -1
- package/lib-esm/operations/split.d.ts +0 -3
- package/lib-esm/operations/split.d.ts.map +0 -1
- package/lib-esm/operations/split.js +0 -13
- package/lib-esm/operations/split.js.map +0 -1
- package/lib-esm/operations/threshold.d.ts +0 -19
- package/lib-esm/operations/threshold.d.ts.map +0 -1
- package/lib-esm/operations/threshold.js +0 -53
- package/lib-esm/operations/threshold.js.map +0 -1
- package/lib-esm/operations/thresholds/otsu.d.ts +0 -2
- package/lib-esm/operations/thresholds/otsu.d.ts.map +0 -1
- package/lib-esm/operations/thresholds/otsu.js +0 -32
- package/lib-esm/operations/thresholds/otsu.js.map +0 -1
- package/lib-esm/operations/thresholds/triangle.d.ts +0 -2
- package/lib-esm/operations/thresholds/triangle.d.ts.map +0 -1
- package/lib-esm/operations/thresholds/triangle.js +0 -103
- package/lib-esm/operations/thresholds/triangle.js.map +0 -1
- package/lib-esm/save/encode.d.ts +0 -35
- package/lib-esm/save/encode.d.ts.map +0 -1
- package/lib-esm/save/encode.js +0 -22
- package/lib-esm/save/encode.js.map +0 -1
- package/lib-esm/save/encodeJpeg.d.ts +0 -6
- package/lib-esm/save/encodeJpeg.d.ts.map +0 -1
- package/lib-esm/save/encodeJpeg.js +0 -16
- package/lib-esm/save/encodeJpeg.js.map +0 -1
- package/lib-esm/save/encodePng.d.ts +0 -5
- package/lib-esm/save/encodePng.d.ts.map +0 -1
- package/lib-esm/save/encodePng.js +0 -5
- package/lib-esm/save/encodePng.js.map +0 -1
- package/lib-esm/save/index.d.ts +0 -6
- package/lib-esm/save/index.d.ts.map +0 -1
- package/lib-esm/save/index.js +0 -6
- package/lib-esm/save/index.js.map +0 -1
- package/lib-esm/save/write.d.ts +0 -23
- package/lib-esm/save/write.d.ts.map +0 -1
- package/lib-esm/save/write.js +0 -46
- package/lib-esm/save/write.js.map +0 -1
- package/lib-esm/save/writeCanvas.d.ts +0 -15
- package/lib-esm/save/writeCanvas.d.ts.map +0 -1
- package/lib-esm/save/writeCanvas.js +0 -19
- package/lib-esm/save/writeCanvas.js.map +0 -1
- package/lib-esm/types.d.ts +0 -12
- package/lib-esm/types.d.ts.map +0 -1
- package/lib-esm/types.js +0 -14
- package/lib-esm/types.js.map +0 -1
- package/lib-esm/utils/clamp.d.ts +0 -3
- package/lib-esm/utils/clamp.d.ts.map +0 -1
- package/lib-esm/utils/clamp.js +0 -4
- package/lib-esm/utils/clamp.js.map +0 -1
- package/lib-esm/utils/getOutputImage.d.ts +0 -26
- package/lib-esm/utils/getOutputImage.d.ts.map +0 -1
- package/lib-esm/utils/getOutputImage.js +0 -35
- package/lib-esm/utils/getOutputImage.js.map +0 -1
- package/lib-esm/utils/interpolateBorder.d.ts +0 -3
- package/lib-esm/utils/interpolateBorder.d.ts.map +0 -1
- package/lib-esm/utils/interpolateBorder.js +0 -48
- package/lib-esm/utils/interpolateBorder.js.map +0 -1
- package/lib-esm/utils/interpolatePixel.d.ts +0 -7
- package/lib-esm/utils/interpolatePixel.d.ts.map +0 -1
- package/lib-esm/utils/interpolatePixel.js +0 -23
- package/lib-esm/utils/interpolatePixel.js.map +0 -1
- package/lib-esm/utils/kinds.d.ts +0 -9
- package/lib-esm/utils/kinds.d.ts.map +0 -1
- package/lib-esm/utils/kinds.js +0 -20
- package/lib-esm/utils/kinds.js.map +0 -1
- package/lib-esm/utils/round.d.ts +0 -2
- package/lib-esm/utils/round.d.ts.map +0 -1
- package/lib-esm/utils/round.js +0 -11
- package/lib-esm/utils/round.js.map +0 -1
- package/lib-esm/utils/validators.d.ts +0 -7
- package/lib-esm/utils/validators.d.ts.map +0 -1
- package/lib-esm/utils/validators.js +0 -15
- package/lib-esm/utils/validators.js.map +0 -1
- package/src/load/checkHeader.ts +0 -20
- package/src/operations/convertDepth.ts +0 -43
- package/src/operations/thresholds/huang.js +0 -80
- package/src/operations/thresholds/intermodes.js +0 -56
- package/src/operations/thresholds/isodata.js +0 -47
- package/src/operations/thresholds/li.js +0 -74
- package/src/operations/thresholds/maxEntropy.js +0 -79
- package/src/operations/thresholds/mean.js +0 -16
- package/src/operations/thresholds/minError.js +0 -92
- package/src/operations/thresholds/minimum.js +0 -75
- package/src/operations/thresholds/moments.js +0 -52
- package/src/operations/thresholds/percentile.js +0 -33
- package/src/operations/thresholds/renyiEntropy.js +0 -142
- package/src/operations/thresholds/shanbhag.js +0 -74
- package/src/operations/thresholds/yen.js +0 -56
- package/src/types.ts +0 -12
- package/src/utils/kinds.ts +0 -27
- package/src/utils/validators.ts +0 -23
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Matrix } from 'ml-matrix';
|
|
2
|
+
import { fromMask } from './fromMask.js';
|
|
3
|
+
import { getRois } from './getRois.js';
|
|
4
|
+
export class RoiMapManager {
|
|
5
|
+
map;
|
|
6
|
+
whiteRois;
|
|
7
|
+
blackRois;
|
|
8
|
+
constructor(map) {
|
|
9
|
+
this.map = map;
|
|
10
|
+
this.whiteRois = [];
|
|
11
|
+
this.blackRois = [];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Return the ROI map of the RoiMapManager.
|
|
15
|
+
* @returns - The ROI map.
|
|
16
|
+
*/
|
|
17
|
+
getMap() {
|
|
18
|
+
return this.map;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Return the value at the given coordinates in an ROI map.
|
|
22
|
+
* @param column - Column of the value.
|
|
23
|
+
* @param row - Row of the value.
|
|
24
|
+
* @returns The value at the given coordinates.
|
|
25
|
+
*/
|
|
26
|
+
getMapValue(column, row) {
|
|
27
|
+
return this.map.data[this.map.width * row + column];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns the ROI map as a correct width and height matrix.
|
|
31
|
+
* @returns The ROI map matrix.
|
|
32
|
+
*/
|
|
33
|
+
getMapMatrix() {
|
|
34
|
+
return Matrix.from1DArray(this.map.height, this.map.width, this.map.data).to2DArray();
|
|
35
|
+
}
|
|
36
|
+
getRois(options = {}) {
|
|
37
|
+
return getRois(this, options);
|
|
38
|
+
}
|
|
39
|
+
getRoiById(roiID) {
|
|
40
|
+
const rois = this.getRois({ kind: 'bw' });
|
|
41
|
+
const foundRoi = rois.find((roi) => roi.id === roiID);
|
|
42
|
+
if (!foundRoi) {
|
|
43
|
+
throw new Error(`invalid ID: ${roiID}`);
|
|
44
|
+
}
|
|
45
|
+
return foundRoi;
|
|
46
|
+
}
|
|
47
|
+
static fromMask(mask, options = {}) {
|
|
48
|
+
return fromMask(mask, options);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=RoiMapManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoiMapManager.js","sourceRoot":"","sources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AQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,eAAe,KAAK,EAAE,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,IAAU,EAAE,UAA2B,EAAE;QAC9D,OAAO,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACjC,CAAC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Image } from '../Image.js';
|
|
2
|
+
import type { RoiMapManager } from './RoiMapManager.js';
|
|
3
|
+
import type { RoiKind } from './getRois.js';
|
|
4
|
+
export declare const RoisColorMode: {
|
|
5
|
+
/**
|
|
6
|
+
* Only two acceptable values: red or green.
|
|
7
|
+
*/
|
|
8
|
+
readonly BINARY: "binary";
|
|
9
|
+
/**
|
|
10
|
+
* Palette of reds and blues.
|
|
11
|
+
*/
|
|
12
|
+
readonly SATURATION: "saturation";
|
|
13
|
+
/**
|
|
14
|
+
* All possible hues (gradient of colors).
|
|
15
|
+
*/
|
|
16
|
+
readonly RAINBOW: "rainbow";
|
|
17
|
+
};
|
|
18
|
+
export type RoisColorMode = (typeof RoisColorMode)[keyof typeof RoisColorMode];
|
|
19
|
+
export interface ColorRoisOptions {
|
|
20
|
+
/**
|
|
21
|
+
* Define the color mode to use to color the ROIs.
|
|
22
|
+
* @default `'binary'`
|
|
23
|
+
*/
|
|
24
|
+
mode?: RoisColorMode;
|
|
25
|
+
/**
|
|
26
|
+
* Specify which ROIs to color.
|
|
27
|
+
* @default `'bw'`
|
|
28
|
+
*/
|
|
29
|
+
roiKind?: RoiKind;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Generate an image with all the ROIs of various colors.
|
|
33
|
+
* @param roiMapManager - The ROI map manager.
|
|
34
|
+
* @param options - Color ROIs options.
|
|
35
|
+
* @returns The colored image.
|
|
36
|
+
*/
|
|
37
|
+
export declare function colorRois(roiMapManager: RoiMapManager, options?: ColorRoisOptions): Image;
|
|
38
|
+
//# sourceMappingURL=colorRois.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorRois.d.ts","sourceRoot":"","sources":["../../src/roi/colorRois.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,eAAO,MAAM,aAAa;IACxB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEK,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE/E,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,aAAa,EAAE,aAAa,EAC5B,OAAO,GAAE,gBAAqB,GAC7B,KAAK,CAsBP"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Image } from '../Image.js';
|
|
2
|
+
import { getColorMap } from './utils/getColorMap.js';
|
|
3
|
+
export const RoisColorMode = {
|
|
4
|
+
/**
|
|
5
|
+
* Only two acceptable values: red or green.
|
|
6
|
+
*/
|
|
7
|
+
BINARY: 'binary',
|
|
8
|
+
/**
|
|
9
|
+
* Palette of reds and blues.
|
|
10
|
+
*/
|
|
11
|
+
SATURATION: 'saturation',
|
|
12
|
+
/**
|
|
13
|
+
* All possible hues (gradient of colors).
|
|
14
|
+
*/
|
|
15
|
+
RAINBOW: 'rainbow',
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Generate an image with all the ROIs of various colors.
|
|
19
|
+
* @param roiMapManager - The ROI map manager.
|
|
20
|
+
* @param options - Color ROIs options.
|
|
21
|
+
* @returns The colored image.
|
|
22
|
+
*/
|
|
23
|
+
export function colorRois(roiMapManager, options = {}) {
|
|
24
|
+
const { roiKind = 'bw', mode = 'binary' } = options;
|
|
25
|
+
const map = roiMapManager.getMap();
|
|
26
|
+
const image = new Image(map.width, map.height, {
|
|
27
|
+
colorModel: 'RGBA',
|
|
28
|
+
});
|
|
29
|
+
const colorMap = getColorMap({
|
|
30
|
+
roiKind,
|
|
31
|
+
mode,
|
|
32
|
+
nbNegative: map.nbNegative,
|
|
33
|
+
nbPositive: map.nbPositive,
|
|
34
|
+
});
|
|
35
|
+
const data32 = new Uint32Array(image.getRawImage().data.buffer);
|
|
36
|
+
for (let index = 0; index < image.size; index++) {
|
|
37
|
+
data32[index] = colorMap[map.data[index] + map.nbNegative];
|
|
38
|
+
}
|
|
39
|
+
return image;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=colorRois.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorRois.js","sourceRoot":"","sources":["../../src/roi/colorRois.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIpC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B;;OAEG;IACH,MAAM,EAAE,QAAQ;IAChB;;OAEG;IACH,UAAU,EAAE,YAAY;IACxB;;OAEG;IACH,OAAO,EAAE,SAAS;CACV,CAAC;AAiBX;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CACvB,aAA4B,EAC5B,UAA4B,EAAE;IAE9B,MAAM,EAAE,OAAO,GAAG,IAAI,EAAE,IAAI,GAAG,QAAQ,EAAE,GAAG,OAAO,CAAC;IACpD,MAAM,GAAG,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC;IAEnC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE;QAC7C,UAAU,EAAE,MAAM;KACnB,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,WAAW,CAAC;QAC3B,OAAO;QACP,IAAI;QACJ,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,UAAU,EAAE,GAAG,CAAC,UAAU;KAC3B,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEhE,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAChD,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RoiMapManager } from './RoiMapManager.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generate an array of ROIs based on an ROI map manager.
|
|
4
|
+
* @param roiMapManager - Roi map manager to use.
|
|
5
|
+
*/
|
|
6
|
+
export declare function computeRois(roiMapManager: RoiMapManager): void;
|
|
7
|
+
//# sourceMappingURL=computeRois.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeRois.d.ts","sourceRoot":"","sources":["../../src/roi/computeRois.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI,CAkF9D"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Roi } from './Roi.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generate an array of ROIs based on an ROI map manager.
|
|
4
|
+
* @param roiMapManager - Roi map manager to use.
|
|
5
|
+
*/
|
|
6
|
+
export function computeRois(roiMapManager) {
|
|
7
|
+
const map = roiMapManager.getMap();
|
|
8
|
+
const whites = new Array(map.nbPositive);
|
|
9
|
+
const blacks = new Array(map.nbNegative);
|
|
10
|
+
for (let i = 0; i < map.nbPositive; i++) {
|
|
11
|
+
whites[i] = {
|
|
12
|
+
minRow: map.height,
|
|
13
|
+
minColumn: map.width,
|
|
14
|
+
maxRow: -1,
|
|
15
|
+
maxColumn: -1,
|
|
16
|
+
surface: 0,
|
|
17
|
+
id: i + 1,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
for (let i = 0; i < map.nbNegative; i++) {
|
|
21
|
+
blacks[i] = {
|
|
22
|
+
borderLengths: [],
|
|
23
|
+
borderIDs: [],
|
|
24
|
+
minRow: map.height,
|
|
25
|
+
minColumn: map.width,
|
|
26
|
+
maxRow: -1,
|
|
27
|
+
maxColumn: -1,
|
|
28
|
+
surface: 0,
|
|
29
|
+
id: -i - 1,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
for (let row = 0; row < map.height; row++) {
|
|
33
|
+
for (let column = 0; column < map.width; column++) {
|
|
34
|
+
const currentIndex = roiMapManager.getMapValue(column, row);
|
|
35
|
+
if (currentIndex === 0) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
let currentRoi;
|
|
39
|
+
if (currentIndex < 0) {
|
|
40
|
+
currentRoi = blacks[-currentIndex - 1];
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
currentRoi = whites[currentIndex - 1];
|
|
44
|
+
}
|
|
45
|
+
currentRoi.surface++;
|
|
46
|
+
if (row < currentRoi.minRow) {
|
|
47
|
+
currentRoi.minRow = row;
|
|
48
|
+
}
|
|
49
|
+
if (row > currentRoi.maxRow) {
|
|
50
|
+
currentRoi.maxRow = row;
|
|
51
|
+
}
|
|
52
|
+
if (column < currentRoi.minColumn) {
|
|
53
|
+
currentRoi.minColumn = column;
|
|
54
|
+
}
|
|
55
|
+
if (column > currentRoi.maxColumn) {
|
|
56
|
+
currentRoi.maxColumn = column;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
roiMapManager.whiteRois = new Array(map.nbPositive);
|
|
61
|
+
roiMapManager.blackRois = new Array(map.nbNegative);
|
|
62
|
+
for (let i = 0; i < map.nbNegative; i++) {
|
|
63
|
+
const width = blacks[i].maxColumn - blacks[i].minColumn + 1;
|
|
64
|
+
const height = blacks[i].maxRow - blacks[i].minRow + 1;
|
|
65
|
+
const origin = { row: blacks[i].minRow, column: blacks[i].minColumn };
|
|
66
|
+
const id = blacks[i].id;
|
|
67
|
+
const surface = blacks[i].surface;
|
|
68
|
+
const blackRoi = new Roi(map, id, width, height, origin, surface);
|
|
69
|
+
roiMapManager.blackRois[i] = blackRoi;
|
|
70
|
+
}
|
|
71
|
+
for (let i = 0; i < map.nbPositive; i++) {
|
|
72
|
+
const width = whites[i].maxColumn - whites[i].minColumn + 1;
|
|
73
|
+
const height = whites[i].maxRow - whites[i].minRow + 1;
|
|
74
|
+
const origin = { row: whites[i].minRow, column: whites[i].minColumn };
|
|
75
|
+
const id = whites[i].id;
|
|
76
|
+
const surface = whites[i].surface;
|
|
77
|
+
const whiteRoi = new Roi(map, id, width, height, origin, surface);
|
|
78
|
+
roiMapManager.whiteRois[i] = whiteRoi;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=computeRois.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeRois.js","sourceRoot":"","sources":["../../src/roi/computeRois.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAG/B;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,aAA4B;IACtD,MAAM,GAAG,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC;IAEnC,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC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CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Mask } from '../Mask.js';
|
|
2
|
+
import { RoiMapManager } from './RoiMapManager.js';
|
|
3
|
+
export interface FromMaskOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Consider pixels connected by corners as same ROI?
|
|
6
|
+
* @default `false`
|
|
7
|
+
*/
|
|
8
|
+
allowCorners?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Extract the ROIs of an image.
|
|
12
|
+
* @param mask - Mask to extract the ROIs from.
|
|
13
|
+
* @param options - From mask options.
|
|
14
|
+
* @returns The corresponding ROI manager.
|
|
15
|
+
*/
|
|
16
|
+
export declare function fromMask(mask: Mask, options?: FromMaskOptions): RoiMapManager;
|
|
17
|
+
//# sourceMappingURL=fromMask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fromMask.d.ts","sourceRoot":"","sources":["../../src/roi/fromMask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,eAAoB,GAC5B,aAAa,CA+Jf"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { assert } from '../utils/validators/assert.js';
|
|
2
|
+
import { RoiMapManager } from './RoiMapManager.js';
|
|
3
|
+
/**
|
|
4
|
+
* Extract the ROIs of an image.
|
|
5
|
+
* @param mask - Mask to extract the ROIs from.
|
|
6
|
+
* @param options - From mask options.
|
|
7
|
+
* @returns The corresponding ROI manager.
|
|
8
|
+
*/
|
|
9
|
+
export function fromMask(mask, options = {}) {
|
|
10
|
+
const { allowCorners = false } = options;
|
|
11
|
+
const MAX_TODO_ARRAY_FILTER = 65535; // 65535 should be enough for most of the cases
|
|
12
|
+
const MAX_POSITIVE_ID = 2 ** 31 - 1;
|
|
13
|
+
const MAX_NEGATIVE_ID = -(2 ** 31 - 1);
|
|
14
|
+
// based on a binary image we will create plenty of small images
|
|
15
|
+
const data = new Int32Array(mask.size); // maxValue: maxPositiveId, minValue: maxNegativeId
|
|
16
|
+
// split will always return an array of images
|
|
17
|
+
let positiveId = 0;
|
|
18
|
+
let negativeId = 0;
|
|
19
|
+
const columnToProcess = new Uint16Array(MAX_TODO_ARRAY_FILTER + 1);
|
|
20
|
+
const rowToProcess = new Uint16Array(MAX_TODO_ARRAY_FILTER + 1);
|
|
21
|
+
for (let column = 0; column < mask.width; column++) {
|
|
22
|
+
for (let row = 0; row < mask.height; row++) {
|
|
23
|
+
if (data[row * mask.width + column] === 0) {
|
|
24
|
+
// need to process the whole surface
|
|
25
|
+
analyseSurface(column, row);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// x column
|
|
30
|
+
// y row
|
|
31
|
+
function analyseSurface(column, row) {
|
|
32
|
+
let from = 0;
|
|
33
|
+
let to = 0;
|
|
34
|
+
const targetState = mask.getBit(column, row);
|
|
35
|
+
const id = targetState ? ++positiveId : --negativeId;
|
|
36
|
+
assert(positiveId <= MAX_POSITIVE_ID && negativeId >= MAX_NEGATIVE_ID, 'too many regions of interest');
|
|
37
|
+
columnToProcess[0] = column;
|
|
38
|
+
rowToProcess[0] = row;
|
|
39
|
+
while (from <= to) {
|
|
40
|
+
const currentColumn = columnToProcess[from & MAX_TODO_ARRAY_FILTER];
|
|
41
|
+
const currentRow = rowToProcess[from & MAX_TODO_ARRAY_FILTER];
|
|
42
|
+
data[currentRow * mask.width + currentColumn] = id;
|
|
43
|
+
// need to check all around mask pixel
|
|
44
|
+
if (currentColumn > 0 &&
|
|
45
|
+
data[currentRow * mask.width + currentColumn - 1] === 0 &&
|
|
46
|
+
mask.getBit(currentColumn - 1, currentRow) === targetState) {
|
|
47
|
+
// LEFT
|
|
48
|
+
to++;
|
|
49
|
+
columnToProcess[to & MAX_TODO_ARRAY_FILTER] = currentColumn - 1;
|
|
50
|
+
rowToProcess[to & MAX_TODO_ARRAY_FILTER] = currentRow;
|
|
51
|
+
data[currentRow * mask.width + currentColumn - 1] = MAX_NEGATIVE_ID;
|
|
52
|
+
}
|
|
53
|
+
if (currentRow > 0 &&
|
|
54
|
+
data[(currentRow - 1) * mask.width + currentColumn] === 0 &&
|
|
55
|
+
mask.getBit(currentColumn, currentRow - 1) === targetState) {
|
|
56
|
+
// TOP
|
|
57
|
+
to++;
|
|
58
|
+
columnToProcess[to & MAX_TODO_ARRAY_FILTER] = currentColumn;
|
|
59
|
+
rowToProcess[to & MAX_TODO_ARRAY_FILTER] = currentRow - 1;
|
|
60
|
+
data[(currentRow - 1) * mask.width + currentColumn] = MAX_NEGATIVE_ID;
|
|
61
|
+
}
|
|
62
|
+
if (currentColumn < mask.width - 1 &&
|
|
63
|
+
data[currentRow * mask.width + currentColumn + 1] === 0 &&
|
|
64
|
+
mask.getBit(currentColumn + 1, currentRow) === targetState) {
|
|
65
|
+
// RIGHT
|
|
66
|
+
to++;
|
|
67
|
+
columnToProcess[to & MAX_TODO_ARRAY_FILTER] = currentColumn + 1;
|
|
68
|
+
rowToProcess[to & MAX_TODO_ARRAY_FILTER] = currentRow;
|
|
69
|
+
data[currentRow * mask.width + currentColumn + 1] = MAX_NEGATIVE_ID;
|
|
70
|
+
}
|
|
71
|
+
if (currentRow < mask.height - 1 &&
|
|
72
|
+
data[(currentRow + 1) * mask.width + currentColumn] === 0 &&
|
|
73
|
+
mask.getBit(currentColumn, currentRow + 1) === targetState) {
|
|
74
|
+
// BOTTOM
|
|
75
|
+
to++;
|
|
76
|
+
columnToProcess[to & MAX_TODO_ARRAY_FILTER] = currentColumn;
|
|
77
|
+
rowToProcess[to & MAX_TODO_ARRAY_FILTER] = currentRow + 1;
|
|
78
|
+
data[(currentRow + 1) * mask.width + currentColumn] = MAX_NEGATIVE_ID;
|
|
79
|
+
}
|
|
80
|
+
if (allowCorners) {
|
|
81
|
+
if (currentColumn > 0 &&
|
|
82
|
+
currentRow > 0 &&
|
|
83
|
+
data[(currentRow - 1) * mask.width + currentColumn - 1] === 0 &&
|
|
84
|
+
mask.getBit(currentColumn - 1, currentRow - 1) === targetState) {
|
|
85
|
+
// TOP LEFT
|
|
86
|
+
to++;
|
|
87
|
+
columnToProcess[to & MAX_TODO_ARRAY_FILTER] = currentColumn - 1;
|
|
88
|
+
rowToProcess[to & MAX_TODO_ARRAY_FILTER] = currentRow - 1;
|
|
89
|
+
data[(currentRow - 1) * mask.width + currentColumn - 1] =
|
|
90
|
+
MAX_NEGATIVE_ID;
|
|
91
|
+
}
|
|
92
|
+
if (currentColumn < mask.width - 1 &&
|
|
93
|
+
currentRow > 0 &&
|
|
94
|
+
data[(currentRow - 1) * mask.width + currentColumn + 1] === 0 &&
|
|
95
|
+
mask.getBit(currentColumn + 1, currentRow - 1) === targetState) {
|
|
96
|
+
// TOP RIGHT
|
|
97
|
+
to++;
|
|
98
|
+
columnToProcess[to & MAX_TODO_ARRAY_FILTER] = currentColumn + 1;
|
|
99
|
+
rowToProcess[to & MAX_TODO_ARRAY_FILTER] = currentRow - 1;
|
|
100
|
+
data[(currentRow - 1) * mask.width + currentColumn + 1] =
|
|
101
|
+
MAX_NEGATIVE_ID;
|
|
102
|
+
}
|
|
103
|
+
if (currentColumn > 0 &&
|
|
104
|
+
currentRow < mask.height - 1 &&
|
|
105
|
+
data[(currentRow + 1) * mask.width + currentColumn - 1] === 0 &&
|
|
106
|
+
mask.getBit(currentColumn - 1, currentRow + 1) === targetState) {
|
|
107
|
+
// BOTTOM LEFT
|
|
108
|
+
to++;
|
|
109
|
+
columnToProcess[to & MAX_TODO_ARRAY_FILTER] = currentColumn - 1;
|
|
110
|
+
rowToProcess[to & MAX_TODO_ARRAY_FILTER] = currentRow + 1;
|
|
111
|
+
data[(currentRow + 1) * mask.width + currentColumn - 1] =
|
|
112
|
+
MAX_NEGATIVE_ID;
|
|
113
|
+
}
|
|
114
|
+
if (currentColumn < mask.width - 1 &&
|
|
115
|
+
currentRow < mask.height - 1 &&
|
|
116
|
+
data[(currentRow + 1) * mask.width + currentColumn + 1] === 0 &&
|
|
117
|
+
mask.getBit(currentColumn + 1, currentRow + 1) === targetState) {
|
|
118
|
+
// BOTTOM RIGHT
|
|
119
|
+
to++;
|
|
120
|
+
columnToProcess[to & MAX_TODO_ARRAY_FILTER] = currentColumn + 1;
|
|
121
|
+
rowToProcess[to & MAX_TODO_ARRAY_FILTER] = currentRow + 1;
|
|
122
|
+
data[(currentRow + 1) * mask.width + currentColumn + 1] =
|
|
123
|
+
MAX_NEGATIVE_ID;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
from++;
|
|
127
|
+
assert(to - from <= MAX_TODO_ARRAY_FILTER, 'fromMask can not finish, the array to manage internal data is not big enough.' +
|
|
128
|
+
'You could improve mask by changing MAX_ARRAY');
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return new RoiMapManager({
|
|
132
|
+
width: mask.width,
|
|
133
|
+
height: mask.height,
|
|
134
|
+
data,
|
|
135
|
+
nbNegative: Math.abs(negativeId),
|
|
136
|
+
nbPositive: positiveId,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=fromMask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fromMask.js","sourceRoot":"","sources":["../../src/roi/fromMask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAUnD;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CACtB,IAAU,EACV,UAA2B,EAAE;IAE7B,MAAM,EAAE,YAAY,GAAG,KAAK,EAAE,GAAG,OA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qB,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC;oBAC1D,IAAI,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,GAAG,aAAa,GAAG,CAAC,CAAC;wBACrD,eAAe,CAAC;gBACpB,CAAC;YACH,CAAC;YAED,IAAI,EAAE,CAAC;YAEP,MAAM,CACJ,EAAE,GAAG,IAAI,IAAI,qBAAqB,EAClC,+EAA+E;gBAC7E,8CAA8C,CACjD,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,IAAI,aAAa,CAAC;QACvB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,IAAI;QACJ,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC;QAChC,UAAU,EAAE,UAAU;KACvB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { GetBorderPointsOptions } from '../maskAnalysis/index.js';
|
|
2
|
+
import type { Point } from '../utils/geometry/points.js';
|
|
3
|
+
import type { Roi } from './Roi.js';
|
|
4
|
+
/**
|
|
5
|
+
* Return an array with the coordinates of the pixels that are on the border of the ROI.
|
|
6
|
+
* The reference is the top-left corner of the ROI.
|
|
7
|
+
* @param roi - ROI to process.
|
|
8
|
+
* @param options - Get border points options.
|
|
9
|
+
* @returns The array of border pixels.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getBorderPoints(roi: Roi, options?: GetBorderPointsOptions): Point[];
|
|
12
|
+
//# sourceMappingURL=getBorderPoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBorderPoints.d.ts","sourceRoot":"","sources":["../../src/roi/getBorderPoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,GAAG,EACR,OAAO,GAAE,sBAA2B,GACnC,KAAK,EAAE,CAIT"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return an array with the coordinates of the pixels that are on the border of the ROI.
|
|
3
|
+
* The reference is the top-left corner of the ROI.
|
|
4
|
+
* @param roi - ROI to process.
|
|
5
|
+
* @param options - Get border points options.
|
|
6
|
+
* @returns The array of border pixels.
|
|
7
|
+
*/
|
|
8
|
+
export function getBorderPoints(roi, options = {}) {
|
|
9
|
+
const mask = roi.getMask();
|
|
10
|
+
return mask.getBorderPoints(options);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=getBorderPoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBorderPoints.js","sourceRoot":"","sources":["../../src/roi/getBorderPoints.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAC7B,GAAQ,EACR,UAAkC,EAAE;IAEpC,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IAE3B,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Mask } from '../Mask.js';
|
|
2
|
+
import type { Roi } from './Roi.js';
|
|
3
|
+
export interface GetMaskOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Should the ROI holes be filled in the resulting mask?
|
|
6
|
+
* @default `false`
|
|
7
|
+
*/
|
|
8
|
+
solidFill?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Generate a mask of an ROI.
|
|
12
|
+
* @param roi - The ROI to generate a mask for.
|
|
13
|
+
* @param options - Get mask options.
|
|
14
|
+
* @returns The ROI mask.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getMask(roi: Roi, options?: GetMaskOptions): Mask;
|
|
17
|
+
//# sourceMappingURL=getMask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMask.d.ts","sourceRoot":"","sources":["../../src/roi/getMask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,GAAE,cAAmB,GAAG,IAAI,CAsBpE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Mask } from '../Mask.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generate a mask of an ROI.
|
|
4
|
+
* @param roi - The ROI to generate a mask for.
|
|
5
|
+
* @param options - Get mask options.
|
|
6
|
+
* @returns The ROI mask.
|
|
7
|
+
*/
|
|
8
|
+
export function getMask(roi, options = {}) {
|
|
9
|
+
const { solidFill = false } = options;
|
|
10
|
+
const mask = new Mask(roi.width, roi.height, { origin: roi.origin });
|
|
11
|
+
for (let row = 0; row < roi.height; row++) {
|
|
12
|
+
for (let column = 0; column < roi.width; column++) {
|
|
13
|
+
if (roi.getMapValue(roi.origin.column + column, roi.origin.row + row) ===
|
|
14
|
+
roi.id) {
|
|
15
|
+
mask.setBit(column, row, 1);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
mask.setBit(column, row, 0);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (solidFill) {
|
|
23
|
+
mask.solidFill({ out: mask });
|
|
24
|
+
}
|
|
25
|
+
return mask;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=getMask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMask.js","sourceRoot":"","sources":["../../src/roi/getMask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAYlC;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,GAAQ,EAAE,UAA0B,EAAE;IAC5D,MAAM,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IACtC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IAErE,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC;QAC1C,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC;YAClD,IACE,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;gBACjE,GAAG,CAAC,EAAE,EACN,CAAC;gBACD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;YAC9B,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACd,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Roi } from './Roi.js';
|
|
2
|
+
import type { RoiMapManager } from './RoiMapManager.js';
|
|
3
|
+
export declare const RoiKind: {
|
|
4
|
+
readonly BLACK: "black";
|
|
5
|
+
readonly WHITE: "white";
|
|
6
|
+
readonly BW: "bw";
|
|
7
|
+
};
|
|
8
|
+
export type RoiKind = (typeof RoiKind)[keyof typeof RoiKind];
|
|
9
|
+
export interface GetRoisOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Minimal surface of the ROIs to keep.
|
|
12
|
+
* @default `0`
|
|
13
|
+
*/
|
|
14
|
+
minSurface?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Maximal surface of the ROIs to keep.
|
|
17
|
+
* @default `Number.MAX_SAFE_INTEGER`
|
|
18
|
+
*/
|
|
19
|
+
maxSurface?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Kind of ROIs to keep.
|
|
22
|
+
* @default `'white'`
|
|
23
|
+
*/
|
|
24
|
+
kind?: RoiKind;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Return an array of ROIs matching the options.
|
|
28
|
+
* @param roiMapManager - The ROI map manager containing the ROIs.
|
|
29
|
+
* @param options - Get ROIs options.
|
|
30
|
+
* @returns The array of ROIs.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getRois(roiMapManager: RoiMapManager, options?: GetRoisOptions): Roi[];
|
|
33
|
+
//# sourceMappingURL=getRois.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRois.d.ts","sourceRoot":"","sources":["../../src/roi/getRois.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,eAAO,MAAM,OAAO;;;;CAIV,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,aAAa,EAAE,aAAa,EAC5B,OAAO,GAAE,cAAmB,GAC3B,GAAG,EAAE,CAuBP"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { match } from 'ts-pattern';
|
|
2
|
+
import { computeRois } from './computeRois.js';
|
|
3
|
+
export const RoiKind = {
|
|
4
|
+
BLACK: 'black',
|
|
5
|
+
WHITE: 'white',
|
|
6
|
+
BW: 'bw',
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Return an array of ROIs matching the options.
|
|
10
|
+
* @param roiMapManager - The ROI map manager containing the ROIs.
|
|
11
|
+
* @param options - Get ROIs options.
|
|
12
|
+
* @returns The array of ROIs.
|
|
13
|
+
*/
|
|
14
|
+
export function getRois(roiMapManager, options = {}) {
|
|
15
|
+
const { minSurface = 0, maxSurface = Number.MAX_SAFE_INTEGER, kind = 'white', } = options;
|
|
16
|
+
if (roiMapManager.blackRois.length === 0 &&
|
|
17
|
+
roiMapManager.whiteRois.length === 0) {
|
|
18
|
+
computeRois(roiMapManager);
|
|
19
|
+
}
|
|
20
|
+
const rois = match(kind)
|
|
21
|
+
.with('black', () => roiMapManager.blackRois)
|
|
22
|
+
.with('white', () => roiMapManager.whiteRois)
|
|
23
|
+
.with('bw', () => [...roiMapManager.whiteRois, ...roiMapManager.blackRois])
|
|
24
|
+
.exhaustive();
|
|
25
|
+
return rois.filter((roi) => roi.surface >= minSurface && roi.surface <= maxSurface);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=getRois.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRois.js","sourceRoot":"","sources":["../../src/roi/getRois.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAInC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,EAAE,EAAE,IAAI;CACA,CAAC;AAsBX;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CACrB,aAA4B,EAC5B,UAA0B,EAAE;IAE5B,MAAM,EACJ,UAAU,GAAG,CAAC,EACd,UAAU,GAAG,MAAM,CAAC,gBAAgB,EACpC,IAAI,GAAG,OAAO,GACf,GAAG,OAAO,CAAC;IAEZ,IACE,aAAa,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC;QACpC,aAAa,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EACpC,CAAC;QACD,WAAW,CAAC,aAAa,CAAC,CAAC;IAC7B,CAAC;IAED,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;SACrB,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC;SAC5C,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC;SAC5C,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,aAAa,CAAC,SAAS,EAAE,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;SAC1E,UAAU,EAAE,CAAC;IAEhB,OAAO,IAAI,CAAC,MAAM,CAChB,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,IAAI,UAAU,IAAI,GAAG,CAAC,OAAO,IAAI,UAAU,CAChE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './colorRois.js';
|
|
2
|
+
export * from './computeRois.js';
|
|
3
|
+
export * from './fromMask.js';
|
|
4
|
+
export * from './getBorderPoints.js';
|
|
5
|
+
export * from './getMask.js';
|
|
6
|
+
export * from './getRois.js';
|
|
7
|
+
export * from './Roi.js';
|
|
8
|
+
export * from './RoiMapManager.js';
|
|
9
|
+
export * from './waterShed.js';
|
|
10
|
+
export * from './roi.types.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/roi/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
package/lib/roi/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './colorRois.js';
|
|
2
|
+
export * from './computeRois.js';
|
|
3
|
+
export * from './fromMask.js';
|
|
4
|
+
export * from './getBorderPoints.js';
|
|
5
|
+
export * from './getMask.js';
|
|
6
|
+
export * from './getRois.js';
|
|
7
|
+
export * from './Roi.js';
|
|
8
|
+
export * from './RoiMapManager.js';
|
|
9
|
+
export * from './waterShed.js';
|
|
10
|
+
export * from './roi.types.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/roi/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Roi } from '../Roi.js';
|
|
2
|
+
import type { Ellipse } from '../roi.types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Calculates ellipse on around ROI.
|
|
5
|
+
* @param roi - Region of interest.
|
|
6
|
+
* @returns Ellipse.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getEllipse(roi: Roi): Ellipse;
|
|
9
|
+
//# sourceMappingURL=getEllipse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEllipse.d.ts","sourceRoot":"","sources":["../../../src/roi/properties/getEllipse.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CA6G5C"}
|