Skip to content

Commit

Permalink
Merge pull request #663 from juliohm/dilate-erode-wrappers
Browse files Browse the repository at this point in the history
Extend dilate/erode for ImageMeta
  • Loading branch information
timholy authored Aug 17, 2017
2 parents 23358eb + 720b98d commit 9ee8146
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Images.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ const is_little_endian = ENDIAN_BOM == 0x04030201
@reexport using ImageFiltering
@reexport using ImageMorphology

import ImageTransformations: restrict
using ImageMetadata: ImageMetaAxis
import ImageMorphology: dilate, erode
import ImageTransformations: restrict

using Base.Cartesian # TODO: delete this

Expand Down
3 changes: 3 additions & 0 deletions src/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,9 @@ function imROF(img::AbstractArray, lambda::Number, iterations::Integer)
out
end

# morphological operations for ImageMeta
dilate(img::ImageMeta, region=coords_spatial(img)) = shareproperties(img, dilate!(copy(data(img)), region))
erode(img::ImageMeta, region=coords_spatial(img)) = shareproperties(img, erode!(copy(data(img)), region))

# what are these `extr` functions? TODO: documentation

Expand Down

0 comments on commit 9ee8146

Please sign in to comment.