Then, use the preview function with the import options object to preview the data. Initialize a SpreadsheetImportOptions object, specify the variable name, variable type, and the data starting cell. Create an import options object to read one variable from the file patients.xls. If your data is a single continuous trial, you can simply call ft_redefinetrial, supplying a trial definition in the config, e.g. Define Import Options for Variable in Spreadsheet File. Note also that if you want to add trial-specific information related to the short trials you cut out of the continuous representation, you need to create the trialinfo field only after your call to ft_redefinetrial. If your data represents a continuous recording, you can also consider taking a simple two-step approach by first representing your data into one long trial as described above, and then cutting it up into individual trials using ft_redefinetrial. The main FieldTrip data structures are jointly described in this FAQ. The data format is described in more detail in ft_datatype_raw. If your data consists of trials with a fixed length, then each vector data.time. variable length), that is why each trial needs an individual time axis. sampleinfo % optional array (Ntrial*2) containing the start and end % sample of each trialĮach trial can have a different number of samples (i.e. The dimensionality % is Ntrial*M, where M is an arbitrary number of columns. trialinfo % this field is optional, but can be used to store % trial-specific information, such as condition numbers, % reaction times, correct responses etc. time % cell-array containing a time axis for each % trial (1*Ntrial), each time axis is a 1*Nsamples vector data. trial % cell-array containing a data matrix for each % trial (1*Ntrial), each data matrix is a Nchan*Nsamples matrix data. fsample % sampling frequency in Hz, single number data. label % cell-array containing strings, Nchan*1 data. When calling for example ft_preprocessing, you should specify the headerformat, dataformat and eventformat configuration options as the name of your specific function.ĭata. However, there is a simple way you can still use your own reading functions: make your read_xxx_header, read_xxx_data and read_xxx_event functions, and be sure they are on the path. If you want to use ft_read_header/data/event for reading in your data, but your data format is very atypical and used only by your lab, it is preferred not to add the format to FieldTrip. Using your own low-level reading functions when calling ft_read_header/data/event Probably you will also have to add your file format to the ft_filetype function so that the files are properly recognized. These functions are wrappers around the code for many different file formats and provide a common interface. The first and preferred way of implementing a new data format is by extending the ft_read_header, ft_read_data and ft_read_event functions. There are two approaches for importing data from an unsupported format: you can extend FieldTrip with new code, or you can circumvent the import procedure. You can further customize the import options object at the variable level by using the getvaropts, setvartype, and setvaropts functions.Faq dataformat preprocessing How can I import my own data format? Passing name-value arguments to detectImportOptions customizes the import options object at the table level by helping the function detect the format of your data. You can set up the import options object based on the format of one of the files by using the detectImportOptions function and then use that object to specify how to import all your files. If you have multiple files to import and your files have a similar format, you can reuse the same import configuration for all your files by creating an import options object. Import Data from Multiple Files and Control Individual Variables Region OutageTime Loss Customers RestorationTime Cause
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |