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

Integration of the SNIRF reader in Brainstorm #124

Closed
ftadel opened this issue May 4, 2020 · 9 comments
Closed

Integration of the SNIRF reader in Brainstorm #124

ftadel opened this issue May 4, 2020 · 9 comments

Comments

@ftadel
Copy link
Contributor

ftadel commented May 4, 2020

@Edouard2laire @thomas-vincent

Some functions from nirstorm are needed to use the new SNIRF reader in Brainstorm:
https://github.com/brainstorm-tools/brainstorm3/tree/master/external/nirstorm

One needs a modification (additional returned parameter):
https://github.com/brainstorm-tools/brainstorm3/blob/master/external/nirstorm/nst_format_channel.m

I'm not sure how you want to deal with this in nirstorm: removing them from the nirstorm repo/package?

@Edouard2laire
Copy link
Collaborator

Edouard2laire commented May 4, 2020

Hi Francois,

Thanks for that. yes I think we will delete them after PR #123 is merged.

Can you confirm me that calling nst_format_channel with only one output (eg channel_label= nst_format_channel(isrc, idet, measure) ) will still work or we need to make change in the code to "discard" the second output ?

edit: I just made the test to be sure, and indeed it's working so we won't have side effect in nirstorm.

@ftadel
Copy link
Contributor Author

ftadel commented May 5, 2020

Can you confirm me that calling nst_format_channel with only one output (eg channel_label= nst_format_channel(isrc, idet, measure) ) will still work or we need to make change in the code to "discard" the second output ?

The modified function from Brainstorm would work with Nirstorm (it never hurts to add returned parameters).
But having Nirstorm+Brainstorm both in the path may cause the SNIRF reader in Brainstorm to stop working (as it doesn't have the missing returned parameter)

@thomas-vincent
Copy link
Contributor

It is better to isolate everything needed to load snirf in brainstorm and not depend on nirstorm.
There may be some issues if they stay there since the same functions in nirstom will shade them.

If you really need to share the functions, then the functions in question should be moved in brainstorm.
But as I can see, it is very basic short functions, I think you can fork their content.
Everything in brainstorm/external should be removed and integrated where needed in brainstorm io.

@Edouard2laire
Copy link
Collaborator

Edouard2laire commented May 5, 2020

I don't have a clear opinion on that subject but I see 3 options here :

  • First, as suggested by Thomas, we remove the function from the brainstorm external folder and put them and the files where they are called so (out_data_snirf.m and in_data_snirf.m). This solution leads to have 3 copy of the functions.

  • Second, as suggested by Francois, we remove the function from NIRSTORM repository and keep them in brainstorm. That lead to only one copy of the function but make that the NISTORM code is spread between two repository which can cause trouble is guess (like if someone update nirstorm but use an old version of brainstorm)

  • Third, a compromise solution, we leave the two versions as is but keep them synchronized. So here we change nst_format_channel accordingly to the change I made in brainstorm. That leads to have 2 copy of the functions but I guess that a trouble we can accept to still have the code present both in NIRSTORM and Brainstorm repository without any shadowing :)

Which solution do you think is the best @thomas-vincent and @ftadel ?
hs. There is also another alternative which is to only keep those 4 functions in nistorm and to force the installation of nirstorm when importing/exporting snirf data but I am pretty sure it's the worst solution haha

@thomas-vincent
Copy link
Contributor

thomas-vincent commented May 5, 2020 via email

@ftadel
Copy link
Contributor Author

ftadel commented May 5, 2020

Then should I move the 4 nst_* functions from brainstorm3/external/nirstorm to brainstorm3/toolbox/io/private and consider we'll keep working with two separate copies?
(this way, it shouldn't even interfere with other versions of the same functions in a different folder in the path)

Make sure you add the extra returned parameter to the nirstorm version, just in case..

@Edouard2laire
Copy link
Collaborator

One needs a modification (additional returned parameter):
https://github.com/brainstorm-tools/brainstorm3/blob/master/external/nirstorm/nst_format_channel.m

Done in #127 .

Then should I move the 4 nst_* functions from brainstorm3/external/nirstorm to brainstorm3/toolbox/io/private and consider we'll keep working with two separate copies?
(this way, it shouldn't even interfere with other versions of the same functions in a different folder in the path)

I don't know. will the snirf importation still work this way ?

@ftadel
Copy link
Contributor Author

ftadel commented May 14, 2020

Then should I move the 4 nst_* functions from brainstorm3/external/nirstorm to brainstorm3/toolbox/io/private and consider we'll keep working with two separate copies?
(this way, it shouldn't even interfere with other versions of the same functions in a different folder in the path)

I don't know. will the snirf importation still work this way ?

I don't know, this is up to you (@thomas-vincent @Edouard2laire) to decide. In the meantime, I moved these functions toolbox/io/private so that the SNIRF reader in Brainstorm does not interfere with Nirstorm (and vice versa). Just keep in mind that it would be better if these functions are updated in Brainstorm if you modify them in Nirstorm.
brainstorm-tools/brainstorm3@1b89539

@Edouard2laire
Copy link
Collaborator

Thx. I am closing this issue then :)

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

No branches or pull requests

3 participants