qsirecon.interfaces.qc module
- qsirecon.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_listlist
List of 2d square numpy arrays to stick in a mosaic
Returns:
- mosaicnp.ndarray
Mosaic of tile images
- qsirecon.interfaces.qc.get_middle_slice_tiles(data, slice_direction)[source]
Create a strip of intensity-normalized, square middle slices.
- qsirecon.interfaces.qc.make_a_square(data_mat, include_last_dim=True)[source]
Applies 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)