From be45c95e2488a588831b95de902621c839297aa2 Mon Sep 17 00:00:00 2001 From: Konstantinos Tsilimparis Date: Wed, 18 Sep 2024 15:10:21 +0200 Subject: [PATCH 1/5] Deleting files that failed during cloning script .md and reproducescript .md have a space between the name of the file and the file extension. Thus I cannot clone them in my local windows machine. --- "tag/reproducescript\r.md" | 4 ---- "tag/script\r.md" | 4 ---- 2 files changed, 8 deletions(-) delete mode 100644 "tag/reproducescript\r.md" delete mode 100644 "tag/script\r.md" diff --git "a/tag/reproducescript\r.md" "b/tag/reproducescript\r.md" deleted file mode 100644 index 9f18a513b..000000000 --- "a/tag/reproducescript\r.md" +++ /dev/null @@ -1,4 +0,0 @@ ---- -layout: tag -tag: reproducescript ---- diff --git "a/tag/script\r.md" "b/tag/script\r.md" deleted file mode 100644 index 5e6335c47..000000000 --- "a/tag/script\r.md" +++ /dev/null @@ -1,4 +0,0 @@ ---- -layout: tag -tag: script ---- From e9de677b31cb8d313681bcc84e504c4c0a09e03e Mon Sep 17 00:00:00 2001 From: Konstantinos Tsilimparis Date: Wed, 18 Sep 2024 15:28:41 +0200 Subject: [PATCH 2/5] Create why_should_I_set_cfg.continuous_equal_to_yes_when_preprocessing_ctf_trial_based_data.md --- ...ual_to_yes_when_preprocessing_ctf_trial_based_data.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 faq/why_should_I_set_cfg.continuous_equal_to_yes_when_preprocessing_ctf_trial_based_data.md diff --git a/faq/why_should_I_set_cfg.continuous_equal_to_yes_when_preprocessing_ctf_trial_based_data.md b/faq/why_should_I_set_cfg.continuous_equal_to_yes_when_preprocessing_ctf_trial_based_data.md new file mode 100644 index 000000000..4b6a29545 --- /dev/null +++ b/faq/why_should_I_set_cfg.continuous_equal_to_yes_when_preprocessing_ctf_trial_based_data.md @@ -0,0 +1,9 @@ +--- +title: Why should I set cfg.continuous = 'yes' when preprocessing CTF trial-based data? +tags: [faq, ctf, preprocessing] +--- + +# Why should I set cfg.continuous = 'yes' when preprocessing CTF trial-based data? + +When storing a continuous CTF recording in disk, the CTF acquisition software automatically adds a trigger every 10 seconds alongside your custom triggers. To virtually stitch together these 10-second segments into one continuous recording , you must set cfg.continuous = 'yes' in **[ft_preprocessing](/reference/ft_preprocessing)**. That way you can perform trial-based MEG analysis using your custom triggers. This is also done in the [Preprocessing - Segmenting and reading trial-based EEG and MEG data](tutorial/preprocessing) tutorial. + From b218eacc3fdd4bc85e03fe8b59c6b9a74efcbb3f Mon Sep 17 00:00:00 2001 From: Robert Oostenveld Date: Thu, 19 Sep 2024 09:26:11 +0200 Subject: [PATCH 3/5] renamed and updated --- faq/continuous.md | 18 ++++++++++++++++++ ..._when_preprocessing_ctf_trial_based_data.md | 9 --------- 2 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 faq/continuous.md delete mode 100644 faq/why_should_I_set_cfg.continuous_equal_to_yes_when_preprocessing_ctf_trial_based_data.md diff --git a/faq/continuous.md b/faq/continuous.md new file mode 100644 index 000000000..06a1fa91f --- /dev/null +++ b/faq/continuous.md @@ -0,0 +1,18 @@ +--- +title: Why should I set cfg.continuous = 'yes' when preprocessing CTF trial-based data? +tags: [faq, ctf, preprocessing, continuous] +--- + +# Why should I set cfg.continuous = 'yes' when preprocessing CTF trial-based data? + +The CTF acquisition software by default writes data to disk in blocks. The length of these blocks can be configured, and at the DCCN this is set to 10 seconds. So the continuous recording is actually pseudo-continuous and consists of blocks of 10 seconds, where block N is followed smoothly without gaps by block N+1. However, the CTF acquisition software can also be configured to only write a block of data to disk upon a trigger. This results in "epoched" data, where only the data corresponding to the trial is written to disk and the data in the inter trial intervals is not. In this case there is a gap between block N and block N+1. If you were to read the epoched data as if it were continuously, you won't see the gaps as such along the time axis, but you will see jumps in the data as the signal may have drifted from block N to block N+1. + +FieldTrip does not distinguish between the CTF files that are written as blocks in continuous mode, without gaps, and CTF files that are written as epochs with gaps between the blocks. The low-level reading functions by default will give an error when you try to read data that extends over a boundary between two blocks, but the `cfg.continuous` option in **[ft_preprocessing](/reference/ft_preprocessing)** allows you to override that. + +The "Subject01.ds" CTF dataset that is used in some tutorials is epoched and has gaps between the trials. If you were to read that as continuous, you would see discontinuities in the MEG channels. If you were to apply the automatic artifact detection functions on that as continuous data, many trials would be detected as an artifact as they start/end with a discontinuous jump in some of the channels. Hence when reading that data the `cfg.continuous` option should be set to `"no"` (which is the default). + +Many other CTF datasets are recorded as pseudocontinuous without gaps between the blocks and for those you do want to set the `cfg.continuous` option to `"yes"`. + +To check whether your data is epoched or pseudocontinuous, please have a look at the `SCLK01` channel. + +Note that besides **[ft_preprocessing](/reference/ft_preprocessing)**, other functions that read data from disk also have the `cfg.continuous` option, such as **[ft_databrowser](/reference/ft_databrowser)** and the automatic artifact detection functions. diff --git a/faq/why_should_I_set_cfg.continuous_equal_to_yes_when_preprocessing_ctf_trial_based_data.md b/faq/why_should_I_set_cfg.continuous_equal_to_yes_when_preprocessing_ctf_trial_based_data.md deleted file mode 100644 index 4b6a29545..000000000 --- a/faq/why_should_I_set_cfg.continuous_equal_to_yes_when_preprocessing_ctf_trial_based_data.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Why should I set cfg.continuous = 'yes' when preprocessing CTF trial-based data? -tags: [faq, ctf, preprocessing] ---- - -# Why should I set cfg.continuous = 'yes' when preprocessing CTF trial-based data? - -When storing a continuous CTF recording in disk, the CTF acquisition software automatically adds a trigger every 10 seconds alongside your custom triggers. To virtually stitch together these 10-second segments into one continuous recording , you must set cfg.continuous = 'yes' in **[ft_preprocessing](/reference/ft_preprocessing)**. That way you can perform trial-based MEG analysis using your custom triggers. This is also done in the [Preprocessing - Segmenting and reading trial-based EEG and MEG data](tutorial/preprocessing) tutorial. - From 1f778df6221d47e89a9f66f2d6f09dd34ed93a45 Mon Sep 17 00:00:00 2001 From: Konstantinos Tsilimparis Date: Thu, 19 Sep 2024 19:55:27 +0200 Subject: [PATCH 4/5] update faq.md and add link to the preprocessing tutorial --- faq.md | 1 + tutorial/preprocessing.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/faq.md b/faq.md index 2d9da461f..7f8c064b2 100644 --- a/faq.md +++ b/faq.md @@ -17,6 +17,7 @@ See also the [tutorials](/tutorial) and [example scripts](/example). - [How can I inspect the electrode impedances of my data?](/faq/how_can_i_inspect_the_electrode_impedances_of_my_data) - [Should I rereference my EEG data prior to, or after ICA?](/faq/should_I_rereference_prior_to_or_after_ica_for_artifact_removal) - [I used to work with trl-matrices that have more than 3 columns. Why is this not supported anymore?](/faq/i_used_to_work_with_trl-matrices_that_have_more_than_3_columns._why_is_this_not_supported_anymore) +- [Why should I set cfg.continuous = 'yes' when preprocessing CTF trial-based data?](/faq/continuous) ### Specific data formats diff --git a/tutorial/preprocessing.md b/tutorial/preprocessing.md index 2e4180a90..ad40b39f7 100644 --- a/tutorial/preprocessing.md +++ b/tutorial/preprocessing.md @@ -49,7 +49,7 @@ This results in a cfg.trl that contains the trial definitions of all conditions The output of **[ft_definetrial](/reference/ft_definetrial)** can be used for **[ft_preprocessing](/reference/ft_preprocessing)**. cfg.channel = {'MEG' 'EOG'}; - cfg.continuous = 'yes'; + cfg.continuous = 'yes'; % see https://www.fieldtriptoolbox.org/faq/continuous/ data_all = ft_preprocessing(cfg); Save the data to disk From 72c6ef68eaea1898094d2a75797d4c0679a1f358 Mon Sep 17 00:00:00 2001 From: Robert Oostenveld Date: Fri, 20 Sep 2024 11:52:13 +0200 Subject: [PATCH 5/5] include authors in the header --- faq/continuous.md | 1 + 1 file changed, 1 insertion(+) diff --git a/faq/continuous.md b/faq/continuous.md index 06a1fa91f..d761fa16a 100644 --- a/faq/continuous.md +++ b/faq/continuous.md @@ -1,6 +1,7 @@ --- title: Why should I set cfg.continuous = 'yes' when preprocessing CTF trial-based data? tags: [faq, ctf, preprocessing, continuous] +authors: [Konstantinos Tsilimparis, Robert Oostenveld] --- # Why should I set cfg.continuous = 'yes' when preprocessing CTF trial-based data?