1
1
module RawFile
2
2
3
3
using IniFile
4
+ using ProgressMeter
4
5
5
6
import Base: size, ndims, read, get, setindex!, getindex
6
7
@@ -92,9 +93,11 @@ function getindex(f::Rawfile,x::UnitRange,y)
92
93
fd = open (f. filename* f. extRaw," r" )
93
94
94
95
matrix = zeros (f. dtype, (length (x),length (y)))
96
+ p = Progress (length (y), 1 , " Loading data..." )
95
97
for l= 1 : length (y)
96
98
seek (fd, ((y[l]- 1 )* f. size[1 ] + x[1 ] - 1 )* sizeof (f. dtype))
97
99
matrix[:,l] = read (fd, f. dtype, length (x))
100
+ next! (p)
98
101
end
99
102
100
103
close (fd)
@@ -105,11 +108,13 @@ function getindex(f::Rawfile,x::UnitRange, y, z)
105
108
fd = open (f. filename* f. extRaw," r" )
106
109
107
110
data = zeros (f. dtype, (length (x),length (y),length (z)))
111
+ p = Progress (length (z), 1 , " Loading data..." )
108
112
for r= 1 : length (z)
109
113
for l= 1 : length (y)
110
114
seek (fd, (((z[r]- 1 )* f. size[2 ] + (y[l]- 1 ))* f. size[1 ] + x[1 ] - 1 )* sizeof (f. dtype))
111
115
data[:,l,r] = read (fd, f. dtype, length (x))
112
116
end
117
+ next! (p)
113
118
end
114
119
115
120
close (fd)
0 commit comments