<commit_before>#!/usr/bin/env python
#########################################################################################
#
# Test function for sct_extract_metric script
#
# ---------------------------------------------------------------------------------------
# Copyright (c) 2014 Polytechnique Montreal <www.neuro.polymtl.ca>
# Author: <NAME>
# modified: 2014/09/28
#
# About the license: see the file LICENSE.TXT
#########################################################################################

# TODO: add integrity check

#import sct_utils as sct
import commands


def test(path_data):

    # parameters
    folder_data = ['mt/', 'label/atlas']
    file_data = ['mtr.nii.gz']
    file_output = ['mtr.txt']

    # define command
    cmd = 'sct_extract_metric' \
        ' -i '+path_data+folder_data[0]+file_data[0]+ \
        ' -f '+path_data+folder_data[0]+folder_data[1]+ \
        ' -method wath '+ \
        ' -vert 1:3'+ \
        ' -o quantif_'+file_output[0]+ \
        ' -v 1'

    # return
    #return sct.run(cmd, 0)
    return commands.getstatusoutput(cmd)<commit_msg>REF: better output file name<commit_after>#!/usr/bin/env python
#########################################################################################
#
# Test function for sct_extract_metric script
#
# ---------------------------------------------------------------------------------------
# Copyright (c) 2014 Polytechnique Montreal <www.neuro.polymtl.ca>
# Author: <NAME>
# modified: 2014/09/28
#
# About the license: see the file LICENSE.TXT
#########################################################################################

# TODO: add integrity check

#import sct_utils as sct
import commands


def test(path_data):

    # parameters
    folder_data = ['mt/', 'label/atlas']
    file_data = ['mtr.nii.gz']
    file_output = ['quantif_mtr.txt']

    # define command
    cmd = 'sct_extract_metric' \
        ' -i '+path_data+folder_data[0]+file_data[0]+ \
        ' -f '+path_data+folder_data[0]+folder_data[1]+ \
        ' -method wath '+ \
        ' -vert 1:3'+ \
        ' -o '+file_output[0]+ \
        ' -v 1'

    # return
    #return sct.run(cmd, 0)
    return commands.getstatusoutput(cmd)
{'fraction_non_alphanumeric': 0.35052012663952964, 'fraction_numerical': 0.018995929443690638, 'mean_word_length': 2.6084828711256116, 'pattern_counts': {'":': 0, '<': 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': '910543', 'n_tokens_mistral': 683, 'n_tokens_neox': 630, 'n_words': 135}