<s> import commands , sys , os <EOL> status , path_sct = commands . getstatusoutput ( '<STR_LIT>' ) <EOL> sys . path . append ( path_sct + '<STR_LIT>' ) <EOL> sys . path . append ( path_sct + '<STR_LIT>' ) <EOL> import sct_utils as sct <EOL> from glob import glob <EOL> import time <EOL> from shutil import copy <EOL> os . chdir ( '<STR_LIT>' ) <EOL> list_dir = os . listdir ( '<STR_LIT>' ) <EOL> for i in range ( <NUM_LIT:2> , len ( list_dir ) ) : <EOL> list_dir_2 = os . listdir ( '<STR_LIT>' + '<STR_LIT:/>' + list_dir [ i ] ) <EOL> for j in range ( len ( list_dir_2 ) ) : <EOL> if list_dir_2 [ j ] == '<STR_LIT>' : <EOL> print '<STR_LIT>' + list_dir [ i ] + '<STR_LIT:/>' + list_dir_2 [ j ] + '<STR_LIT>' <EOL> os . chdir ( list_dir [ i ] + '<STR_LIT:/>' + list_dir_2 [ j ] ) <EOL> path_tmp = '<STR_LIT>' + time . strftime ( "<STR_LIT>" ) <EOL> sct . run ( '<STR_LIT>' + path_tmp ) <EOL> sct . printv ( '<STR_LIT>' ) <EOL> name_anatomy_file = glob ( '<STR_LIT>' ) [ <NUM_LIT:0> ] <EOL> path_anatomy_file = os . path . abspath ( name_anatomy_file ) <EOL> path_centerline = os . path . abspath ( '<STR_LIT>' ) <EOL> path_warp1 = os . path . abspath ( '<STR_LIT>' ) <EOL> path_warp2 = os . path . abspath ( '<STR_LIT>' ) <EOL> sct . run ( '<STR_LIT>' + path_anatomy_file + '<STR_LIT:U+0020>' + path_tmp ) <EOL> sct . run ( '<STR_LIT>' + path_centerline + '<STR_LIT:U+0020>' + path_tmp ) <EOL> sct . run ( '<STR_LIT>' + path_warp1 + '<STR_LIT:U+0020>' + path_tmp ) <EOL> sct . run ( '<STR_LIT>' + path_warp2 + '<STR_LIT:U+0020>' + path_tmp ) <EOL> os . chdir ( path_tmp ) <EOL> print '<STR_LIT>' + list_dir [ i ] + '<STR_LIT:/>' + list_dir_2 [ j ] + '<STR_LIT>' <EOL> print '<STR_LIT>' + name_anatomy_file + '<STR_LIT>' + '<STR_LIT>' + '<STR_LIT>' <EOL> sct . run ( '<STR_LIT>' + name_anatomy_file + '<STR_LIT>' + '<STR_LIT>' ) <EOL> path , file , ext = sct . extract_fname ( name_anatomy_file ) <EOL> output_straighten_name = file + '<STR_LIT>' + ext <EOL> print '<STR_LIT>' <EOL> sct . run ( '<STR_LIT>' + '<STR_LIT>' + '<STR_LIT>' + output_straighten_name + '<STR_LIT>' + '<STR_LIT>' + '<STR_LIT>' + '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> sct . run ( '<STR_LIT>' + output_straighten_name + '<STR_LIT>' ) <EOL> name_output_straight = glob ( '<STR_LIT>' ) [ <NUM_LIT:0> ] <EOL> name_output_straight_normalized = glob ( '<STR_LIT>' ) [ <NUM_LIT:0> ] <EOL> print '<STR_LIT>' <EOL> copy ( name_output_straight , '<STR_LIT>' + list_dir [ i ] + '<STR_LIT>' ) <EOL> copy ( name_output_straight_normalized , '<STR_LIT>' + list_dir [ i ] + '<STR_LIT>' ) <EOL> print ( '<STR_LIT>' ) <EOL> os . chdir ( '<STR_LIT>' ) </s>
