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

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