1
1
module Images
2
2
3
- import Base. Iterators. take
4
- import Base: + , - , *
5
- import Base: abs, atan, clamp, convert, copy, copy!, delete!,
6
- eltype, get, getindex, haskey, hypot,
7
- imag, length, map, map!, maximum,
8
- minimum, ndims, one, parent, permutedims, real, reinterpret,
9
- reshape, resize!,
10
- setindex!, show, similar, size, sqrt,
11
- strides, sum, write, zero
12
-
13
- export float32, float64
14
3
export HomogeneousPoint
15
4
16
- using Base: depwarn
17
- using Base. Order: Ordering, ForwardOrdering, ReverseOrdering
18
-
19
5
using StaticArrays
20
- using Base64: Base64EncodePipe
21
-
22
- # CHECKME: use this or follow deprecation and substitute?
23
- using SparseArrays: findnz
24
-
25
- # "deprecated imports" are below
26
6
27
7
using Reexport
28
8
@reexport using ImageCore
29
- if isdefined ( ImageCore, :permuteddimsview )
30
- export permuteddimsview
31
- end
9
+ using ImageCore: NumberLike
10
+ using ImageCore . OffsetArrays
11
+ @reexport using ImageBase
32
12
33
- using FileIO
34
- export load, save
35
- import . Colors: Fractional
36
- import Graphics
37
- import Graphics: width, height, Point
38
- using StatsBase # TODO : eliminate this dependency
13
+ @reexport using FileIO: load, save
14
+ import Graphics # TODO : eliminate this direct dependency
15
+ import StatsBase # TODO : eliminate this dependency
39
16
using IndirectArrays, ImageCore. MappedArrays
40
17
41
- # TODO : can we get rid of these definitions?
42
- const NumberLike = Union{Number,AbstractGray}
43
- const RealLike = Union{Real,AbstractGray}
44
-
45
- const is_little_endian = ENDIAN_BOM == 0x04030201
18
+ const is_little_endian = ENDIAN_BOM == 0x04030201 # CHECKME(johnnychen94): is this still used?
46
19
47
20
@reexport using ImageTransformations
48
21
@reexport using ImageAxes
@@ -52,104 +25,43 @@ const is_little_endian = ENDIAN_BOM == 0x04030201
52
25
@reexport using ImageDistances
53
26
@reexport using ImageContrastAdjustment
54
27
@reexport using ImageQualityIndexes
28
+ @reexport using IntegralArrays
29
+ @reexport using IntegralArrays. IntervalSets. EllipsisNotation
55
30
56
- if isdefined (ImageQualityIndexes, :assess_psnr )
57
- # deprecated since ImageQualityIndexes v0.1.4
58
- Base. @deprecate_binding psnr assess_psnr
59
- Base. @deprecate_binding ssim assess_ssim
60
- else
61
- const psnr = ImageQualityIndexes. psnr
62
- export psnr
63
- end
64
-
65
- # Both ImageMetadata v0.9.0 and ImageAxes v0.6.0 deprecate the symbol data and
66
- # this causes a name conflict
67
- if isdefined (ImageMetadata, :arraydata )
68
- Base. @deprecate_binding data arraydata
69
- end
70
- # ImageMetadata < v0.9.0 compatibility
71
- if ! hasmethod (arraydata, (ImageMeta, ) )
72
- ImageAxes. arraydata (img:: ImageMeta ) = ImageMetadata. data (img)
73
- end
74
-
75
- # Non-exported symbol bindings to ImageShow
76
- import ImageShow
77
- if isdefined (ImageShow, :play )
78
- @doc (@doc ImageShow. play)
79
- const play = ImageShow. play
80
- else
81
- play (args... ; kwargs... ) = error (" The `Images.play` function requires ImageShow at least 0.3.0." )
82
- end
83
- if isdefined (ImageShow, :explore )
84
- @doc (@doc ImageShow. explore)
85
- const explore = ImageShow. explore
86
- else
87
- explore (args... ; kwargs... ) = error (" The `Images.explore` function requires ImageShow at least 0.3.0." )
88
- end
89
- if isdefined (ImageShow, :gif )
90
- @doc (@doc ImageShow. gif)
91
- const gif = ImageShow. gif
92
- else
93
- gif (args... ; kwargs... ) = error (" The `Images.gif` function requires ImageShow at least 0.3.0." )
94
- end
31
+ # Non-exported symbol bindings to ImageShow so that we can use, e.g., `Images.gif`
32
+ import ImageShow: play, explore, gif
95
33
96
34
# While we are bridging the old API and the new API in ImageContrastAdjustment
97
35
# we need to import these functions because we make new definitions for them
98
36
# in deprecations.jl
99
37
import ImageContrastAdjustment: build_histogram, adjust_histogram, adjust_histogram!
100
38
101
- using ImageMetadata: ImageMetaAxis
102
- import ImageMorphology: dilate, erode
103
- import ImageTransformations: restrict
104
39
using TiledIteration: EdgeIterator
105
40
41
+ # TODO (johnnychen94): (v1.0.0) remove these entry points
42
+ # Entry points that isn't used by JuliaImages at all (except for deprecations)
43
+ # They used to be accessible by, e.g., `Images.metadata`
44
+ import . Colors: Fractional
45
+ import FileIO: metadata
46
+ import Graphics: Point
47
+
106
48
include (" compat.jl" )
107
49
include (" misc.jl" )
108
50
include (" labeledarrays.jl" )
109
51
include (" algorithms.jl" )
110
- include (" exposure.jl" )
111
52
include (" deprecations.jl" )
112
53
include (" corner.jl" )
113
54
include (" edge.jl" )
114
55
115
56
export
116
57
# types
117
- BlobLoG,
118
58
ColorizedArray,
119
59
Percentile,
120
60
121
61
# macros
122
62
@test_approx_eq_sigma_eps ,
123
63
124
- # core functions
125
- assert_timedim_last,
126
- colordim,
127
- coords_spatial,
128
- copyproperties,
129
- data,
130
- height,
131
- maxabsfinite,
132
- maxfinite,
133
- minfinite,
134
- nimages,
135
- pixelspacing,
136
- properties,
137
- restrict,
138
- sdims,
139
- size_spatial,
140
- shareproperties,
141
- spacedirections,
142
- spatialorder,
143
- spatialproperties,
144
- timedim,
145
- width,
146
- widthheight,
147
-
148
64
# algorithms
149
- backdiffx,
150
- backdiffy,
151
- forwarddiffx,
152
- forwarddiffy,
153
65
imcorner,
154
66
imcorner_subpixel,
155
67
corner2subpixel,
@@ -160,17 +72,11 @@ export
160
72
meancovs,
161
73
gammacovs,
162
74
imedge, # TODO : deprecate?
163
- blob_LoG,
164
- findlocalmaxima,
165
- findlocalminima,
166
75
imgaussiannoise,
167
- imlineardiffusion,
168
- imROF,
169
76
otsu_threshold,
170
77
yen_threshold,
171
78
172
79
# Exposure
173
- complement,
174
80
imhist,
175
81
histeq,
176
82
adjust_gamma,
@@ -182,27 +88,18 @@ export
182
88
183
89
magnitude,
184
90
magnitude_phase,
185
- meanfinite,
186
- entropy,
187
91
orientation,
188
- padarray,
189
92
phase,
190
93
thin_edges,
191
94
thin_edges_subpix,
192
95
thin_edges_nonmaxsup,
193
96
thin_edges_nonmaxsup_subpix,
194
97
canny,
195
- integral_image,
196
- boxdiff,
197
- bilinear_interpolation,
198
98
gaussian_pyramid,
199
99
200
100
# phantoms
201
101
shepp_logan
202
102
203
- _length (A:: AbstractArray ) = length (eachindex (A))
204
- _length (A) = length (A)
205
-
206
103
"""
207
104
Constructors, conversions, and traits:
208
105
@@ -216,18 +113,17 @@ Contrast/coloration:
216
113
217
114
Algorithms:
218
115
219
- - Reductions: `maxfinite`, `maxabsfinite`, `minfinite`, `meanfinite`, `integral_image`, `boxdiff `, `gaussian_pyramid`
116
+ - Reductions: `maxfinite`, `maxabsfinite`, `minfinite`, `meanfinite`, `IntegralArray `, `gaussian_pyramid`
220
117
- Resizing: `restrict`, `imresize` (not yet exported)
221
118
- Filtering: `imfilter`, `imfilter!`, `mapwindow`, `imROF`, `padarray`
222
- - Filtering kernels: `Kernel.` or `KernelFactors.`, followed by `ando[345]`, `guassian2d `, `imaverage` , `imdog `, `imlaplacian`, ` prewitt`, `sobel`
119
+ - Filtering kernels: `Kernel.` or `KernelFactors.`, followed by `ando[345]`, `guassian `, `Laplacian' , `DoG `, `prewitt`, `sobel`, etc.
223
120
- Exposure : `imhist`, `histeq`, `adjust_gamma`, `histmatch`, `imadjustintensity`, `imstretch`, `imcomplement`, `clahe`, `cliphist`
224
121
- Gradients: `backdiffx`, `backdiffy`, `forwarddiffx`, `forwarddiffy`, `imgradients`
225
122
- Edge detection: `imedge`, `imgradients`, `thin_edges`, `magnitude`, `phase`, `magnitudephase`, `orientation`, `canny`
226
123
- Corner detection: `imcorner`,`imcorner_subpixel`, `harris`, `shi_tomasi`, `kitchen_rosenfeld`, `meancovs`, `gammacovs`, `fastcorners`
227
124
- Blob detection: `blob_LoG`, `findlocalmaxima`, `findlocalminima`
228
125
- Morphological operations: `dilate`, `erode`, `closing`, `opening`, `tophat`, `bothat`, `morphogradient`, `morpholaplace`, `feature_transform`, `distance_transform`, `convexhull`
229
126
- Connected components: `label_components`, `component_boxes`, `component_lengths`, `component_indices`, `component_subscripts`, `component_centroids`
230
- - Interpolation: `bilinear_interpolation`
231
127
232
128
Test images and phantoms (see also TestImages.jl):
233
129
0 commit comments