2 %>@ingroup misc classlabelsgroup
6 %> Facilitates generation of lists of sub-datasets -- specified by the classes that go into each --
using expression
9 %> This
class implements operations: plus, not, and unary minus
15 %> Hierarchical level(s) that will be used to isolate only certain classes within the dataset to work on. When you call @ref
16 %> set_baselabel(), you will define which class labels mounted using the levels in @c hie_base only will be considered for the
17 %> arithmetical operations
23 properties(Access=protected)
27 %> Obtained using @c
classlabels2cell() once @c classlabels and @c hie are set
31 %> Assigned by setting @c datalabel
35 properties(SetAccess=protected)
40 function o = set.classlabels(o, x)
42 o = o.calculate_cellmaps();
45 function z = get.classlabels(o)
49 function o = set.hie_split(o, x)
51 o = o.calculate_cellmaps();
54 function z = get.hie_split(o)
58 function o = set.hie_base(o, x)
60 o = o.calculate_cellmaps();
63 function z = get.hie_base(o)
67 function o = calculate_cellmaps(o)
68 if ~isempty(o.classlabels)
69 if ~isempty(o.hie_split)
72 if ~isempty(o.hie_base)
78 function o = set_baselabel(o, labels)
83 boolidxs = zeros(1, length(o.classlabels_));
84 for i = 1:length(labels)
85 boolidxs = boolidxs | strcmp(labels{i}, o.cellmap_data(:, 3))
';
87 o.activeidxs_ = find(boolidxs);
88 o.map = {o.activeidxs_}; % Map is set initially to active indexes
91 function z = get.map(o)
96 function o = uminus(o)
97 splitclasses = cell2mat(o.cellmap_split(:, 4));
98 n = numel(unique(splitclasses));
101 o.map{i} = setxor(intersect(find(splitclasses == i-1), o.activeidxs_), o.activeidxs_);
105 function o = plus(o, o2)
106 o.activeidxs_ = union(o.activeidxs_, o2.activeidxs_);
108 o.map = cell(1, numel(o.map)*numel(o2.map));
110 for i = 1:numel(temp)
111 for j = 1:numel(o2.map)
113 o.map{k} = [temp{i}, o2.map{j}];
119 for i = 1:numel(o.map)
120 o.map{i} = setxor(o.map{i}, o.activeidxs_);
Used by parse_classmaps.m.
function parse_classmaps(in ss, in classlabels, in hie_base, in hie_split)
function classlabels2cell(in classlabels, in new_hierarchy)