qsiprep.interfaces.qc module

qsiprep.interfaces.qc.createB0_ColorFA_Mask_Sprites(b0_file, colorFA_file, mask_file)[source]
qsiprep.interfaces.qc.createSprite4D(dwi_file)[source]
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.create_sprite_from_tiles(tile, out_file=None, as_bytes=False)[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 img key (base64-encoded PNG data, or the path to out_file if one is given) instead of returning the array under the mosaic key.

  • out_file (str or None, optional) – Path to which the rendered mosaic is saved when as_bytes is True.

Returns:

Mosaic of tile images (mosaic or img), along with the number of tile rows (N) and columns (M), the tile size (pix), and the number of tiles (num_slices).

Return type:

dict

qsiprep.interfaces.qc.get_middle_slice_tiles(data, slice_direction)[source]

Create a strip of intensity-normalized, square middle slices.

qsiprep.interfaces.qc.load_and_reorient(filename)[source]
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)
qsiprep.interfaces.qc.mplfig(data, outfile=None, as_bytes=False)[source]
qsiprep.interfaces.qc.mplfigcontour(data, outfile=None, as_bytes=False)[source]
qsiprep.interfaces.qc.nearest_square(limit)[source]
qsiprep.interfaces.qc.reorient_array(data, aff)[source]
qsiprep.interfaces.qc.square_and_normalize_slice(slice2d)[source]