@@ -17,8 +17,8 @@ julia> img = ImageMeta(fill(RGB(1,0,0), 3, 2), date=Date(2016, 7, 31), time="hig
17
17
RGB ImageMeta with:
18
18
data: 3×2 Array{RGB{N0f8},2} with eltype RGB{Normed{UInt8,8}}
19
19
properties:
20
- time: high noon
21
20
date: 2016-07-31
21
+ time: high noon
22
22
```
23
23
24
24
``` @meta
@@ -38,18 +38,18 @@ RGB{N0f8}(1.0,0.0,0.0)
38
38
and access and set properties like this:
39
39
40
40
``` jldoctest
41
- julia> img[" time"]
41
+ julia> img. time
42
42
"high noon"
43
43
44
- julia> img[" time"] = "evening"
44
+ julia> img. time = "evening"
45
45
"evening"
46
46
47
47
julia> img
48
48
RGB ImageMeta with:
49
49
data: 3×2 Array{RGB{N0f8},2} with eltype RGB{Normed{UInt8,8}}
50
50
properties:
51
- time: evening
52
51
date: 2016-07-31
52
+ time: evening
53
53
```
54
54
55
55
You can extract the data matrix with ` data(img) ` :
@@ -66,9 +66,9 @@ and the properties dictionary with `properties`:
66
66
67
67
``` jldoctest
68
68
julia> properties(img)
69
- Dict{String ,Any} with 2 entries:
70
- "time" => "high noon"
71
- "date" => 2016-07-31
69
+ Dict{Symbol ,Any} with 2 entries:
70
+ :date => 2016-07-31
71
+ :time => "high noon"
72
72
```
73
73
74
74
Properties are not accessed or modified by most of Images'
@@ -86,8 +86,8 @@ julia> c = img[1:2, 1:2]
86
86
RGB ImageMeta with:
87
87
data: 2×2 Array{RGB{N0f8},2} with eltype RGB{Normed{UInt8,8}}
88
88
properties:
89
- time: high noon
90
89
date: 2016-07-31
90
+ time: high noon
91
91
```
92
92
93
93
This copies both the data (just the relevant portions) and the properties dictionary. In contrast,
@@ -97,8 +97,8 @@ julia> v = view(img, 1:2, 1:2)
97
97
RGB ImageMeta with:
98
98
data: 2×2 view(::Array{RGB{N0f8},2}, 1:2, 1:2) with eltype RGB{Normed{UInt8,8}}
99
99
properties:
100
- time: high noon
101
100
date: 2016-07-31
101
+ time: high noon
102
102
```
103
103
104
104
shares both the data and the properties with the original image
@@ -134,19 +134,19 @@ julia> A = reshape(1:15, 3, 5)
134
134
2 5 8 11 14
135
135
3 6 9 12 15
136
136
137
- julia> img = ImageMeta(A, spatialproperties=Set([" maxsum" ]), maxsum=[maximum(sum(A,dims=1)), maximum(sum(A,dims=2))])
137
+ julia> img = ImageMeta(A, spatialproperties=Set([: maxsum]), maxsum=[maximum(sum(A,dims=1)), maximum(sum(A,dims=2))])
138
138
Int64 ImageMeta with:
139
139
data: 3×5 reshape(::UnitRange{Int64}, 3, 5) with eltype Int64
140
140
properties:
141
141
maxsum: [42, 45]
142
- spatialproperties: Set([" maxsum" ])
142
+ spatialproperties: Set(Symbol[: maxsum])
143
143
144
144
julia> imgp = permutedims(img, (2,1))
145
145
Int64 ImageMeta with:
146
146
data: 5×3 Array{Int64,2}
147
147
properties:
148
148
maxsum: [45, 42]
149
- spatialproperties: Set([" maxsum" ])
149
+ spatialproperties: Set(Symbol[: maxsum])
150
150
151
151
julia> maximum(sum(imgp, dims=1))
152
152
45
0 commit comments