summaryrefslogtreecommitdiffstats
path: root/julia/misc.jl
blob: 5d98e0b0bf4c6552d82696378bb3f36074f21068 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
### Julia image manipulation

Pkg.update()
Pkg.add("Images")
Pkg.add("ImageView")

using ImageView, Images
img = imread("my_photo.jpg")
# eg, rotate via a matrix transform
img.data = img.data'
display(img, pixelspacing = [1,1])

### Julia .mat loating

Pkg.update()
Pkg.add("MAT")
using MAT
file = matopen("matfile.mat")
read(file, "varname")
close(file)

file = matopen("matfile.mat", "w")
write(file, "varname", variable)
close(file)

vars = matread("matfile.mat")