source: plugins/write_difference_images.m @ 161

Last change on this file since 161 was 80, checked in by tjniskan, 10 years ago
  • Changed the historical "an2_" prefix to "aedes_" in all files. NOTE:

Any script or function relying to Aedes functions will be broken
because of this. Just do a search/replace from "an2_" to "aedes_" in
your files and all should be well...

  • Changed the name of an2_readtab.m to a more informative

aedes_readphasetable.m

File size: 1.5 KB
Line 
1function write_difference_images(DATA,ROI,AddInfo)
2% Aedes plugin for writing difference images for ASL
3
4% This function is a part of Aedes - A graphical tool for analyzing
5% medical images
6%
7% Copyright (C) 2006 Juha-Pekka Niskanen <Juha-Pekka.Niskanen@uku.fi>
8%
9% Department of Physics, Department of Neurobiology
10% University of Kuopio, FINLAND
11%
12% This program may be used under the terms of the GNU General Public
13% License version 2.0 as published by the Free Software Foundation
14% and appearing in the file LICENSE.TXT included in the packaging of
15% this program.
16%
17% This program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18% WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19
20if AddInfo.isDataMixed
21  if rem(length(DATA),2)~=0
22        return
23  end
24 
25  % Ask a directory to save the files
26  dirname = uigetdir;
27  if isequal(dirname,0)
28        return
29  else
30        dirname = [dirname,filesep];
31  end
32 
33  data_new = cell(1,length(DATA)/2);
34  fnames = cell(1,length(DATA)/2);
35  count = 1;
36  for ii=1:2:length(DATA)
37        data_new{count} = DATA{ii}.FTDATA-DATA{ii+1}.FTDATA;
38        [fp1,fn1,fe1]=fileparts(DATA{ii}.HDR.fname);
39        [fp2,fn2,fe2]=fileparts(DATA{ii+1}.HDR.fname);
40        fnames{count}=[fn1,' - ',fn2,'.nii'];
41        count=count+1;
42  end
43 
44 
45  % write *.nii files
46  h=aedes_wbar(0,sprintf('Writing File...\n%s',' '));
47  for ii=1:length(data_new)
48        aedes_wbar(ii/length(data_new),h,...
49          sprintf('Writing File...\n%s',[dirname,fnames{ii}]))
50        aedes_write_nifti(data_new{ii},[dirname,fnames{ii}]);
51  end
52  delete(h)
53else
54  return
55end
Note: See TracBrowser for help on using the repository browser.

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