Skip to content

Commit

Permalink
Update data2bids.m
Browse files Browse the repository at this point in the history
1. Fixes a bug in which the cfg.channels values were accidentally used instead of the cfg.electrodes values
2. Fixes a bug in which the cfg values were accidentally used instead of the cfg.ieeg values
  • Loading branch information
marcelzwiers committed Jul 7, 2020
1 parent cd43e69 commit d4e9d8f
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions data2bids.m
Expand Up @@ -429,32 +429,32 @@
cfg.eeg.SubjectArtefactDescription = ft_getopt(cfg.eeg, 'SubjectArtefactDescription' ); % Freeform description of the observed subject artefact and its possible cause (e.g. "Vagus Nerve Stimulator", "non-removable implant"). If this field is left empty, it will be interpreted as absence of a source of (constantly present) artifacts.

%% iEEG specific fields
cfg.ieeg.iEEGReference = ft_getopt(cfg, 'iEEGReference' ); % REQUIRED. General description of the reference scheme used and (when applicable) of location of the reference electrode in the raw recordings (e.g. "left mastoid”, “bipolar”, “T01” for electrode with name T01, “intracranial electrode on top of a grid, not included with data”, “upside down electrode”). If different channels have a different reference, this field should have a general description and the channel specific reference should be defined in the _channels.tsv file.
cfg.ieeg.SamplingFrequency = ft_getopt(cfg, 'SamplingFrequency' ); % REQUIRED. Sampling frequency (in Hz) of all the iEEG channels in the recording (e.g., 2400). All other channels should have frequency specified as well in the channels.tsv file.
cfg.ieeg.PowerLineFrequency = ft_getopt(cfg, 'PowerLineFrequency' ); % REQUIRED. Frequency (in Hz) of the power grid where the iEEG recording was done (i.e. 50 or 60)
cfg.ieeg.SoftwareFilters = ft_getopt(cfg, 'SoftwareFilters' ); % REQUIRED. List of temporal software filters applied or ideally key:value pairs of pre-applied filters and their parameter values. (n/a if none).
cfg.ieeg.iEEGReference = ft_getopt(cfg.ieeg, 'iEEGReference' ); % REQUIRED. General description of the reference scheme used and (when applicable) of location of the reference electrode in the raw recordings (e.g. "left mastoid”, “bipolar”, “T01” for electrode with name T01, “intracranial electrode on top of a grid, not included with data”, “upside down electrode”). If different channels have a different reference, this field should have a general description and the channel specific reference should be defined in the _channels.tsv file.
cfg.ieeg.SamplingFrequency = ft_getopt(cfg.ieeg, 'SamplingFrequency' ); % REQUIRED. Sampling frequency (in Hz) of all the iEEG channels in the recording (e.g., 2400). All other channels should have frequency specified as well in the channels.tsv file.
cfg.ieeg.PowerLineFrequency = ft_getopt(cfg.ieeg, 'PowerLineFrequency' ); % REQUIRED. Frequency (in Hz) of the power grid where the iEEG recording was done (i.e. 50 or 60)
cfg.ieeg.SoftwareFilters = ft_getopt(cfg.ieeg, 'SoftwareFilters' ); % REQUIRED. List of temporal software filters applied or ideally key:value pairs of pre-applied filters and their parameter values. (n/a if none).
% cfg.ieeg.DCOffsetCorrection see https://github.com/bids-standard/bids-specification/issues/237
cfg.ieeg.HardwareFilters = ft_getopt(cfg, 'HardwareFilters' ); % REQUIRED. List of hardware (amplifier) filters applied with key:value pairs of filter parameters and their values.
cfg.ieeg.ElectrodeManufacturer = ft_getopt(cfg, 'ElectrodeManufacturer' ); % RECOMMENDED. can be used if all electrodes are of the same manufacturer (e.g. AD-TECH, DIXI). If electrodes of different manufacturers are used, please use the corresponding table in the _electrodes.tsv file.
cfg.ieeg.ElectrodeManufacturersModelName = ft_getopt(cfg, 'ElectrodeManufacturersModelName'); % RECOMMENDED. If different electrode types are used, please use the corresponding table in the _electrodes.tsv file.
cfg.ieeg.HardwareFilters = ft_getopt(cfg.ieeg, 'HardwareFilters' ); % REQUIRED. List of hardware (amplifier) filters applied with key:value pairs of filter parameters and their values.
cfg.ieeg.ElectrodeManufacturer = ft_getopt(cfg.ieeg, 'ElectrodeManufacturer' ); % RECOMMENDED. can be used if all electrodes are of the same manufacturer (e.g. AD-TECH, DIXI). If electrodes of different manufacturers are used, please use the corresponding table in the _electrodes.tsv file.
cfg.ieeg.ElectrodeManufacturersModelName = ft_getopt(cfg.ieeg, 'ElectrodeManufacturersModelName'); % RECOMMENDED. If different electrode types are used, please use the corresponding table in the _electrodes.tsv file.
% Manufacturer and ManufacturersModelName are general
cfg.ieeg.ECOGChannelCount = ft_getopt(cfg, 'ECOGChannelCount' ); % RECOMMENDED. Number of iEEG surface channels included in the recording (e.g. 120)
cfg.ieeg.SEEGChannelCount = ft_getopt(cfg, 'SEEGChannelCount' ); % RECOMMENDED. Number of iEEG depth channels included in the recording (e.g. 8)
cfg.ieeg.EEGChannelCount = ft_getopt(cfg, 'EEGChannelCount' ); % RECOMMENDED. Number of scalp EEG channels recorded simultaneously (e.g. 21)
cfg.ieeg.EOGChannelCount = ft_getopt(cfg, 'EOGChannelCount' ); % RECOMMENDED. Number of EOG channels
cfg.ieeg.ECGChannelCount = ft_getopt(cfg, 'ECGChannelCount' ); % RECOMMENDED. Number of ECG channels
cfg.ieeg.EMGChannelCount = ft_getopt(cfg, 'EMGChannelCount' ); % RECOMMENDED. Number of EMG channels
cfg.ieeg.MiscChannelCount = ft_getopt(cfg, 'MiscChannelCount' ); % RECOMMENDED. Number of miscellaneous analog channels for auxiliary signals
cfg.ieeg.TriggerChannelCount = ft_getopt(cfg, 'TriggerChannelCount' ); % RECOMMENDED. Number of channels for digital (TTL bit level) triggers
cfg.ieeg.RecordingDuration = ft_getopt(cfg, 'RecordingDuration' ); % RECOMMENDED. Length of the recording in seconds (e.g. 3600)
cfg.ieeg.RecordingType = ft_getopt(cfg, 'RecordingType' ); % RECOMMENDED. Defines whether the recording is “continuous” or “epoched”; this latter limited to time windows about events of interest (e.g., stimulus presentations, subject responses etc.)
cfg.ieeg.EpochLength = ft_getopt(cfg, 'EpochLength' ); % RECOMMENDED. Duration of individual epochs in seconds (e.g. 1) in case of epoched data
cfg.ieeg.iEEGGround = ft_getopt(cfg, 'iEEGGround' ); % RECOMMENDED. Description of the location of the ground electrode (“placed on right mastoid (M2)”).
cfg.ieeg.iEEGPlacementScheme = ft_getopt(cfg, 'iEEGPlacementScheme' ); % RECOMMENDED. Freeform description of the placement of the iEEG electrodes. Left/right/bilateral/depth/surface (e.g. “left frontal grid and bilateral hippocampal depth” or “surface strip and STN depth” or “clinical indication bitemporal, bilateral temporal strips and left grid”).
cfg.ieeg.iEEGElectrodeGroups = ft_getopt(cfg, 'iEEGElectrodeGroups' ); % RECOMMENDED. Field to describe the way electrodes are grouped into strips, grids or depth probes e.g. {'grid1': "10x8 grid on left temporal pole", 'strip2': "1x8 electrode strip on xxx"}.
cfg.ieeg.SubjectArtefactDescription = ft_getopt(cfg, 'SubjectArtefactDescription' ); % RECOMMENDED. Freeform description of the observed subject artefact and its possible cause (e.g. “door open”, ”nurse walked into room at 2 min”, ”seizure at 10 min”). If this field is left empty, it will be interpreted as absence of artifacts.
cfg.ieeg.ElectricalStimulation = ft_getopt(cfg, 'ElectricalStimulation' ); % OPTIONAL. Boolean field to specify if electrical stimulation was done during the recording (options are “true” or “false”). Parameters for event-like stimulation should be specified in the _events.tsv file (see example underneath).
cfg.ieeg.ElectricalStimulationParameters = ft_getopt(cfg, 'ElectricalStimulationParameters'); % OPTIONAL. Free form description of stimulation parameters, such as frequency, shape etc. Specific onsets can be specified in the _events.tsv file. Specific shapes can be described here in freeform text.
cfg.ieeg.ECOGChannelCount = ft_getopt(cfg.ieeg, 'ECOGChannelCount' ); % RECOMMENDED. Number of iEEG surface channels included in the recording (e.g. 120)
cfg.ieeg.SEEGChannelCount = ft_getopt(cfg.ieeg, 'SEEGChannelCount' ); % RECOMMENDED. Number of iEEG depth channels included in the recording (e.g. 8)
cfg.ieeg.EEGChannelCount = ft_getopt(cfg.ieeg, 'EEGChannelCount' ); % RECOMMENDED. Number of scalp EEG channels recorded simultaneously (e.g. 21)
cfg.ieeg.EOGChannelCount = ft_getopt(cfg.ieeg, 'EOGChannelCount' ); % RECOMMENDED. Number of EOG channels
cfg.ieeg.ECGChannelCount = ft_getopt(cfg.ieeg, 'ECGChannelCount' ); % RECOMMENDED. Number of ECG channels
cfg.ieeg.EMGChannelCount = ft_getopt(cfg.ieeg, 'EMGChannelCount' ); % RECOMMENDED. Number of EMG channels
cfg.ieeg.MiscChannelCount = ft_getopt(cfg.ieeg, 'MiscChannelCount' ); % RECOMMENDED. Number of miscellaneous analog channels for auxiliary signals
cfg.ieeg.TriggerChannelCount = ft_getopt(cfg.ieeg, 'TriggerChannelCount' ); % RECOMMENDED. Number of channels for digital (TTL bit level) triggers
cfg.ieeg.RecordingDuration = ft_getopt(cfg.ieeg, 'RecordingDuration' ); % RECOMMENDED. Length of the recording in seconds (e.g. 3600)
cfg.ieeg.RecordingType = ft_getopt(cfg.ieeg, 'RecordingType' ); % RECOMMENDED. Defines whether the recording is “continuous” or “epoched”; this latter limited to time windows about events of interest (e.g., stimulus presentations, subject responses etc.)
cfg.ieeg.EpochLength = ft_getopt(cfg.ieeg, 'EpochLength' ); % RECOMMENDED. Duration of individual epochs in seconds (e.g. 1) in case of epoched data
cfg.ieeg.iEEGGround = ft_getopt(cfg.ieeg, 'iEEGGround' ); % RECOMMENDED. Description of the location of the ground electrode (“placed on right mastoid (M2)”).
cfg.ieeg.iEEGPlacementScheme = ft_getopt(cfg.ieeg, 'iEEGPlacementScheme' ); % RECOMMENDED. Freeform description of the placement of the iEEG electrodes. Left/right/bilateral/depth/surface (e.g. “left frontal grid and bilateral hippocampal depth” or “surface strip and STN depth” or “clinical indication bitemporal, bilateral temporal strips and left grid”).
cfg.ieeg.iEEGElectrodeGroups = ft_getopt(cfg.ieeg, 'iEEGElectrodeGroups' ); % RECOMMENDED. Field to describe the way electrodes are grouped into strips, grids or depth probes e.g. {'grid1': "10x8 grid on left temporal pole", 'strip2': "1x8 electrode strip on xxx"}.
cfg.ieeg.SubjectArtefactDescription = ft_getopt(cfg.ieeg, 'SubjectArtefactDescription' ); % RECOMMENDED. Freeform description of the observed subject artefact and its possible cause (e.g. “door open”, ”nurse walked into room at 2 min”, ”seizure at 10 min”). If this field is left empty, it will be interpreted as absence of artifacts.
cfg.ieeg.ElectricalStimulation = ft_getopt(cfg.ieeg, 'ElectricalStimulation' ); % OPTIONAL. Boolean field to specify if electrical stimulation was done during the recording (options are “true” or “false”). Parameters for event-like stimulation should be specified in the _events.tsv file (see example underneath).
cfg.ieeg.ElectricalStimulationParameters = ft_getopt(cfg.ieeg, 'ElectricalStimulationParameters'); % OPTIONAL. Free form description of stimulation parameters, such as frequency, shape etc. Specific onsets can be specified in the _events.tsv file. Specific shapes can be described here in freeform text.

%% EMG is not part of the official BIDS specification
cfg.emg.SamplingFrequency = ft_getopt(cfg.emg, 'SamplingFrequency' );
Expand Down Expand Up @@ -561,13 +561,13 @@
cfg.channels.status_description = ft_getopt(cfg.channels, 'status_description' , nan); % OPTIONAL. Freeform text description of noise or artifact affecting data quality on the channel. It is meant to explain why the channel was declared bad in [status].

%% columns in the electrodes.tsv
cfg.electrodes.name = ft_getopt(cfg.channels, 'name' , nan); % REQUIRED. Name of the electrode
cfg.electrodes.x = ft_getopt(cfg.channels, 'x' , nan); % REQUIRED. Recorded position along the x-axis
cfg.electrodes.y = ft_getopt(cfg.channels, 'y' , nan); % REQUIRED. Recorded position along the y-axis
cfg.electrodes.z = ft_getopt(cfg.channels, 'z' , nan); % REQUIRED. Recorded position along the z-axis
cfg.electrodes.type = ft_getopt(cfg.channels, 'type' , nan); % RECOMMENDED. Type of the electrode (e.g., cup, ring, clip-on, wire, needle)
cfg.electrodes.material = ft_getopt(cfg.channels, 'material' , nan); % RECOMMENDED. Material of the electrode, e.g., Tin, Ag/AgCl, Gold
cfg.electrodes.impedance = ft_getopt(cfg.channels, 'impedance' , nan); % RECOMMENDED. Impedance of the electrode in kOhm
cfg.electrodes.name = ft_getopt(cfg.electrodes, 'name' , nan); % REQUIRED. Name of the electrode
cfg.electrodes.x = ft_getopt(cfg.electrodes, 'x' , nan); % REQUIRED. Recorded position along the x-axis
cfg.electrodes.y = ft_getopt(cfg.electrodes, 'y' , nan); % REQUIRED. Recorded position along the y-axis
cfg.electrodes.z = ft_getopt(cfg.electrodes, 'z' , nan); % REQUIRED. Recorded position along the z-axis
cfg.electrodes.type = ft_getopt(cfg.electrodes, 'type' , nan); % RECOMMENDED. Type of the electrode (e.g., cup, ring, clip-on, wire, needle)
cfg.electrodes.material = ft_getopt(cfg.electrodes, 'material' , nan); % RECOMMENDED. Material of the electrode, e.g., Tin, Ag/AgCl, Gold
cfg.electrodes.impedance = ft_getopt(cfg.electrodes, 'impedance' , nan); % RECOMMENDED. Impedance of the electrode in kOhm

%% information for the participants.tsv
cfg.participants = ft_getopt(cfg, 'participants', struct());
Expand Down

0 comments on commit d4e9d8f

Please sign in to comment.