Skip to content

Commit 9a38a03

Browse files
committed
integrate sparse reconstruction
1 parent d7fe2fb commit 9a38a03

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/RawFile.jl

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module RawFile
22

33
using IniFile
4+
using ProgressMeter
45

56
import 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

Comments
 (0)