1 | function t1_rho(DATA,ROI,AddInfo) |
---|

2 | % This Aedes plugin calculates T1 rho map |
---|

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 | |
---|

20 | fit_vals = []; |
---|

21 | if AddInfo.isDataMixed |
---|

22 | nSlices = length(DATA); |
---|

23 | else |
---|

24 | nSlices = size(DATA{1}.FTDATA,3); |
---|

25 | |
---|

26 | % Try to get fit values from PROCPAR.pi |
---|

27 | % if isfield(DATA{1},'PROCPAR') && ~isempty(DATA{1}.PROCPAR) && ... |
---|

28 | % isfield(DATA{1}.PROCPAR,'pi') && length(DATA{1}.PROCPAR.pi)>1 |
---|

29 | % fit_vals = DATA{1}.PROCPAR.pi./1000; |
---|

30 | % end |
---|

31 | end |
---|

32 | |
---|

33 | resp = aedes_inputdlg('Type spin-lock values'); |
---|

34 | if isempty(resp) |
---|

35 | return |
---|

36 | else |
---|

37 | resp=resp{1}; |
---|

38 | fit_vals = str2num(resp); |
---|

39 | end |
---|

40 | |
---|

41 | |
---|

42 | % Prompt for file name |
---|

43 | [fname,fpath,findex]=uiputfile({'*.t1r;*.T1R;*.s1r;*.S1R',... |
---|

44 | 'T1R-Files (*.t1r, *.s1r)';... |
---|

45 | '*.*','All Files (*.*)'},... |
---|

46 | 'Save T1R-file',[DATA{1}.HDR.fpath, ... |
---|

47 | 't1rho_map']); |
---|

48 | if isequal(fname,0) || isequal(fpath,0) |
---|

49 | return |
---|

50 | end |
---|

51 | |
---|

52 | % Calculate the map |
---|

53 | [fp,fn,fe]=fileparts([fpath,fname]); |
---|

54 | try |
---|

55 | aedes_fitmaps(DATA,'t1r',fit_vals,'FileName',[fp,filesep,fn]); |
---|

56 | catch |
---|

57 | errordlg({'Could not calculate T1 rho maps. The following error was returned',... |
---|

58 | '',lasterr},'modal') |
---|

59 | end |
---|

60 | |
---|