<commit_before>#!/usr/bin/env python
#########################################################################################
#
# Test function for sct_fmri_compute_tsnr script
#
# The test should be done in a folder containing a fmri.nii.gz and a t2.nii.gz files
#
# ---------------------------------------------------------------------------------------
# Copyright (c) 2014 Polytechnique Montreal <www.neuro.polymtl.ca>
# Author: <NAME>
# modified: 2015-03-16
#
# About the license: see the file LICENSE.TXT
#########################################################################################

import commands
import os


def test(data_path):
    #parameters
    data_folders = ['t2/', 'fmri/']
    data_files = ['t2.nii.gz', 'fmri.nii.gz']

    # define command
    cmd = 'sct_fmri_compute_tsnr -fmri ' + data_path + data_folders[1] + data_files[1] \
          + ' -anat ' + data_path + data_folders[0] + data_files[0]

    # return
    return commands.getstatusoutput(cmd)


if __name__ == "__main__":
    # call main function<commit_msg>TEST: updated test for compute_tsnr (flag changed)<commit_after>#!/usr/bin/env python
#########################################################################################
#
# Test function for sct_fmri_compute_tsnr script
#
# The test should be done in a folder containing a fmri.nii.gz and a t2.nii.gz files
#
# ---------------------------------------------------------------------------------------
# Copyright (c) 2014 Polytechnique Montreal <www.neuro.polymtl.ca>
# Author: <NAME>
# modified: 2015-03-16
#
# About the license: see the file LICENSE.TXT
#########################################################################################

import commands
import os


def test(data_path):
    #parameters
    data_folders = ['fmri/']
    data_files = ['fmri.nii.gz']

    # define command
    cmd = 'sct_fmri_compute_tsnr -i ' + data_path + data_folders[0] + data_files[0]

    # return
    return commands.getstatusoutput(cmd)


if __name__ == "__main__":
    # call main function
{'fraction_non_alphanumeric': 0.346718903036239, 'fraction_numerical': 0.01665034280117532, 'mean_word_length': 3.0455445544554456, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2122795', 'n_tokens_mistral': 610, 'n_tokens_neox': 570, 'n_words': 145}