rs_get_coordsets(fullnames, aux)
[data_out,aux_out]=rs_get_coordsets(fullnames,aux): reads one or more coordinate files into a dataset structure
This is the preferred method for bringing coordinates from one or more files into a dataset structure suitable for display and geometrical analysis.
- For files generated by analysis of similarity judgments via [??how to refer to Python package], this will also import the goodness-of-fit data.
- A
ray structurewill be created. - If only a single data file is to be read,
rs_read_coorddatacan also be used. - This can also create a
coordinate structurebased on aquadratic form model, and can augmentbinary texture domaindata by symmetry. -
To import coordinates generated externally or that exist as arrays rather than in a file, use
rs_import_coordsets. -
For non-interactive reading, provide aux.nsets, aux.opts_read.data_fullnames, aux.opts_read.input_type, and set aux.opts_read.if_auto=1.
Input arguments:
-
fullnames(char or cell array of char) –full file name with path; if empty, it will be requested interactively. File names must contain the string '_coords'. See note below regarding setup files.
-
aux(struct) –a structure, can be omitted, with fields
nsets(int) – number of records to read, if zero (default), then requested at console, with console option to switch to guiopts_read(struct) – can be omitted, with fields listed belowif_gui(int) – 1 to use graphical interface to get files if file names are not supplied (default), 0 to use console; ignored if nsets=0; see note below regarding customizationif_log(int) – 1 to log progress, 0 to omit; default is 1; see note below regarding customizationif_auto(int) – 1 not to ask for confirmations, 0 to ask; default is 0; see note below regarding customizationnfiles_max(int) – maximum number of files to read; default is 100input_type(int or int 1-D array) – 1 for reading a coordinate file, 2 for reading aquadratic form model, 0 to ask; cycled through for each dataset; default is 0; see note below regarding customizationdata_fullname_def(char) – prompt for data file name; see note below regarding customizationui_filter(char) – file name filter that appears in graphical user interface when if_gui=1; defaults to '*_coords';see note below regarding customizationif_warn(int) – 1 to show warnings, 0 to omit; default is 1; see note below regarding customizationtype_coords(float 2-D array) – stimulus coordinates to use for non-reserved domain names, one row for each stimulus; default is emptytype_coords_def(char) – stimulus coordinates to use if type_coords is unspecified or empty; options are 'none', 'zeros', 'ones', or 'eye', seers_import_coordsets; default is 'none'; seers_import_coordsetsfor further details and how to customizedomain_list_def(cell array) – paradigm names for generic domain experiments; default is {'cars','tools','dwellings'}; determined by customization during installparadigm_type_def(char) – default paradigm type; default is determined by customization during installcoord_string(char) – a string in a data file name that delineates the end of the domain name; defaults to '_coords'setup_fullnames(cell array) – setup file full names; if empty, will be requested at console or via guisetup_fullname_def(char) – prompt for setup file namesetup_suffix(char) – suffix added to paradigm name to create the setup file name; default is 'S'type_class_aux(char) – a specified domain name and type_classif_symaug(int) – 1 to enable symmetry augmentation, 0 to omit, -1 to ask; default is 0if_symaug_log(int) – 1 to log symmetry augmentation, 0 to omit; default is 0sym_apply(char) – type of symmetry to apply; default is 'full', options are 'hflip','vflip','rot180','rot90','hvflip','diag','full','none'permutes(struct) – typically omitted; each field is a suggested ray permutation for the corresponding paradigm name, e.g., permutes.bgca=[2 1 3 4] specifies a reordering of the rays for paradigm 'bgca'permutes_ok(int) – typically omitted; 1 to accept suggested ray permutation, 0 to keep standard order; default is 1; see note below regarding customizationif_uselocal(int) – typically omitted; 0 to use options in rs_aux_defaults, 1 is reserved for maintenance; default is 0opts_qpred(struct) – a structure, can be omitted, with options forquadratic form model, with fieldsqform_datafile_def(char) – default name of the file with quadratic form models containing a structure r; see notes below quadratic form model and customizationqform_modeltype(int or int 1-D array) – list of indexes into qform_datafile_def for choice of model, used cyclically across records as needed. 0 -> ask at console; detault is 1 see note below re customizationif_log(int) – 1 to log calculation of quadratic form model, 0 to omit; default is 0if_pca_centroid(int) – 1 to force centroid of coordinates to 0 via PCA method, 0 to omit; default is 1negeig_makezero(int) – 1 to set negative eigenvalues to 0, 1 to omit; default is 1negtol(float) – eigenvalues between 0 and -negtol are set to zero before checking for negative eigenvalues; default is 10^-7opts_rays(struct) – options for identifying rays, may be omitted; seers_findraysfor detailsopts_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
Options related to stimulus coordinates, domains, and setup files (see notes below)
Options for symmetry augmentation (
binary texture domaindata only)Options for internal use and maintenance
Output arguments:
-
data_out(struct) –dataset structure, containing one 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_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 processingrayss(cell array of struct) – rayss{k} is theray structurefor the kth recordopts_read(cell array of struct) – opts_read{k} is aux.opts_read for reading the kth record, with defaults filled inopts_rays(cell array of struct) – opts_rays{k} are the options used for creating theray structurefor the kth recordopts_qpred(cell array of struct) – opts_qpred{k} are the options used for creating thequadratic form modelfor the kth record along withvar_tot(float) – total variance of the coordinatesvar_ex(float 1-D array) – variance explained by each dimension of the modelpredcoords(float 2-D array) – predcoords(istim,idim) is the model coordinate for stimulus istim in dimension idim
opts_check(struct) – aux.opts_check, with defaults filled insyms_list(struct) – structure with results of symmetry augmentationsym_apply(char) – the symmetry applied, see 'sym_apply' aboveprimary(int 1-D array) – primary(k) is pointer to the data that was augmented by symmetry to yield the kth recordaug(int 1-D array) – aug(k) indicates the symmetry that was used to yield the kth record, e.g., if there are n_sym total symmetries (e.g., n_sym=8 for 'full'), then aug is in [1:n_sym]. The pairs [primary(k) aug(k)] are unique; a contiguous block of n_sym pairs share one value of primary(k) and have sequential values of aug(k)syms_applied(cell array of char) – syms_applied{k} are thebinary texturecoordinates after symmetry transformation for record k
Note regarding domain names, stimulus coordinates, and setup files
-
The domain name is determined from the data file name based on the string preceding '_coords' (or, opts_read.coord_string, if customized). This in turn determines how stimulus coordinates are specified.
- For non-reserved domain names (opts_read.type_class_aux, or any domain in opts_read.domain_list_def), stimulus coordinates are specified by 'type_coords' and no setup file is used.
- Other domain names are reserved, and stimulus coordinates are specified by a 'setup file', whose suggested name is constructed from the data file name up to the string preceding opts_read.coord_string, and appending opts_read.setup_suffix
-
The domain name is also used to determine a 'type_class', which is used internally. This is carried out in psg_coorddata_parsename, as follows:
- The domains 'faces*' are reserved; type_class is faces_mpi; used with a setup file
- The domain 'irgb' is reserved; type_class is 'irgb'; used with a setup file
- The domain 'mater' is reserved; type_class is 'mater'; used with a setup file
- The domain opts_read.type_class_aux is NOT reserved; type class is type_class_aux; no setup file used
- Any domain that is listed in opts_read.domain_list_def is NOT reserved; type class is 'domain'; no setup file used
-
Otherwise, type_class is set to opts_read.type_class_def, ('btc' unless customized); used with a setup file
-
When a
dataset structureis written byrs_write_coordsets, the setup file information, if any, will be embedded. When that file is read in and an embedded setup file is detected, no setup file is requested. - Also see note below regarding customization
Note regarding quadratic form model
- Quadratic form models may be used to generate a
coordinate structurebased on stimulus coordinates. -
The file must a cell array r, and each r{imodel} has at least has structure r The quadratic form model file must contain a field r, which must contain
- results.qfit (float 2-D array): a symmetric matrix indicating the quadratic form which, when applied to stimulus coordinates, yields the model coordinates
- setup.label (char): a label for the model
-
See demos/opposites_qform_example.mat for an example file with four quadratic form models, applicable to a stimulus set in which stimuli have three coordinates
Note regarding customization
-
The defaults for the following parameters can be set by editing the line containing generic.opts_read.[param_name] in
rs_aux_defaults_define, running it once, and saving the workspace as rs_aux_defaults.mat.- if_gui
- ui_filter
- if_log
- if_warn
- if_auto
- data_fullname_def
- setup_fullname_def
- domain_list_def
- setup_suffix
- permutes_ok
- coord_string
- type_class_aux
- if_symaug
- sym_apply
- if_symaug_log
-
The defaults for the following parameters can be set by editing the line containing generic.opts_qpred.[param_name] in
rs_aux_defaults_define, running it once, and saving the workspace as rs_aux_defaults.mat.- qform_datafile_def
- qform_modeltype
See also: rs_aux_customize, rs_findrays, rs_check_coordsets, PSG_GET_COORDSETS, PSG_COORDDATA_PARSENAME.
Source code in src/rs_get_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 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | |