Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] better identify raw file when exporting file #719

Closed

Conversation

Edouard2laire
Copy link
Contributor

Hello,

This fix a bug where some raw file would not be identified as raw file during export.

@Edouard2laire Edouard2laire marked this pull request as ready for review July 8, 2024 17:28
@rcassani
Copy link
Member

rcassani commented Jul 8, 2024

Hi @Edouard2laire, how did you get to have a file with such a name?
Raw files should have _0raw in their names

@Edouard2laire
Copy link
Contributor Author

Edouard2laire commented Jul 8, 2024

it was created by #717

i copied what we did for the synchronisation to get filename (https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/process/functions/process_sync_recordings.m#L255 ) :


OutputFile = bst_process('GetNewFilename', bst_fileparts(sNewStudy.FileName), 'data_raw_combned');

It is recognize everywhere else in brainstorm as raw file despite not having _0raw

@rcassani
Copy link
Member

rcassani commented Jul 8, 2024

i copied what we did for the synchronisation to get filename (https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/process/functions/process_sync_recordings.m#L255 ) :

Yeah, that's not right. It should have been _0raw

It is recognize everywhere else in brainstorm as raw file despite not having _0raw

It does work for most of the cases as different checks for 'raw' type just find the raw string, or check if the loaded F is a struct. However, it may have unexpected behaviours, e.g., setting a bad channel for a _raw file will not change the ChannelFlag inside F:

isRaw = (length(DataFile) > 9) && ~isempty(strfind(DataFile, 'data_0raw'));
, and in other places that do check for _0raw

I'll push the correction on process_sync_recordings.m directly on the master

@rcassani rcassani closed this Jul 8, 2024
rcassani added a commit that referenced this pull request Jul 8, 2024
Issue introduced in #660 and mentioned in #719
@Edouard2laire
Copy link
Contributor Author

Is there a way I can fix the file already created without having to recompute ?

@rcassani
Copy link
Member

rcassani commented Jul 8, 2024

Apologies for the inconveniences.
With Brainstorm close, you could renaming the file to add the zero and reloading the Protocol

@Edouard2laire Edouard2laire deleted the export_raw branch July 21, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants