nipreps / mriqc

Automated Quality Control and visual reports for Quality Assessment of structural (T1w, T2w) and functional MRI of the brain
http://mriqc.readthedocs.io
Apache License 2.0
295 stars 131 forks source link

Plot cardiac and respiratory signals if available #386

Open chrisgorgo opened 7 years ago

chrisgorgo commented 7 years ago

Above the carpet plot.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

oesteban commented 2 years ago

I would add events files to this

/cc @celprov

Credits of the idea to @tsalo, who mentioned this eons ago.

oesteban commented 7 months ago

@smoia - look at the date this issue was posted.

m-miedema commented 5 months ago

I'm taking a look at this! I do wonder how much pre-processing might be appropriate for the physiological signals in this context.

smoia commented 5 months ago

To compare the signals to a carpet plot, you do need to process them a little. In the case of ventilation, a rough respiratory variance (here) could be a proper alternative to preprocessing. For pulse/heart rate, you do need peak detection unfortunately.

m-miedema commented 5 months ago

Yes! We've talked about the difference between adding useful physio info to MRIQC workflow, which will require the preprocessing you mentioned, and emulating the functionality of MRIQC in a separate PHYSIOQC report.

celprov commented 5 months ago

@m-miedema in the last physiopy codesprint I participated in, I started trying to plot the events and the physio atop the carpetplotin MRIQC visual report but did not go very far. I worked in this branch https://github.com/celprov/mriqc/tree/enh/plot-events and this branch https://github.com/celprov/mriqc/tree/enh/plot-physio. However, I had not considered pre-processing of the physiological signals, my idea was first to really just integrate events and physio into the workflow and naively plot them. I stopped at the step of loading the physio file into the workflow.

smoia commented 5 months ago

Perhaps useful here, if I remember correctly one of the issue for putting this signal was to find them first. @drombas worked a while back on a way to do so, perhaps he can help?

celprov commented 5 months ago

@oesteban had proposed finding the physio file by extracting the bids entities from the fMRI name and reconstructing the physio bids name by replacing the suffix. That is one of my commit in the enh/plot-physio branch https://github.com/nipreps/mriqc/commit/47786babe89a220c7b56579a14a347c67fd10935. But very open to suggestion on how to implement this better.

oesteban commented 5 months ago

Let's first address nipreps/nireports#120, which is not concerned with finding the data. Once we are able to generate reportlets with physio signals, we can come back to MRIQC and see how these are located (which, trust me, should not be a big deal with pybids).

smoia commented 5 months ago

Oh, sorry, let me explain better: I doubt the problem is finding the file they're in, but then finding which channel is which physio signal seemed problematic (if I remember correctly). That's why @drombas was looking at a way to distinguish them.

oesteban commented 5 months ago

Okay, yes, that may require some extra configuration of MRIQC.

smoia commented 5 months ago

At a certain point we were working on it for phys2bids, so if you don't want to have it in MRIQC, I'd be happy to see it implemented in phys2bids (and it's useful for us, since it's a way to check and automatically label the content of the channels)

m-miedema commented 5 months ago

I think it makes most sense to implement within phys2bids, since the inputs of MRIQC need to be in BIDS format anyways. Ideally what I'm looking to add on to MRIQC is a very preliminary version of a physioprep workflow that generates something similar to the confounds output in fmriprep that can then be quickly read in and plotted by nireports.