<commit_before>#!/usr/bin/env python
#########################################################################################
#
# Test function for sct_register_multimodal 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 sct_utils as sct
import commands


def test(path_data):

    folder_data = 'mt/'
    file_data = ['mt0.nii.gz', 'mt1.nii.gz']

    output = ''
    status = 0
    ok_algos = ['slicereg2d_pointwise','slicereg2d_translation','slicereg2d_rigid','slicereg2d_affine','slicereg2d_syn','slicereg2d_bsplinesyn','slicereg']
    possible_algos =['rigid', 'affine', 'compositeaffine', 'similarity', 'translation', 'bspline', 'gaussiandisplacementfield', 'bsplinedisplacementfield', 'syn', 'bsplinesyn']
    for algo in possible_algos:
        cmd = 'sct_register_multimodal -i ' + path_data + folder_data + file_data[0] \
              + ' -d ' + path_data + folder_data + file_data[1] \
              + ' -o data_reg.nii.gz'  \
              + ' -p step=1,algo=syn,iter=1,smooth=0,shrink=4,metric=MeanSquares'  \
              + ' -x linear' \
              + ' -r 0' \
              + ' -v 1'
        output += cmd+'\n'  # copy command
        s, o = commands.getstatusoutput(cmd)
        status += s
        output += '*****************************************************************************************************\n' \
                  'OUTPUT FROM TEST '+algo+': '
        output += o
        output += '*****************************************************************************************************\n'

    '''
    cmd = 'sct_register_multimodal -i ' + path_data + folder_data + file_data[0] \
          + ' -d ' + path_data + folder_data + file_data[1] \<commit_msg>BUG: find out why linux fails<commit_after>#!/usr/bin/env python
#########################################################################################
#
# Test function for sct_register_multimodal 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 sct_utils as sct
import commands


def test(path_data):

    folder_data = 'mt/'
    file_data = ['mt0.nii.gz', 'mt1.nii.gz']

    output = ''
    status = 0
    possible_algos =['slicereg2d_pointwise','slicereg2d_translation','slicereg2d_rigid','slicereg2d_affine','slicereg2d_syn','slicereg2d_bsplinesyn','slicereg', 'rigid', 'affine', 'compositeaffine', 'similarity', 'translation', 'bspline', 'gaussiandisplacementfield', 'bsplinedisplacementfield', 'syn', 'bsplinesyn']
    for algo in possible_algos:
        cmd = 'sct_register_multimodal -i ' + path_data + folder_data + file_data[0] \
              + ' -d ' + path_data + folder_data + file_data[1] \
              + ' -o data_reg.nii.gz'  \
              + ' -p step=1,algo='+algo+',iter=1,smooth=0,shrink=4,metric=MeanSquares'  \
              + ' -x linear' \
              + ' -r 0' \
              + ' -v 1'
        output += cmd+'\n'  # copy command
        s, o = commands.getstatusoutput(cmd)
        status += s
        output += '*****************************************************************************************************\n' \
                  'OUTPUT FROM TEST '+algo+': '
        output += o
        output += '*****************************************************************************************************\n'

    '''
    cmd = 'sct_register_multimodal -i ' + path_data + folder_data + file_data[0] \
          + ' -d ' + path_data + folder_data + file_data[1] \
{'fraction_non_alphanumeric': 0.34032690900219564, 'fraction_numerical': 0.016101488167845818, 'mean_word_length': 2.9122137404580153, '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': '1354404', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1155, 'n_words': 232}