source: aedes_revision.m @ 170

Last change on this file since 170 was 170, checked in by tjniskan, 8 years ago
  • Epi reconstruction code now consideres all images in the data prior to image=0 as dummy scans

M aedes_revision.m
M vnmr_recon/epi_recon.m

  • Property svn:executable set to *
  • Property svn:keywords set to Revision HeadURL
File size: 2.0 KB
Line 
1function [rev,repo,workingcopy] = aedes_revision()
2% AEDES_REVISION - Returns the current revision of Aedes
3%   
4%
5% Synopsis:
6%        [rev,repo,workingcopy] = aedes_revision;
7%
8% Description:
9%
10% Examples:
11%
12% See also:
13%
14
15% This function is a part of Aedes - A graphical tool for analyzing
16% medical images
17%
18% Copyright (C) 2006 Juha-Pekka Niskanen <Juha-Pekka.Niskanen@uku.fi>
19%
20% Department of Physics, Department of Neurobiology
21% University of Kuopio, FINLAND
22%
23% This program may be used under the terms of the GNU General Public
24% License version 2.0 as published by the Free Software Foundation
25% and appearing in the file LICENSE.TXT included in the packaging of
26% this program.
27%
28% This program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29% WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30
31
32rev = [];
33repo = '';
34
35% Get path to the svn working copy
36fname= mfilename('fullpath');
37[fp,fn,fe] = fileparts(fname);
38workingcopy = [fp,filesep];
39
40% Check if working copy is under version control.
41if ~(exist([workingcopy,'.svn'])==7)
42  rev = '$Revision: 170 $';
43  rev = str2num(rev(12:end-2));
44  return
45end
46
47% Check the current repository and revision
48if isunix
49  s = [];
50  w = [];
51  [s,w] = unix(['svn info "',fp,'"']);
52  if isempty(w)
53        return
54  end
55elseif ispc
56  s = [];
57  w = [];
58  [s,w] = dos(['svn info "',fp,'"']);
59  if isempty(w)
60        return
61  end
62else
63 
64end
65
66% Scan the lines from the output
67C=textscan(w,'%s','delimiter','\n');
68if ~isempty(C)
69  C=C{:};
70else
71  return
72end
73
74% Get URL line
75url_ind = find(strncmpi(C,'URL:',4));
76if ~isempty(url_ind)
77  url_str = C{url_ind}(6:end);
78else
79  return
80end
81repo = url_str;
82
83% Get revision line
84rev_ind = find(strncmpi(C,'Revision:',4));
85if ~isempty(rev_ind)
86  rev_str = C{rev_ind};
87else
88  return
89end
90rev=str2num(rev_str(11:end));
91
92% The next comment line is changed in every commit by the svncommit
93% bash-script every time it is called so that this file "aedes_revision.m" is
94% always in the list of committed files. DO NOT EDIT THE NEXT LINE!!!
95% - Svn Hook -
Note: See TracBrowser for help on using the repository browser.

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