IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
vis_cv.m
Go to the documentation of this file.
1 %> @brief Visualization - Cluster Vectors
2 %>
3 %> @sa uip_vis_cv.m
4 classdef vis_cv < vis
5  properties
6  %> Input dataset. This dataset is used to calculate the average spectrum for each class
7  data_input;
9  data_hint = [];
10  %> See vis_loadings::idx_class_origin
11  idx_class_origin = 0;
13  flag_trace_minalt = 0;
15  flag_abs = 0;
17  peakdetector = [];
19  flag_envelope = 0;
21  flag_bmtable = 0;
22  end;
23 
24  methods
25  function o = vis_cv(o)
26  o.classtitle = 'Cluster Vectors';
27  o.inputclass = {'fcon_linear', 'block_cascade_base'};
28  end;
29  end;
30 
31  methods(Access=protected)
32  function out = do_use(o, obj)
33  out = [];
34  CV = data_get_cv(o.data_input, obj.L, o.idx_class_origin);
35  flag_p = ~isempty(o.peakdetector);
36 
37  if ~isempty(o.data_hint)
38  hintx = o.data_hint.fea_x;
39  hinty = mean(o.data_hint.X, 1);
40  else
41  hintx = [];
42  hinty = [];
43  end;
44 
45  % Eliminates the vector corresponding to the origin class
46  % This will synchonize colors with other plots that plot data from the
47  % origin class.
48  labels = o.data_input.classlabels;
49  colorindexes = 1:size(CV, 2);
50  if o.idx_class_origin > 0
51  CV(:, o.idx_class_origin) = [];
52  labels(o.idx_class_origin) = [];
53  colorindexes(o.idx_class_origin) = [];
54  end;
55 
56 
57  if ~o.flag_bmtable
58  draw_loadings(o.data_input.fea_x, CV, hintx, hinty, labels, o.flag_abs, ...
59  o.peakdetector, o.flag_trace_minalt, flag_p, flag_p, 0, o.flag_envelope, colorindexes);
60 
61  else
62  draw_loadings_pl(o.data_input.fea_x, CV, hintx, hinty, labels, o.flag_abs, ...
63  o.peakdetector, colorindexes);
64  end;
65 
66 
67 
68  format_xaxis(o.data_input);
69  set_title(o.classtitle, obj);
70  make_box();
71  end;
72  end;
73 end
Property flag_trace_minalt
Definition: vis_loadings.m:18
function make_box()
Property flag_abs
=0. Whether to take the abs() of the of the loadings
Definition: vis_loadings.m:21
Peak Detector.
Definition: peakdetector.m:6
Visualization base class.
Definition: vis.m:4
Property flag_envelope
Definition: vis_loadings.m:29
function draw_loadings(in x, in L, in x_hint, in hint, in legends, in flag_abs, in peakd, in flag_trace_minalt, in flag_draw_peaks, in flag_print_peaks, in flag_histogram, in flag_envelope, in colors)
Property flag_bmtable
=0. Activates the "Peak Location Plot" mode
Definition: vis_loadings.m:32
Property data_hint
(optional) Hint dataset. Used to plot a black dashed thin spectrum line on the background ...
Definition: vis_loadings.m:10
function data_get_cv(in data, in L, in idx_class_origin)
function set_title(in s, in obj)
Visualization - Cluster Vectors.
Definition: vis_cv.m:4
function draw_loadings_pl(in x, in L, in x_hint, in hint, in legends, in flag_abs, in peakd, in colorindexes)
function format_xaxis(in par)
Property peakdetector
=[]. Peak detector to mark peaks in the Loadings and Peak Location plots
Definition: vis_loadings.m:24