# Path: cogspaces/datasets/derivative.py
# def fetch_mask(data_dir=None, url=None, resume=True, verbose=1):
#     if url is None:
#         url = 'http://cogspaces.github.io/assets/data/hcp_mask.nii.gz'
#     files = [('hcp_mask.nii.gz', url, {})]
# 
#     dataset_name = 'mask'
#     data_dir = get_data_dir(data_dir)
#     dataset_dir = _get_dataset_dir(dataset_name, data_dir=data_dir,
#                                    verbose=verbose)
#     files = _fetch_files(dataset_dir, files, resume=resume,
#                          verbose=verbose)
#     return files[0]


import os
import numpy as np
from itertools import repeat
from os.path import join
from cogspaces.datasets import fetch_mask
from joblib import Parallel, delayed
from matplotlib.colors import LinearSegmentedColormap, rgb_to_hsv, hsv_to_rgb
from nilearn._utils import check_niimg
from nilearn.datasets import fetch_surf_fsaverage5
from nilearn.image import iter_img
from nilearn.input_data import NiftiMasker
    from nilearn.plotting import plot_stat_map, find_xyz_cut_coords, plot_glass_brain
        cmap_white = make_cmap(color, rotation=.5, white=True)
    else:
        cmap = 'cold_hot'
        cmap_white = 'cold_white_hot'

    srcs = []
    vmax = np.abs(img.get_data()).max()
    threshold = vmax / 8

    for view_type in view_types:
        src = join(output_dir, '%s_%s.png' % (name, view_type))
        cut_coords = find_xyz_cut_coords(img, activation_threshold=vmax / 3)
        if view_type == 'stat_map':
            plot_stat_map(img, threshold=threshold,
                          cut_coords=cut_coords,
                          vmax=vmax,
                          colorbar=True,
                          output_file=src,
                          # cmap=cmap
                          )
        elif view_type == 'glass_brain':
            plot_glass_brain(img, threshold=threshold,
                             vmax=vmax,
                             plot_abs=False,
                             output_file=src,
                             colorbar=True,
                             # cmap=cmap_white
                             )
        else:
            raise ValueError('Wrong view type in `view_types`: got %s' %

# Path: cogspaces/datasets/derivative.py
# def fetch_mask(data_dir=None, url=None, resume=True, verbose=1):
#     if url is None:
#         url = 'http://cogspaces.github.io/assets/data/hcp_mask.nii.gz'
#     files = [('hcp_mask.nii.gz', url, {})]
# 
#     dataset_name = 'mask'
#     data_dir = get_data_dir(data_dir)
#     dataset_dir = _get_dataset_dir(dataset_name, data_dir=data_dir,
#                                    verbose=verbose)
#     files = _fetch_files(dataset_dir, files, resume=resume,
#                          verbose=verbose)
#     return files[0]


# Path: cogspaces/plotting/volume.py
import os
import numpy as np
from itertools import repeat
from os.path import join
from cogspaces.datasets import fetch_mask
from joblib import Parallel, delayed
from matplotlib.colors import LinearSegmentedColormap, rgb_to_hsv, hsv_to_rgb
from nilearn._utils import check_niimg
from nilearn.datasets import fetch_surf_fsaverage5
from nilearn.image import iter_img
from nilearn.input_data import NiftiMasker
    from nilearn.plotting import plot_stat_map, find_xyz_cut_coords, plot_glass_brain

        cmap_white = make_cmap(color, rotation=.5, white=True)
    else:
        cmap = 'cold_hot'
        cmap_white = 'cold_white_hot'

    srcs = []
    vmax = np.abs(img.get_data()).max()
    threshold = vmax / 8

    for view_type in view_types:
        src = join(output_dir, '%s_%s.png' % (name, view_type))
        cut_coords = find_xyz_cut_coords(img, activation_threshold=vmax / 3)
        if view_type == 'stat_map':
            plot_stat_map(img, threshold=threshold,
                          cut_coords=cut_coords,
                          vmax=vmax,
                          colorbar=True,
                          output_file=src,
                          # cmap=cmap
                          )
        elif view_type == 'glass_brain':
            plot_glass_brain(img, threshold=threshold,
                             vmax=vmax,
                             plot_abs=False,
                             output_file=src,
                             colorbar=True,
                             # cmap=cmap_white
                             )
        else:
            raise ValueError('Wrong view type in `view_types`: got %s' %

                             view_type)