11module RawFile
22
33using IniFile
4+ using ProgressMeter
45
56import Base: size, ndims, read, get, setindex!, getindex
67
@@ -92,9 +93,11 @@ function getindex(f::Rawfile,x::UnitRange,y)
9293 fd = open (f. filename* f. extRaw," r" )
9394
9495 matrix = zeros (f. dtype, (length (x),length (y)))
96+ p = Progress (length (y), 1 , " Loading data..." )
9597 for l= 1 : length (y)
9698 seek (fd, ((y[l]- 1 )* f. size[1 ] + x[1 ] - 1 )* sizeof (f. dtype))
9799 matrix[:,l] = read (fd, f. dtype, length (x))
100+ next! (p)
98101 end
99102
100103 close (fd)
@@ -105,11 +108,13 @@ function getindex(f::Rawfile,x::UnitRange, y, z)
105108 fd = open (f. filename* f. extRaw," r" )
106109
107110 data = zeros (f. dtype, (length (x),length (y),length (z)))
111+ p = Progress (length (z), 1 , " Loading data..." )
108112 for r= 1 : length (z)
109113 for l= 1 : length (y)
110114 seek (fd, (((z[r]- 1 )* f. size[2 ] + (y[l]- 1 ))* f. size[1 ] + x[1 ] - 1 )* sizeof (f. dtype))
111115 data[:,l,r] = read (fd, f. dtype, length (x))
112116 end
117+ next! (p)
113118 end
114119
115120 close (fd)
0 commit comments