#!/usr/bin/env python3
"""Build the fixed 2 mm MNI152 (2009c, nilearn-packaged) grey-matter mask once; the bundle vendors the result.
nilearn==0.11.1 load_mni152_gm_mask(resolution=2, threshold=0.2, n_iter=2). No network needed."""
import sys, hashlib
from nilearn.datasets import load_mni152_gm_mask
out = sys.argv[1]
m = load_mni152_gm_mask(resolution=2, threshold=0.2, n_iter=2)
m.to_filename(out)
print(out, "voxels", int(m.get_fdata().sum()), "shape", m.shape, "sha256", hashlib.sha256(open(out, "rb").read()).hexdigest())
