Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rle-morphology

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rle-morphology - npm Package Compare versions

Comparing version 0.0.0 to 0.0.2

example/dilate/index.js

29

morphology.js

@@ -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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc