ComScan.nifti module¶
Author: Alexandre CARRE
Created on: Jan 14, 2021
-
ComScan.nifti.flatten_nifti_files(input_path, mask, output_flattened_array_path='flattened_array', dtype=<class 'numpy.float16'>, save=True, compress_save=True)[source]¶ Flattened list of nifti files to a flattened array [n_images, n_masked_voxels] and save to .npy or .npz if compressed
- Parameters
input_path (
List[str]) – List of nifti files pathmask (
Union[str,ndarray]) – path of mask or arrayoutput_flattened_array_path (
str) – path of the output flattened array. No extension is needed. Will be save as .npy if no compression, else .npzsave (
bool) – save the flattened arraydtype ([<class 'numpy.dtype'>, typing.Callable]) – dtype of the output flattened array. Default is float 16 to save memory
compress_save (
bool) – If true compress the numpy array into .npz
- Returns
flattened array [n_images, n_masked_voxels]