Difficulty getting white background in nilearn with templateflow t1w file

Hello,

I’m trying to overlay my stat images on a templateflow T1 template and I can’t seem to get the background to turn white from black…

from templateflow import api as tflow
import pathlib
from nilearn import datasets
# tflow.get('MNI152NLin2009cAsym', desc=None, resolution=1,suffix='T1w', extension='nii.gz')
tflow.get('MNI152NLin2009cAsym', desc="brain", resolution=1,suffix='T1w', extension='nii.gz')

# 'C:/Users/xxx/.cache/templateflow/tpl-MNI152NLin2009cAsym/tpl-MNI152NLin2009cAsym_res-01_desc-brain_T1w.nii.gz'

bg_path = r'C:\Users\xxx\.cache\templateflow\tpl-MNI152NLin2009cAsym\tpl-MNI152NLin2009cAsym_res-01_T1w.nii.gz'
# plotting.plot_stat_map(zmap, draw_cross=False,bg_img='/home/saptaf1/.cache/templateflow/tpl-MNI152NLin2009cAsym/tpl-MNI152NLin2009cAsym_res-01_desc-brain_T1w.nii.gz',display_mode="xz")

bacground_nii = nib.load(bg_path)

plotting.plot_stat_map(zmap, draw_cross=False,bg_img=bg_path,display_mode="xz", black_bg=False, annotate=False, threshold=1)

Figure_4

The black_bg works fine when using the the default background, but when using the templateflow file its produces a semitransparent overlay…

I think the problem is that I load the image in nibabel, if I use the path, than it work!