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

[snirf] Improve support to SNIRF #756

Open
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

Edouard2laire
Copy link
Contributor

@Edouard2laire Edouard2laire commented Dec 7, 2024

This PR adds support for the new measurement list (added in v1.1) and overall provides better support to the SNIRF specifications

The snirf specification can be found here: https://github.com/fNIRS/snirf/blob/master/snirf_specification.md

Todo:

Reading SNIRF :

Writting snirf :

  • write snirf data with dOD / dHb data ( 0 % done)

Once all the todo are done; we should be fairly complient with the snirf standard.

@Edouard2laire Edouard2laire marked this pull request as draft December 7, 2024 19:56
@Edouard2laire
Copy link
Contributor Author

Edouard2laire commented Dec 9, 2024

@rcassani what would be the best way to handle the optional flag "coordinateSystem" ?
https://github.com/fNIRS/snirf/blob/master/snirf_specification.md#nirsiprobecoordinatesystem

Notably, if it is "MNI152NLin2009bAsym" then we need to convert the coordinates from MNI to SCS ? I guess we should already have some function comming from the BIDS import to dead with that.

@Edouard2laire Edouard2laire changed the title [snirf] support MeasurmentLists [snirf] Improve support to SNIRF Dec 9, 2024
@rcassani
Copy link
Member

rcassani commented Dec 9, 2024

@Edouard2laire, this is where the magic from MNI space to Subject space happens:

%% ===== MNI TRANSFORMATION =====
if ismember(FileFormat, {'ASCII_XYZ_MNI', 'ASCII_NXYZ_MNI', 'ASCII_XYZN_MNI', 'INTRANAT_MNI', 'BIDS-MNI-MM', 'BIDS-MNI-CM', 'BIDS-MNI-M'})

@Edouard2laire
Copy link
Contributor Author

@Edouard2laire, this is where the magic from MNI space to Subject space happens:

%% ===== MNI TRANSFORMATION =====
if ismember(FileFormat, {'ASCII_XYZ_MNI', 'ASCII_NXYZ_MNI', 'ASCII_XYZN_MNI', 'INTRANAT_MNI', 'BIDS-MNI-MM', 'BIDS-MNI-CM', 'BIDS-MNI-M'})

yes; but this function is not called when doing import_data_snirf; right ? since the channel is defined during the import of the data ?

@Edouard2laire
Copy link
Contributor Author

Edouard2laire commented Dec 11, 2024

ok. i think the code is much cleaner now.

@rcassani, do you think you could help me fill the gap here:

% Read coordinate system
if isfield(jnirs.nirs.probe, 'coordinateSystem') && ~isempty(jnirs.nirs.probe.coordinateSystem)
    warning('Todo: apply coordinate system');
end

https://github.com/brainstorm-tools/brainstorm3/pull/756/files#diff-92d5b968a90e2607f65b091acae076d6c977f09b46025c07b190cdd00e26ad28R97-R99

@Edouard2laire Edouard2laire marked this pull request as ready for review December 11, 2024 02:13
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