rs_align_coordsets(data_in, aux)
[data_out,aux_out]=rs_align_coordsets(data_in,aux)
aligns a dataset structure with partially overlapping stimuli
Each of the records in the dataset structure data_in contains the responses to one or more stimuli,
with stimulus identity in record k determined by the strings in data_in.sas{k}.typenames. The stimuli
in each of the records may differ, and may overlap.
Each of the corresponding records in the dataset structure data_out has a stimulus set
equal to the union of all of the stimulus sets in the records of data_in. For a stimulus in the kth record of
data_out for which there is no entry in data_in, the coordinates are NaN. See note below regarding stimulus coordinates.
The stimulus labels in data_out.sas{k}.typenames are in alphabetical order, and are identical for all of the records
Thus, even if there is complete overlap between the stimuli in data_in, the dataset structure data_out may differ.
The stimulus coordinates in data_out.sas{k} are correspondingy aligned; see note below regarding stimulus coordinates.
Input arguments:
-
data_in(struct) –dataset structureto be aligned containing n records, with fieldsds(cell array) –coordinate structure, ds{k}{idim} is an array of [nstims idim] of coordinates for the kth recordsas(cell array) –stimulus metadata structure, sas{k} is the stimulus metadata for the kth recordsets(cell array) –set metadata structure, sets{k} is the response metadata for the kth record
-
aux(struct) –auxiliary options, may be omitted, with fields
opts_align(struct) – options for alignment and consistency checking, with fieldsif_log(int) – 1 to log progress, 0 to suppress; default is 1min(int or char) – minimum number of datasets that must contain a stimulus, in order for the stimulus to be included in data_out; default is 1, equivalent to 'any'; can also be 'all', meaning that stimuli must be present in all datasets to be included in data_outif_type_coords_remake(int) – controls alignment of stimulus coordinates, typically omitted or set to [], see note below regarding stimulus coordinatesif_btcremz(int) – typically omitted, defaults to 1, see note below regarding labels for binary texture coordinates
opts_check(struct) – options for consistency checking, with fieldif_warn(int) – 1 to show warnings when datasets are checked for consistency, 0 to suppress; default is 1
opts_rays(struct) – options for rays, typically omitted; see note below regarding rays
Output arguments:
-
data_out(struct) –aligned
dataset structurewith n records, same format as asdata_in -
aux_out(struct) –auxiliary outputs and parameter values used, with fields
warnings(char) – warnings generated during consistency checkwarn_bad(int) – number of warnings that prevent further processingopts_align(struct) – aux.opts_align, with defaults filled in, and alsoovlp_array_all(integer array) – the overlap array for the pooled dataset. Each row corresponds to one of the typenames (see sa_pooled below) contained in any of the input records; ovlp_array_all(s,k)=1 if the stmulus is present in record k ofdata_in
opts_check(struct) – aux.opts_check, with defaults filled inopts_import(struct) – aux.opts_import, with defaults filled inopts_rays(cell array) – opts_rays{k} is a structure which contains the options used for creating rays in record k indata_outovlp_array(int 2-D array) – ovlp_array(s,k)=1 if the stimulus data_out.sets{:}.typenames{s} is present in record k ofdata_in, 0 otherwisesa_pooled(struct) – thestimulus metadata structurefor the pooled stimulus set; see note below regarding stimulus coordinatesrayss(cell array of struct) – rayss{k} is theray structurefor record k indata_out; see note below regarding raysopts_btcremz(cell array of struct) – see note below regarding labels for binary texture coordinates
General notes
- For all records with data_in.sets{k}.type='data', the strings in data_in.sets{k}.paradigm_type must agree.
- Pipeline: data_out.sets{k}.pipeline.sets{1} contains metadata for the kth record of
data_in; data_out.sets{k}.pipeline.sets_combined{:} contains metadata from all records ofdata_in; data_out.sets{1}.pipeline.type='align'.
Note regarding stimulus coordinates
-
Stimulus coordinates are optionally present in data_in.sas{k} in the fields type_coords, btc_specoords, or btc_augcoords. Their treatment is governed by aux.opts_align.if_type_coords_remake. If this field is omitted or [], behavior is determined by the stimulus coordinates supplied in data_in.sas{k}. A value of 0 attempts to merge the coordinates, a value of 1 does not.
-
Merging (if_type_coords_remake=0, or, stimulus coordinates are not all 0 or 1, or a non-square array with at least 2 columns): In the aligned
stimulus metadata structuredata_out.sas{k}, if the stimulus typename is not present in data_in.sas{k}, stimulus coordinates are NaN. In the pooledstimulus metadata structureaux_out.sa_pooled, stimulus coordinates are taken from the first occurence of the typename in data_in.sas{:} is used. A similar behavior is applied to other subfields of the stimulus metadata structure that relate to individual stimuli. These fields are listed in aux_out.opts_align.fields_align, which defaults in psg_align_coordsets to {'specs' 'spec_labels' 'btc_augcoords' 'btc_specoords' 'type_coords'} -
No merging (if_type_coords_remake=1, or stimulus coordinates absent, or, stimulus coordinates do not meet above requirements): In the aligned
stimulus metadata structuredata_out.sas{k}, dummy coordinates are created in one of the fields type_coords, btc_specoords, or btc_augcoords (the field chosen is determined by the first of that list that is found in data_in.sas{:}). The dummy coordinates can be an empty matrix, zeros, ones, or the identity, as determined by aux.opts_import.type_coords_def. This defaults to 'none', can be 'zeros','ones', or 'eye', and the value used is reported in aux_out.opts_import.type_coords_def and aux_out.opts_align.type_coords_def. -
The behavior taken is reported in aux_out.opts_align.if_type_coords_remake.
Note regarding rays
- The
ray structuredescribes relationships among the simulus coordinates:rays, i.e., sets of stimuli that lie along an axis or a ray from the origin,rings, stimuli that lie at an approximately equal distance from the origin, and nearest neighbors. It is only created if there is a valid set of stimulus coordinates.
Note regarding labels for binary texture coordinates
- if_btcremz is only relevant for
binary texture domainmetadata, and controls whether an attempt should be made to simplify fields sas{k}.spec_labels and sas{k}.typenames prior to matching and alignmnent. If 1 (default), coordinates that are specified as zero are removed, provided that this does not change the stimulus after maximum-entropy extension. For example, in data_in.sas{k}.spec_labels, 'b=-0.00 c=-0.40' becomes 'c=-0.40' the corresponding entry in data_in.sas{k}.typenames, 'bm0000cm0400' becomes 'cm0400'. An all-zero coordinate becomes 'rand'. Results for simplification of record k are returned in opts_btcremz{k}.
See also
rs_aux_customize, rs_findrays, PSG_ALIGN_COORDSETS, rs_import_coordsets, PSG_COORD_PIPE_UTIL, PSG_BTCREMZ, rs_check_coordsets.
Source code in src/rs_align_coordsets.m
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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | |