IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
report_soitem_items.m
Go to the documentation of this file.
1 %> @brief Shows curves or images from foldmerge of some model selection (e.g. clarchsel or fearchsel)
2 %>
4  methods
5  function o = report_soitem_items()
6  o.classtitle = 'Curves/Images from Model Selection';
7  o.inputclass = 'soitem_items';
8  o.flag_params = 0;
9  end;
10  end;
11 
12 
13 
14  methods(Access=protected)
15  function out = do_use(o, obj)
16  s = '';
17 
18  if numel(obj.items) > 0 && ~isempty(obj.items{1}.sovalues) % Avoids error when items is empty
19 
20  % Extract sovalues from soitem_items
21  out = obj.extract_sovalues();
22  sov = out;
23 
24  nd = ndims(sov.values);
25  if nd == 3
26  % If 3D, plot all images slicing through the second dimension
28  p.dimspec = {[1 0 0], [1 2]};
29  p.valuesfieldname = 'rates';
30  p.clim = [];
31  p.flag_logtake = 0;
32  p.flag_transpose = 0;
33  p.flag_star = 0;
34  v_image = p;
35 
36  no_cases = size(sov.values, 1);
37  for i = 1:no_cases
38  v_image.dimspec = {[i 0 0], [1 2]};
39 
40  figure;
41  v_image.use(sov);
42  maximize_window(); s = cat(2, s, o.save_n_close());
43  end;
44  elseif nd == 2
45  % If 2D, extract dataset and plot 3 things:
47  p.dimspec = {[0 0], [1 2]};
48  p.valuesfieldname = 'rates';
49  blbl_extract_ds_from_sovalues01 = p;
50 
51  [blbl_extract_ds_from_sovalues01, out] = blbl_extract_ds_from_sovalues01.use(sov);
52  ds = out;
53 
54  % - Hachures
55  p = vis_hachures();
56  vis_hachures01 = p;
57  figure;
58  vis_hachures01.use(ds);
59  a = get(gca, 'title');
60  set(a, 'string', ['Std hachures & Averages - ', sov.ax(2).label, ' - "', get(a, 'string'), '"']);
61  maximize_window([], 2.5);
62  s = cat(2, s, o.save_n_close());
63 
64  % - Individual curves + average
65  p = vis_alldata();
66  vis_alldata01 = p;
67  figure;
68  vis_alldata01.use(ds);
69  hold on;
70  p = vis_means();
71  p.flag_pieces = 0;
72  vis_means01 = p;
73  vis_means01.use(ds);
74  a = get(gca, 'title');
75  set(a, 'string', ['Individual & Averages - ', sov.ax(2).label, ' - "', get(a, 'string'), '"'])
76  set(gca(), 'ylim', [min(ds.X(:)), max(ds.X(:))]);
77  make_box();
78  maximize_window([], 2.5);
79  s = cat(2, s, o.save_n_close());
80 
81 % What for??? % % % - Averages only
82 % % % figure;
83 % % % vis_means01.use(ds);
84 % % % % maximize_window([], 2.5);
85 % % % a = get(gca, 'title');
86 % % % set(a, 'string', ['Averages - ', sov.ax(2).label, ' - "', get(a, 'string'), '"']);
87 % % % maximize_window([], 2.5);
88 % % % s = cat(2, s, o.save_n_close());
89  end;
90  end;
91 
92  out = log_html();
93  out.html = [o.get_standardheader(obj), s];
94  out.title = obj.get_description();
95  end;
96  end;
97 end
function make_box()
function maximize_window(in h, in aspectratio, in normalizedsize)
Visualization - All curves in dataset.
Definition: vis_alldata.m:2
Draws image from a sovalues object.
Hachures showing intervals.
Definition: vis_hachures.m:2
Generated by irreport, carries HTML contents.
Definition: log_html.m:2
Extracts dataset from sovalues.
Visualization - Class means.
Definition: vis_means.m:2
Shows curves or images from foldmerge of some model selection (e.g. clarchsel or fearchsel) ...
Base for all reports that operate on a soitem object.
Definition: report_soitem.m:2