qsiprep.interfaces.qc module
- qsiprep.interfaces.qc.create_report_json(dwi_corrected_file, eddy_rms, eddy_report, color_fa_file, anat_mask_file, outlier_indices, eddy_qc_file, outpath=None)[source]
- qsiprep.interfaces.qc.embed_tiles_in_json_sprite(tile_list, as_bytes=True, out_file=None)[source]
Make a big rectangle containing the images for a brainsprite.
- Parameters:
tile_list (list) – List of 2d square numpy arrays to stick in a mosaic
as_bytes (bool, optional) – If True, render the mosaic to a figure and return it under the
imgkey (base64-encoded PNG data, or the path toout_fileif one is given) instead of returning the array under themosaickey.out_file (str or None, optional) – Path to which the rendered mosaic is saved when
as_bytesis True.
- Returns:
Mosaic of tile images (
mosaicorimg), along with the number of tile rows (N) and columns (M), the tile size (pix), and the number of tiles (num_slices).- Return type:
- qsiprep.interfaces.qc.get_middle_slice_tiles(data, slice_direction)[source]
Create a strip of intensity-normalized, square middle slices.
- qsiprep.interfaces.qc.make_a_square(data_mat, include_last_dim=True)[source]
Apply zero padding to make a 2d matrix a square.
Examples
>>> too_long = np.arange(4 * 7).reshape((4, 7)) >>> long_squared = make_a_square(too_long) >>> long_squared.shape (7, 7) >>> long_squared.sum(1) array([ 0, 21, 70, 119, 168, 0, 0]) >>> too_tall = np.arange(6 * 5 * 3).reshape((6, 5, 3)) >>> tall_squared = make_a_square(too_tall) >>> tall_squared.shape (6, 6, 6) >>> tall_2squared = make_a_square(too_tall, include_last_dim=False) >>> tall_2squared.shape (6, 6, 3)