def save_3D_nparray_nifti(np_matrix_3d, output_image, fname_atlas):
    """
    Save 3d numpy matrix to niftii image
    :param np_matrix_3d: 3d numpy array
    :param output_image:  name of the created nifti file. e.g.; 3d_matrix.nii.gz
    :param fname_atlas: name of the file to copy nifti header from
    :return: nonw
    """
    img = nib.Nifti1Image(np_matrix_3d, np.eye(4))
    affine = img.get_affine()
    np_matrix_3d_nii = nib.Nifti1Image(np_matrix_3d,affine)
    nib.save(np_matrix_3d_nii, output_image)
    # copy geometric information
    sct.run('fslcpgeom '-fname_atlas+' '+output_image, verbose=0)
    return None


#=======================================================================================================================
# Get tracts 
#=======================================================================================================================
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/dev/atlas/validate_atlas/generate_phantom.py/save_3D_nparray_nifti/operator `+` -> `-`