~ubuntu-branches/ubuntu/vivid/mricron/vivid

« back to all changes in this revision

Viewing changes to debian/patches/debian_fslbet

  • Committer: Bazaar Package Importer
  • Author(s): Michael Hanke
  • Date: 2011-02-02 16:18:59 UTC
  • Revision ID: james.westby@ubuntu.com-20110202161859-y916059cgwpgq0i2
Tags: 0.20101102.1~dfsg.1-2
* Change maintainer email.
* Add 'fsl' as a suggested package.
* Add patch to make mricron work with Debian's FSL setup (to call BET for
  skull-stripping). Also call mricron via a wrapper that automatically
  sources the FSL configuration file on startup. Closes: #611374

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Make mricron works with Debian's FSL
 
2
Forwarded: not-needed
 
3
Author: Michael Hanke <michael.hanke@gmail.com>
 
4
--- a/bet.pas
 
5
+++ b/bet.pas
 
6
@@ -63,8 +63,11 @@
 
7
    AStringList := TStringList.Create;
 
8
    AProcess.CommandLine := lCmd;
 
9
    {$IFDEF UNIX}
 
10
-      AProcess.Environment.Add(gBGImg.FSLDIR);
 
11
-   AProcess.Environment.Add(gBGImg.FSLOUTPUTTYPE);
 
12
+      // On Debian FSLDIR is set outside mricron
 
13
+      //AProcess.Environment.Add(gBGImg.FSLDIR);
 
14
+   // and we must not set any environment variable to let the child process
 
15
+   // inherit the current environment settings
 
16
+   //AProcess.Environment.Add(gBGImg.FSLOUTPUTTYPE);
 
17
 
 
18
    //AProcess.Environment.Add('FSLDIR=/usr/local/fsl');
 
19
    //AProcess.Environment.Add('FSLOUTPUTTYPE=NIFTI_GZ');
 
20
@@ -84,18 +87,20 @@
 
21
   lCmd: string;
 
22
 begin
 
23
      result := false;
 
24
-     lCmd :=  extractfilepath(paramstr(0))+'bet';
 
25
-     {$IFNDEF Unix}
 
26
-     lCmd := lCmd+'.exe';
 
27
-     {$ENDIF}
 
28
-     if not PathExists (lCmd) then begin
 
29
-        lCmd := '/usr/local/fsl/bin/bet_8UI';
 
30
-        if not PathExists (lCmd) then begin
 
31
-           lCmd := '/usr/local/fsl/bin/bet';
 
32
-           if not PathExists (lCmd) then
 
33
-                 exit;
 
34
-        end;
 
35
-     end; //no bet in home folder...
 
36
+     // On Debian we guarantee that bet is globally available if installed at all
 
37
+     lCmd := 'bet';
 
38
+     //lCmd :=  extractfilepath(paramstr(0))+'bet';
 
39
+     //{$IFNDEF Unix}
 
40
+     //lCmd := lCmd+'.exe';
 
41
+     //{$ENDIF}
 
42
+     //if not PathExists (lCmd) then begin
 
43
+     //   lCmd := '/usr/local/fsl/bin/bet_8UI';
 
44
+     //   if not PathExists (lCmd) then begin
 
45
+     //      lCmd := '/usr/local/fsl/bin/bet';
 
46
+     //      if not PathExists (lCmd) then
 
47
+     //            exit;
 
48
+     //   end;
 
49
+     //end; //no bet in home folder...
 
50
   lCmd := lCmd+' "'+lInFile+'" "'+lOutFile +'" -f '+floattostr(lFrac);
 
51
   BETForm.Memo1.Lines.Add(lCmd);
 
52
   RunCmd(lCmd);