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

Allow separate cardiac and resp files in BIDS format #167

Merged
merged 4 commits into from
Mar 29, 2022
Merged

Conversation

alexsayal
Copy link
Contributor

Solving #164 :
Made the import of the .tsv files possible with different sampling rates for cardiac and resp signals. I used linear interpolation to replace the NaNs and upscaled the respiratory signal, replicating what happens when using the .log files.

The output confound matrix is very similar to what the toolbox returns with the .log files.

mms-neuro and others added 3 commits June 22, 2021 17:07
Solving #164 :
Made the import of the .tsv files possible with different sampling rates for cardiac and resp signals. I used linear interpolation to replace the NaNs and upscaled the respiratory signal, replicating what happens when using the .log files.

The output confound matrix is very similar to what the toolbox returns with the .log files.
@mrikasper mrikasper self-assigned this Jan 26, 2022
@mrikasper mrikasper added the physio Issues related to PhysIO Toolbox label Jan 26, 2022
@mrikasper
Copy link
Member

Dear Alex,

Thank you so much for providing this improvement.

I will try to include it into the next PhysIO release (probably in March). In order to do so, I would like to create an integration test that checks the results of this BIDS reader. This would need your two separate BIDS input files and an output physio.mat.

Would you be able to share this data with me?

Furthermore, could you please also add a version of the Contributor License Agreement file to this pull request that has a table row with your name and info inserted. I have explained the rationale for that here and here.

Thank you very much again and all the best,
Lars

@alexsayal
Copy link
Contributor Author

Hello Lars,

Sorry for the delay, here are the files you requested.

All the best,

physioBIDSfiles.zip

@mrikasper
Copy link
Member

Great, thank you, Alexandre!

I will get back to you when I have setup the test.

All the best,
Lars

@mrikasper mrikasper changed the base branch from master to development March 29, 2022 21:52
@mrikasper
Copy link
Member

Merging into development for unit testing

@mrikasper mrikasper merged commit d963d6b into translationalneuromodeling:development Mar 29, 2022
@mrikasper
Copy link
Member

mrikasper commented Apr 4, 2022

Dear Alexandre @alexsayal,

I have now created an intergration test using your logfiles and saved results, but there are some small discrepancies between those outputs and the runs on my machine that I am trying to track down.

Do you happen to know with which version of PhysIO you ran the tests? I deducted it has to be before R2020a-v7.3.2, because there is no physio.version variable in your output.

You can check this by running tapas_physio_version() in the Matlab command window.

Thank you and all the best,
Lars

@alexsayal
Copy link
Contributor Author

Hello @mrikasper ,

Something very strange happened, the physio.mat I sent was in fact generated using version R2019-v7.2.0... although I forked the latest R2021a-v8.0.1 🤯

Anyway, I re-send the output, now sure I am using the latest version. Sorry for this.

newversion.zip

@mrikasper
Copy link
Member

Dear @alexsayal,

Thank you for getting back to me so swiftly! And no worries, that's exactly why I am writing the tests :-) What could have happened is that the PhysIO version used with SPM was still in the path (the one you have to put in spm12/toolbox) and shadowed your development version.

One more thing: I have to check the files you sent, but one thing I noticed when I was rerunning on my machine was that the cut-out of unused data was at the end of the whole time series before (see screenshot with v7.2), but is now at the beginning (see screenshot with v8.1). Since you specified the StartTime in the .json file as -6.574, i.e., logging starts 6.5 s before the scan, I believe the new version does the correct thing (also consistent with align_scan = 'first', though that should have no meaning here) - is that true?

Thank you for your help and continued input,
Lars

image

image

@alexsayal
Copy link
Contributor Author

alexsayal commented Apr 5, 2022

Hello @mrikasper ,

Yes, cutting-out tics at the beginning of the acquisition is the correct approach. I have verified this on the original .log files as well, since the _Info file tells us the tic that corresponds to the first volume/slice and there are several tics on the _RESP and _PULS files before that tic - exactly 6.57 seconds of data.

@mrikasper
Copy link
Member

Dear Alexandre,

Great, thank you so much for checking and sending the updated results - I am happy to report the new integration tests run through here on my machine with identical results, so we can include your improvements into the next release.

One more question: I think the direct comparison with the Siemens log is a useful additional cross-over test, so that we can check consistency between the two read-ins. Would you be willing to share the _Info, _RESP and _PULS files with me as well, so that I can set up this test?

Thank you once again and all the best,
Lars

@alexsayal
Copy link
Contributor Author

@mrikasper
Copy link
Member

Thank you, @alexsayal,

that's great! I will incorporate it into the testing framework, but maybe it only makes it into the release after next.

All the best,
Lars

likeajumprope pushed a commit to likeajumprope/tapas that referenced this pull request Jan 17, 2024
Allow separate cardiac and resp files in BIDS format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
physio Issues related to PhysIO Toolbox
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants