rs_import_coordsets(coords, aux)
[data_out,aux_out]=rs_import_coordsets(data_in,aux) imports coordinates into a dataset structure with one record
This is the preferred method for bringing coordinates (as arrays) into the rs package, to create a dataset structure with one record, suitable for display and geometrical analysis.
- If more than one record is to be combined into a single
dataset structure, thenrs_concat_coordsetscan be used to combine several one-recorddataset structurescreated here into a singledataset structure. - If the record is in a file,
rs_read_coorddatacan be used for a single record, orrs_get_coordsetsfor multiple files. - For multiple coordinate sets collected with the same experimental paradigm, use
rs_get_coordsets, or use this routine and combine multipledataset structuresinto a singledataset structurewithrs_concat_coordsets. - No
ray structurewill be created; to do so, use rs_findrays - To createa a
coordinate structurebased on aquadratic form model, users_findraysand supply 'type_coords' to indicate the stimulus coordinates
Input arguments:
-
coords(float 2-D array, or cell array of float 2-D arrays) –the coordinates; see note below regarding coordinates.
-
aux(struct) –a structure, can be omitted, with fields
opts_import(struct) – metadata, can be omitted, with fields listed below. Fields nstims, typenames, and type_coords are used to create thestimulus metadata structure; fields type, paradigm_type, paradigm_name,extra, subj_id, subj_id_short, label, and label_long are used to create theset metadata structure. Any or all can be omitted.nstims(int) – number of stimuli; default determined from first non-empty entry in coordstypenames(cell array) – unique labels for stimuli; length should be equal to nstims; default is opts_import.typename_prefix followed by a sequential number, formatted with opts_import.typename_ndigitstypename_prefix(char) – prefix auto-generated stimulus names; default is 'type_'; see note below regarding customizationtypename_ndigits(int) – number of digits in suffix for auto-generated stimulus names; default is 2; see note below regarding customizationtype_coords(float 2-d array) – array with nstims rows specifing thestimulus coordinates; default is determined by opts_import.type_coords_deftype_coords_def(char) – method for auto-generation ofstimulus coordinates; default is 'none'; see note below regarding customization- 'none': type_coords=[]
- 'zeros': type_coords=zeros(nstims,1)
- 'ones': type_coords=ones(nstims,1)
- 'eye': type_coords=eye(nstims)
type(char) – overall category of coordinates; default is 'data'; alternatively, 'model' for coordinates originating in a computational modelparadigm_type(char) – overall category of experiment; default is 'unknown'; see note below regarding customizationparadigm_name(char) – subcategory of paradigm_type; default is opts_import.paradigm_type; see note below regarding customizationsubj_id(char) – full subject identifier; default is 'unknown'; see note below regarding customizationsubj_id_short(char) – short form of subj_id, e.g., for plot labels; default is opts_import.subj_idextra(char) – free-form identifier; default is []; see note below regarding customizationlabel_long(char) – data source, typically a file path and name; default is 'unknown'; see note below regarding customizationlabel(char) – short form of label_long; default is opts_import.label_long; see note below regarding customization
-
opts_check: options for consistency checking, with field
if_warn(int) – 1 to show warnings when datasets are checked for consistency, 0 to suppress; default is 1
Output arguments:
-
data_out(struct) –dataset structurewith one record, and fieldsds(singleton cell array) –coordinate structure, ds{1}{idim} is an array of [nstims idim] of coordinatessas(singleton cell array) –stimulus metadata structure, sas{1} is the stimulus metadata for the recordsets(singleton cell array) –set metadata structure, sets{1} is the response metadata for the record
-
aux_out(struct) –auxiliary outputs and parameter values used, with fields
Note regarding coordinates
- if 'coords' is a 2-dimensional array of size [nstims dmax], then coords(:,1:idim) is taken to be the coordinate set data_out.ds{1}{:,idim}, for each idim=1,...,dmax
- if 'coords' is a cell array, then coords{idim} should be of size [nstims idim] or empty, and, if non-empty, is taken to be the coordinate set for dimension idim.
Note regarding customization
The default values of these parameters can be changed by editing rs_aux_defaults_define, running it
once, and saving the workspace as rs_aux_defaults.mat.
For example, to change the default paradigm
type to 'cars', add or edit the line generic.opts_import.paradigm_type='cars'
in the section in which generic.opts_import fields are defined.
- typename_prefix
- typename_ndigits
- type_coords_def
- paradigm_type
- paradigm_name
- subj_id
- subj_id_short
- extra
- label_long
- label
See also: rs_concat_coordsets, rs_aux_customize, rs_check_coordsets, PSG_TYPE_COORDS_DEF.
Source code in src/rs_import_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 | |