-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShowData.lua
More file actions
60 lines (58 loc) · 1.48 KB
/
ShowData.lua
File metadata and controls
60 lines (58 loc) · 1.48 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
require 'TensorSaveLoad'
require 'gnuplot'
require 'lfs'
lists = {}
listsNorm = {}
listsTest = {}
listsTestX = {}
listFolder = "NoveKostky";
fi = 1;
show = true;
save = false;
for file in lfs.dir(listFolder) do
if lfs.attributes(listFolder.."/"..file,"mode") == "file" then
--print("found file, "..file)
if string.find(file,"OUT") then
table.insert(listsTest,file);
elseif string.find(file,"norm") then
table.insert(listsNorm,file);
else
table.insert(lists,file);
end
end
end
for nolistsTest = 1,table.getn(listsTest) do
local data = NactiData(listFolder..'/'..listsTest[nolistsTest]);
if show then
gnuplot.figure(i)
gnuplot.imagesc(data,'color')
fi=fi+1;
end
end
CelaData = {}
for nolists = 1,table.getn(lists) do
local data = NactiData(listFolder..'/'..lists[nolists]);
table.insert(CelaData,data)
if show then
gnuplot.figure(i)
gnuplot.imagesc(data:select(1,10))
fi=fi+1;
end
data[{{1},{},{}}]=data:select(1,2)--[[
for x = 1,data:size(2) do
for y = 1,data:size(3) do
local d = data:select(2,x):select(2,y)
local dmin = d:min()
data[{{},{x},{y}}]=(d-dmin)/(d:max()-dmin)
end
end]]
if show then
gnuplot.figure(i)
gnuplot.plot(data:select(2,data:size(2)/2):select(2,data:size(3)/2))
fi=fi+1;
end
if save then
UlozData(listFolder..'/'..lists[nolists]..'norm',data)
end
end
print(table.getn(CelaData))