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

import commands

def test(path_data):

    # parameters
    folder_data = 't2/'
    file_data = ['t2.nii.gz', 't2_centerline_init.nii.gz', 't2_centerline_labels.nii.gz']

    output = ''
    status = 0

    # define command
    cmd = 'sct_get_centerline -i ' + path_data + folder_data + file_data[0] \
        + ' -method auto' \
        + ' -t t2 ' \
        + ' -v 1'
    output += '\n====================================================================================================\n'+cmd+'\n====================================================================================================\n\n'  # copy command
    s, o = commands.getstatusoutput(cmd)
    status += s
    output += o

    # define command
    cmd = 'sct_get_centerline -i ' + path_data + folder_data + file_data[0] \
        + ' -method point' \
        + ' -p ' + path_data + folder_data + file_data[1] \
        + ' -g 1'\
        + ' -k 4'
    output += '\n====================================================================================================\n'+cmd+'\n====================================================================================================\n\n'  # copy command
    s, o = commands.getstatusoutput(cmd)
    status += s
    output += o

    # define command
    cmd = 'sct_get_centerline -i ' + path_data + folder_data + file_data[0] \
        + ' -method labels ' \
        + ' -l ' + path_data + folder_data + file_data[2] \
        + ' -v 1'
    output += '\n====================================================================================================\n'+cmd+'\n====================================================================================================\n\n'  # copy command
    s, o = commands.getstatusoutput(cmd)
    status += s
    output += o<commit_msg>TEST: removed testing for sct_get_centerline -method point (requires FSL)<commit_after>#!/usr/bin/env python
#########################################################################################
#
# Test function for sct_get_centerline script
#
#   replace the shell test script in sct 1.0
#
# ---------------------------------------------------------------------------------------
# Copyright (c) 2014 Polytechnique Montreal <www.neuro.polymtl.ca>
# Author: <NAME>
# modified: 2014/09/28
#
# About the license: see the file LICENSE.TXT
#########################################################################################

import commands

def test(path_data):

    # parameters
    folder_data = 't2/'
    file_data = ['t2.nii.gz', 't2_centerline_init.nii.gz', 't2_centerline_labels.nii.gz']

    output = ''
    status = 0

    # define command
    cmd = 'sct_get_centerline -i ' + path_data + folder_data + file_data[0] \
        + ' -method auto' \
        + ' -t t2 ' \
        + ' -v 1'
    output += '\n====================================================================================================\n'+cmd+'\n====================================================================================================\n\n'  # copy command
    s, o = commands.getstatusoutput(cmd)
    status += s
    output += o

    # define command: DOES NOT RUN IT BECAUSE REQUIRES FSL FLIRT
    # cmd = 'sct_get_centerline -i ' + path_data + folder_data + file_data[0] \
    #     + ' -method point' \
    #     + ' -p ' + path_data + folder_data + file_data[1] \
    #     + ' -g 1'\
    #     + ' -k 4'
    # output += '\n====================================================================================================\n'+cmd+'\n====================================================================================================\n\n'  # copy command
    # s, o = commands.getstatusoutput(cmd)
    # status += s
    # output += o

    # define command
    cmd = 'sct_get_centerline -i ' + path_data + folder_data + file_data[0] \
        + ' -method labels ' \
        + ' -l ' + path_data + folder_data + file_data[2] \
        + ' -v 1'
    output += '\n====================================================================================================\n'+cmd+'\n====================================================================================================\n\n'  # copy command
    s, o = commands.getstatusoutput(cmd)
    status += s
    output += o
{'fraction_non_alphanumeric': 0.4551122194513716, 'fraction_numerical': 0.012053200332502078, 'mean_word_length': 3.2934879571810884, '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': '7640616', 'n_tokens_mistral': 1307, 'n_tokens_neox': 1202, 'n_words': 269}