Change coordinate system of specified image. [Usage] dmri_image_transform(from_file, to_file, to_ref_file, ... direction, transinfo_dir); [Input] from_file : original niftigz file. to_file : transformed and newly create niftigz file. to_ref_file : reference image file of to_file. direction : transform direction [string] 'fs2struct' : from freesurfer coord to T1 coord. 'struct2fa' : from T1 coord to FA coord. 'struct2fa_nointerp' : from T1 coord to FA coord with interp. transinfo_dir : The directory which is including transform files. This directory is made by dti_transwarp_info_create.m Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function dmri_image_transform(from_file, to_file, to_ref_file, ... 0002 direction, transinfo_dir) 0003 % Change coordinate system of specified image. 0004 % 0005 % [Usage] 0006 % dmri_image_transform(from_file, to_file, to_ref_file, ... 0007 % direction, transinfo_dir); 0008 % 0009 % [Input] 0010 % from_file : original niftigz file. 0011 % to_file : transformed and newly create niftigz file. 0012 % to_ref_file : reference image file of to_file. 0013 % direction : transform direction [string] 0014 % 'fs2struct' : from freesurfer coord to T1 coord. 0015 % 'struct2fa' : from T1 coord to FA coord. 0016 % 'struct2fa_nointerp' : from T1 coord to FA coord with interp. 0017 % transinfo_dir : The directory which is including transform files. 0018 % This directory is made by dti_transwarp_info_create.m 0019 % 0020 % 0021 % Copyright (C) 2011, ATR All Rights Reserved. 0022 % License : New BSD License(see VBMEG_LICENSE.txt) 0023 0024 % 0025 % --- Previous check 0026 % 0027 if nargin ~= 5 0028 error('Please check input arguments.'); 0029 end 0030 if exist(transinfo_dir, 'dir') ~= 7 0031 error(sprintf('transinfo_dir : %s not found.', transinfo_dir)); 0032 end 0033 0034 % 0035 % --- Main Procedure 0036 % 0037 0038 % get command 0039 command = dmri_image_transform_cmd_get(from_file, to_file, to_ref_file, ... 0040 direction, transinfo_dir); 0041 0042 % Execute command 0043 [status, cmdout] = dmri_system(command, '-echo'); 0044 if status ~= 0 0045 error('Please check input arguments'); 0046 end