PUMI.plot package
PUMI.plot.carpet_plot module
- PUMI.plot.carpet_plot.plot_carpet(img, mask=None, output_file=None, save_carpet=False, cmap='gray', detrend=True, standardize='zscore', clean_data=True, show_carpet=False)[source]
X-axis: timeframes (bottom to top along z axis).
Y-axis: voxels.
Color: voxel intensity.
- Parameters:
img (Niimg-like object) – 4D functional image.
mask (3d binary image (brain mask) or a float between 0 and 1) – Fractional intensity threshold, i.e. ignoring all voxels being smaller than the min+mask*(max-min). Default = 0.1
cmap (str) – The color map that will be used to color the carpet. Default = ‘gray’
detrend (bool) – Weather data will be detrended or not. Default = True
standardize – {‘zscore’, ‘psc’, False}. Strategy to standardize the signal. Default = ‘zscore’
clean_data (bool) – Remove voxels that stay 0 through time. Default = True.
show_carpet (bool) – Show the generated carpet plot after generating it.
output_file (str) – Absolute Path in which the carpet plot should be saved If the value is None, carpet will be stored in the cwd.
save_carpet (bool) – Save generated carpet in the path output_file. In case output_file is None: carpet will be stored in the current working directory. Note: if output_file was provide save_carpet will be set to True automatically.
- Returns:
The plot itself.
- Return type:
Matplotlib Axes
Adapted from: https://github.com/poldracklab/niworkflows Plot an image representation of voxel intensities across time also known as the “carpet plot” or “Power plot”. See Jonathan Power Neuroimage 2017 Jul 1; 154:150-158.