rle-morphology
Advanced tools
Comparing version 0.0.0 to 0.0.2
@@ -1,9 +0,12 @@ | ||
var apply = require("rle-core").apply; | ||
var apply = require("rle-funcs").apply; | ||
var DILATE_FUNC = new Function("v", [ | ||
"var r = v[0];", | ||
"for(var i=1; i<v.length; ++i) {", | ||
"r = Math.min(r, v);", | ||
var DILATE_FUNC = new Function("p", "d", "retval", [ | ||
"var s = p[0];", | ||
"var r = p[0] ? -d[0] : d[0];", | ||
"for(var i=1; i<p.length; ++i) {", | ||
"r = Math.min(r, p[i] ? -d[i] : d[i]);", | ||
"s = s | p[i];", | ||
"}", | ||
"return r;" | ||
"retval[0] = s;", | ||
"retval[1] = Math.abs(r);" | ||
].join("\n")); | ||
@@ -15,8 +18,11 @@ | ||
var ERODE_FUNC = new Function("v", [ | ||
"var r = v[0];", | ||
"for(var i=1; i<v.length; ++i) {", | ||
"r = Math.max(r, v);", | ||
var ERODE_FUNC = new Function("p", "d", "retval", [ | ||
"var s = p[0];", | ||
"var r = p[0] ? -d[0] : d[0];", | ||
"for(var i=1; i<p.length; ++i) {", | ||
"r = Math.max(r, p[i] ? -d[i] : d[i]);", | ||
"s = s & p[i];", | ||
"}", | ||
"return r;" | ||
"retval[0] = s;", | ||
"retval[1] = Math.abs(r);" | ||
].join("\n")); | ||
@@ -28,3 +34,2 @@ | ||
exports.apply = apply; | ||
exports.dilate = dilate; | ||
@@ -31,0 +36,0 @@ exports.erode = erode |
{ | ||
"name": "rle-morphology", | ||
"version": "0.0.0", | ||
"version": "0.0.2", | ||
"description": "Mathematical morphology operations for narrow band level sets", | ||
"main": "morphology.js", | ||
"dependencies": { | ||
"rle-core": "~0.0.1" | ||
"rle-funcs": "0.0.*" | ||
}, | ||
"devDependencies": {}, | ||
"devDependencies": { | ||
"rle-core": "0.0.*", | ||
"rle-mesh": "0.0.*", | ||
"jquery-browserify": "*", | ||
"gl-shells": "*" | ||
}, | ||
"repository": { | ||
@@ -11,0 +16,0 @@ "type": "git", |
rle-morphology | ||
============== | ||
[Mathematical morphology](http://en.wikipedia.org/Mathematical_Morphology) operators for narrow band level sets. This is part of the [rle] collection of libraries. | ||
Mathematical morphology operations for narrow band level sets | ||
Installation | ||
============ | ||
Via npm: | ||
npm install rle-morphology | ||
API | ||
===== | ||
There are four different functions exported by this library. | ||
### `dilate(volume, structuring_element)` | ||
This dilates a volume by the structuring element. The structuring element is represented by a flat list of points, for example the output from one of the methods in `rle-stencils`. | ||
### `erode(volume, structuring_element)` | ||
Erodes the volume by the element. The basic input and behavior is consistent with `dilate`. | ||
### `opening(volume, structuring_element)` | ||
Performs a morphological opening. This is useful if you want to remove tiny features your shape. It is equivalent to doing: | ||
dilate(erode(volume, element), element) | ||
### `closing(volume, structuring_element)` | ||
Performs a morphological closing. This removes any tiny holes or cracks in your shape. It is equivalent to: | ||
erode(dilate(volume, element), element) | ||
Credits | ||
======= | ||
(c) 2013 Mikola Lysenko. BSD License |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
4220
7
68
36
4
+ Addedrle-funcs@0.0.*
+ Addedrle-funcs@0.0.6(transitive)
+ Addedrle-repair@0.0.4(transitive)
+ Addedrle-stencils@0.0.4(transitive)
- Removedrle-core@~0.0.1