Concatenating two dataset

Hello,

I have pre-processed 2 different resting states for one subject in Brainstorm. I would like to concatenate the two files into a bigger one but I can’t find a way of doing it in Brainstorm.

On Matlab this operation is pretty straightforward ( resting_concatenated = [resting1 resting2] ) but I am afraid it will be tricky importing the concatenated data back in Brainstorm.

Is there an easy way of doing this operation in Brainstorm? If not, do you have any suggestion about how I could import the data?

Thank you,
Best
Jacopo

Hello,

You can import entirely your two resting files in the Brainstorm database, then select them both in Process1 and run process “Standardize > Concatenate time”.
If you want to convert the concatenated file back to a “continuous file”, right-click on the file > Review as raw.

Cheers,
Francois

Hi Francois,

thank you for your reply.

At the moment I have the pre-processed file (DataType: ‘raw’) in Brainstorm.

I tried to follow your advice by importing the files in the database (right-click -> import in database).
Then, on these new files (DataType:‘recordings’), I tried to run “Standardize > Concatenate time” but Brainstorm doesn’t allow me to do that. It basically says:“Data types mismatch”

Am I doing something wrong?
Thank you

Best,
Jacopo

If you select the two imported files in Process1, then select the process “Standardize > Concatenate time”, you get this error? Can you reproduce this multiple times?
Can you post a screen capture showing the files in the database explorer and the selection in Process1?

You should be able to obtain the same results with the more sophisticated process “Extract > Extract values”, with the options “All file” and “Concatenate time”.

Hi Francois,

in the first image you can see my pre-processed raw data. What I do is basically right click -> import in database, and then I drag the output in Process1. It's seems like I cannot run any process at all (in the square brackets the number it's 0). Same story even with “Extract > Extract values”.

I guess those imported data are not appropriate but even if I try with the raw data I can't run the two process.

Thank you,
Jacopo

Your files contain bad segments, therefore the imported files are marked as “bad trials” and are ignored by the Process1 tab. See the number of selected files in Process1. So it considers you have no input, and this concatenation process cannot be called without input, hence the error.
https://neuroimage.usc.edu/brainstorm/Tutorials/Epoching#Import_in_database

Select the imported files, right click > Mark as good.

Thank you so much Francois now it works!

Hi Francois,
I am following your instruction to concatenate two raw files imported in database. When I run, it gave me this error message:

 line 279: Dot indexing is not supported for variables of this type.
------------------------------------
Call stack:
>bst_process.m>Run at 279
>bst_process.m at 37
>panel_process1.m>RunProcess at 124
>panel_process1.m at 26
.........

When I run code generated by scripting, this is the error code:

Dot indexing is not supported for variables of this type.

Error in bst_process>Run (line 279)
        allStudies = bst_get('Study', unique([sInputs.iStudy]));

Error in bst_process>CallProcess (line 2290)
        OutputFiles = Run(sProcess, sInputs, sInputs2, 0);

Error in bst_process (line 37)
eval(macro_method);

Error in script_concatenateTime (line 12)
sFiles = bst_process('CallProcess', 'process_concat', sFiles, []);

Please help.
Yuyuan

Since this problem was initially discussed, the possibility to concatenate two continuous file was added to Brainstorm. You do not have to import the files first, you can directly select the two Link to raw file in the Process1 list, and run the process Standardize > Concatenate time.

I could not reproduce your error.
In order to help you with this issue, I need an example file in order to replicate the error on my compute.
Could you share a short example file that could can import into Brainstorm, but that you can't concatenate with itself (select the file twice in Process1 after linking it to the database).

If you need two files to reproduce the error, please share the two files. Make sure first that they have exactly the same channel names (the channel files created for both must look exactly similar)

  • Upload the zipped file(s) some where
  • Post the download link here
  • Describe exactly how to reproduce your error with the Brainstorm interface, starting from the files you sent.
  • Post a screen capture showing the two files in your Brainstorm database explorer

I figured out the issue was caused by BS update. I reversed to previous version then it works. I am hesitating to accept update request every time i start the program.

Open-source software evolves with the constant feedback of users. New improvements often come with new bugs, bug reports and then bug fixes. This mechanism works only if most users keep on updating regularly the software.
With Brainstorm, we're trying to provide fast solutions to new problems that users report. If you follow our debugging guidelines, you would get a fix for the bugs you reported within a few days, and the entire community of users would benefit from it.

If you'd like to contribute to the constant improvement of tools: please help us with the debugging.
If you don't, rather than using outdated versions of Brainstorm, you might be interested in using other tools, probably commercial solutions that would include less options and no updates, but less bugs.

This is free open-source software, you are free to use it the way you want, but note that we can't provide any help through the forum for versions of Brainstorm that are not up-to-date. Unfortunately we don't have the necessary resource to maintain multiple versions simultaneously. There are no "stable" releases of Brainstorm.

1 Like