# Path: brainiak/utils/fmrisim_real_time_generator.py
# def _generate_ROIs(ROI_file,
#                    stimfunc,
#                    noise,
#                    scale_percentage,
#                    data_dict):
# def _write_dicom(output_name,
#                  data,
#                  image_number=0):
# def _get_input_names(data_dict):
# def generate_data(outputDir,
#                   user_settings):
#         ROI = nii.get_data()
#         ROI = ROI_file


import numpy as np
import pytest
import os
import time
import glob
import gzip
from brainiak.utils import fmrisim_real_time_generator as gen
from pkg_resources import resource_stream
from typing import Dict
from nibabel.nifti1 import Nifti1Image
                      dd)

    # Check that there are 32 files where there should be (30 plus label and
    # mask)
    assert len(os.listdir(str(tmp_path))) == 32, "Incorrect file number"

    # Check that the data is the right shape
    input_template = dd['template_path']
    input_shape = input_template.shape
    output_vol = np.load(tmp_path / 'rt_000.npy')
    output_shape = output_vol.shape
    assert input_shape == output_shape, 'Output shape is incorrect'

    # Check the labels have the correct count
    labels = np.load(tmp_path / 'labels.npy')

    assert np.sum(labels > 0) == 9, 'Incorrect number of events'


def test_signal_size(tmp_path, dd=data_dict):

    dd = dd.copy()

    # Change it to only use ROI A
    dd['different_ROIs'] = False

    # Make the signal large
    dd['scale_percentage'] = 100

    # Run the simulation

# Path: brainiak/utils/fmrisim_real_time_generator.py
# def _generate_ROIs(ROI_file,
#                    stimfunc,
#                    noise,
#                    scale_percentage,
#                    data_dict):
# def _write_dicom(output_name,
#                  data,
#                  image_number=0):
# def _get_input_names(data_dict):
# def generate_data(outputDir,
#                   user_settings):
#         ROI = nii.get_data()
#         ROI = ROI_file


# Path: tests/utils/test_fmrisim_real_time.py
import numpy as np
import pytest
import os
import time
import glob
import gzip
from brainiak.utils import fmrisim_real_time_generator as gen
from pkg_resources import resource_stream
from typing import Dict
from nibabel.nifti1 import Nifti1Image

                      dd)

    # Check that there are 32 files where there should be (30 plus label and
    # mask)
    assert len(os.listdir(str(tmp_path))) == 32, "Incorrect file number"

    # Check that the data is the right shape
    input_template = dd['template_path']
    input_shape = input_template.shape
    output_vol = np.load(tmp_path / 'rt_000.npy')
    output_shape = output_vol.shape
    assert input_shape == output_shape, 'Output shape is incorrect'

    # Check the labels have the correct count
    labels = np.load(tmp_path / 'labels.npy')

    assert np.sum(labels > 0) == 9, 'Incorrect number of events'


def test_signal_size(tmp_path, dd=data_dict):

    dd = dd.copy()

    # Change it to only use ROI A
    dd['different_ROIs'] = False

    # Make the signal large
    dd['scale_percentage'] = 100

    # Run the simulation

    gen.generate_data(str(tmp_path),