Skip to content

Commit 19af35e

Browse files
committed
Call elastix directly instead of running a generated .bat-file through winopen.
1 parent 1d7fe3a commit 19af35e

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

RegLSM/test_FLAIR_T1.m

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,16 @@
103103
mkdir(Dir,'to_MNI');
104104
%% Writing elastix command for registration
105105
fid = fopen(strcat(Dir,'\batch\elastix_FLAIR_T1_SC.bat'),'wt');
106+
% CMD_FLAIR_T1 = ['"',Dir_code,'\Elastix\elastix.exe' '"' ' -f' blanks(1) '"' T1 '"' blanks(1) '-m' blanks(1) '"' FLAIR '"' blanks(1) reg_FLAIR_T1 blanks(1) '-out' blanks(1) '"' strcat(Dir,'\FLAIR_to_T1') '"'];
106107
CMD_FLAIR_T1 = ['"',Dir_code,'\Elastix\elastix.exe' '"' ' -f' blanks(1) '"' T1 '"' blanks(1) '-m' blanks(1) '"' FLAIR '"' blanks(1) reg_FLAIR_T1 blanks(1) '-out' blanks(1) '"' strcat(Dir,'\FLAIR_to_T1') '"'];
107-
fprintf(fid, '%s\n', CMD_FLAIR_T1);
108+
%fprintf(fid, '%s\n', CMD_FLAIR_T1);
109+
system(CMD_FLAIR_T1);
110+
% CMD_T1_Rorden = ['"',Dir_code,'\Elastix\elastix.exe' '"' ' -f' blanks(1) '"' SC '"' blanks(1) '-m' blanks(1) '"' T1 '"' blanks(1) reg_T1_Rorden blanks(1) '-out' blanks(1) '"' strcat(Dir,'\T1_to_SC') '"'];
108111
CMD_T1_Rorden = ['"',Dir_code,'\Elastix\elastix.exe' '"' ' -f' blanks(1) '"' SC '"' blanks(1) '-m' blanks(1) '"' T1 '"' blanks(1) reg_T1_Rorden blanks(1) '-out' blanks(1) '"' strcat(Dir,'\T1_to_SC') '"'];
109-
fprintf(fid, '%s\n', CMD_T1_Rorden);
112+
%fprintf(fid, '%s\n', CMD_T1_Rorden);
113+
system(CMD_T1_Rorden);
110114
fclose(fid);
111-
winopen(strcat(Dir,'\batch\elastix_FLAIR_T1_SC.bat'));
115+
% winopen(strcat(Dir,'\batch\elastix_FLAIR_T1_SC.bat'));
112116
disp('MATLAB continues after calling elastix.exe')
113117

114118

@@ -296,8 +300,10 @@
296300
fid = fopen(strcat(Dir,'\batch\transformix_to_MNI.bat'),'wt');
297301
mkdir(strcat(Dir,'\to_MNI'),'lesion');
298302
CMD_to_MNI=['"',Dir_code,'\Elastix\transformix.exe' '"' ' -in' blanks(1) '"' FLAIR '"' blanks(1) '-out' blanks(1) '"' strcat(Dir,'\to_MNI') '"' blanks(1) '-tp ' blanks(1) '"' strcat(Dir,'\to_MNI\to_MNI.txt') '"'];
299-
fprintf(fid, '%s\n', CMD_to_MNI);
303+
% fprintf(fid, '%s\n', CMD_to_MNI);
304+
system(CMD_to_MNI);
300305
CMD_to_MNI_lesion=['"',Dir_code,'\Elastix\transformix.exe' '"' ' -in' blanks(1) '"' LESION '"' blanks(1) '-out' blanks(1) '"' strcat(Dir,'\to_MNI\lesion') '"' blanks(1) '-tp ' blanks(1) '"' strcat(Dir,'\to_MNI\to_MNI_lesion.txt') '"'];
301-
fprintf(fid, '%s\n', CMD_to_MNI_lesion);
306+
system(CMD_to_MNI_lesion);
307+
% fprintf(fid, '%s\n', CMD_to_MNI_lesion);
302308
fclose(fid);
303-
winopen(strcat(Dir,'\batch\transformix_to_MNI.bat'));
309+
% winopen(strcat(Dir,'\batch\transformix_to_MNI.bat'));

0 commit comments

Comments
 (0)