[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-help
Subject:    [R] [R-pkgs] New package for morphology and smoothing in any number of	dimensions: mmand
From:       Jon Clayden <jon.clayden () gmail ! com>
Date:       2012-04-30 16:17:50
Message-ID: CAM9CR=2hLJUEk1fj0mUaea0WWGNE68S+uAYjuJDYhYX62S5f9g () mail ! gmail ! com
[Download RAW message or body]

Dear all,

I'm pleased to announce the release on CRAN of the "mmand" package
(for Mathematical Morphology in Any Number of Dimensions). It provides
functions for performing mathematical morphology (erode, dilate,
etc.), smoothing, and other kernel-based operations on array-like
objects of any dimensionality. The package is centred around a
flexible function called morph(), which can apply any kernel to array
elements, optionally conditioned on their value or number of nonzero
neighbours.

Operations such as erode and dilate are provided for 2D data by the
EBImage Bioconductor package, but mmand can be used for higher (and
lower!) dimensional data, can produce and apply anisotropic kernels,
and does not have external dependencies--except for the small, pure R
package "reportr" (also on CRAN), which is used for message reporting.

Owing to its more general, dimensionality-independent implementation,
mmand is a little slower than EBImage; but due to various performance
optimisations, run time is still very reasonable. For example:

> x <- EBImage::readImage(system.file("images", "shapes.png", package="EBImage"))
> k <- matrix(1,3,3)
>
> y1 <- EBImage::erode(x,k)
> y2 <- mmand::erode(x,k)
> identical(EBImage::imageData(y1),y2)
[1] TRUE
>
> system.time(for(i in 1:100) EBImage::closing(x,k))
  user  system elapsed
 1.791   0.047   1.837
> system.time(for(i in 1:100) mmand::closing(x,k))
  user  system elapsed
 3.267   0.018   3.287

A single closing (dilate followed by erode) operation therefore takes
around 1/30th of a second in this case.

I hope that this contribution will be useful.

All the best,
Jon

_______________________________________________
R-packages mailing list
R-packages@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic