source: plugins/write_difference_images.m @ 32

Last change on this file since 32 was 32, checked in by tjniskan, 11 years ago
  • Renamed the plugin m-files

M an2_revision.m
D plugins/calc_t1r_map.m
D plugins/show_kspace.m
A plugins/write_difference_images.m
D plugins/diffimage.m
D plugins/copydataroi_plugin.m
D plugins/profile_plugin.m
A plugins/plot_profile.m
A plugins/calculate_t1r_map.m
A plugins/view_kspace.m
A plugins/copy_data_to_workspace.m

File size: 867 bytes
Line 
1function write_difference_images(DATA,ROI,AddInfo)
2
3if AddInfo.isDataMixed
4  if rem(length(DATA),2)~=0
5        return
6  end
7 
8  % Ask a directory to save the files
9  dirname = uigetdir;
10  if isequal(dirname,0)
11        return
12  else
13        dirname = [dirname,filesep];
14  end
15 
16  data_new = cell(1,length(DATA)/2);
17  fnames = cell(1,length(DATA)/2);
18  count = 1;
19  for ii=1:2:length(DATA)
20        data_new{count} = DATA{ii}.FTDATA-DATA{ii+1}.FTDATA;
21        [fp1,fn1,fe1]=fileparts(DATA{ii}.HDR.fname);
22        [fp2,fn2,fe2]=fileparts(DATA{ii+1}.HDR.fname);
23        fnames{count}=[fn1,' - ',fn2,'.nii'];
24        count=count+1;
25  end
26 
27 
28  % write *.nii files
29  h=an2_wbar(0,sprintf('Writing File...\n%s',' '));
30  for ii=1:length(data_new)
31        an2_wbar(ii/length(data_new),h,...
32          sprintf('Writing File...\n%s',[dirname,fnames{ii}]))
33        an2_write_nifti(data_new{ii},[dirname,fnames{ii}]);
34  end
35  delete(h)
36else
37  return
38end
Note: See TracBrowser for help on using the repository browser.

Powered by Trac 1.0.9.Copyright © Juha-Pekka Niskanen 2008