# Exploring carpet plots (Power, 2017) - any thoughts?

Hi everyone,

Many of you might be familiar with carpet plots (Power, 2017) as they are also created if you run `fmriprep`. They are a great way to get an overview of functional MRI images and give also the opportunity to asses the quality of an image.

I was always curious if we perhaps can adapt the carpet plots as proposed by Power and adjust them just a bit to get even more information from a 4D image. I explored some different approaches and would be very curious about your thoughts, ideas, and feedbacks.

I created a detailed notebook that explains the steps I undertook (see here), but let me quickly summarize my different carpet plot approaches.

### Original Carpet plot

The following is a â€śstandardâ€ť carpet plot. Y-axis depicts all the voxels in the fMRI image, and the x-axis shows the timecourse per voxel over all volumes. Voxels above the red line are from gray matter (GM), voxels between the red and blue line are from white matter (WM) and voxels below the blue line are from CSF.

The functional image that we see here was already preprocessed (slice time correction, motion corrected, temporal filter (high-pass of 100s) and spatially smoothed.

We can see that there is some kind of structure in this carpet plot. This becomes even clearer when we compute the average timecourse over all voxels and compute the 5th power thereof.

Interestingly enough, those spikes are not very strongly related to the FD signal or the motion parameters.

### Offset carpet plot

My first idea was to profit from the RGB channels in color images to plot three different information in the carpet plot. Therefore I decided to use R for the original time course, G for a shift of +1 and B for a shift of -1.

This approach gives us some more information, but itâ€™s actually rather difficult to detect the color information that is hidden in the carpet plot.

### Derivative carpet plot

My next approach uses again the RGB channel approach, but this time weâ€™re plotting the original signal (R), the first (G) and the second (B) derivative of the signal.

This is already much easier to understand!

### Power spectrum carpet plot

Next, I was curious if we perhaps can get some information from the frequencies hidden in the time course. Iâ€™ve computed the power spectral density per voxel. The thinking was that the three different regions (GM, WM, and CSF) should show a different power spectrum.

It is difficult to see, but the GM region seems to have a bit higher density of high frequencies when compared to CSF.

### PCA carpet plot

Again another approach uses PCA to find additional information in the data. The PCA was fitted on the GM data and the components were then multiplied with the time course of all voxels. The first product of the first three (because of RGB plotting) components is shown in the following carpet plot. The thinking was, that the components top three components in the GM should hopefully be somewhat different from the signal in WM and CSF regions.

### ICA carpet plot

The same approach as before, but this time using an ICA.

6 Likes

Ahoi hoi @miykael,

once again you just dropped an amazing idea!

My (non expert) two cents:

• Maybe it would be useful to define what additional information one might want to have? Stress overall difference between tissues or differences over time, etc. . Based on that, a set of adjusted carpet plots based on the needs of users could be possible!?
• Have you tried/thought about using a log spaced power spectrum?
• The derivative, pca and ica plots are super cool. Such information & colours, much 80â€™s .
• As you mentioned, you used a rather â€ścleanâ€ť image. Reproducing the analyses and plots using a rough one would maybe add some things/views to this discussion!? I have some â€śniceâ€ť images that could serve as an example. Happy to use those within your notebook, if you and others are interested.

Super cool stuff!

Best, Peer

Wow @miykael, I wish I had seen this before the nipype workshop. Would you like to help us here? -> https://github.com/nilearn/nilearn/pull/1587