From 12fb267b7de20b8bdfffddc6efd779c6fb1a211e Mon Sep 17 00:00:00 2001
From: Matthew Webster <mwebster@fmrib.ox.ac.uk>
Date: Thu, 19 Mar 2009 15:21:49 +0000
Subject: [PATCH] fixed single-seed mode

---
 fdt.tcl | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/fdt.tcl b/fdt.tcl
index 1275a32..b395fd7 100644
--- a/fdt.tcl
+++ b/fdt.tcl
@@ -690,6 +690,15 @@ proc fdt:apply { w dialog } {
       	    if { [ file exists $probtrack(output) ] } {
       		set canwrite [  YesNoWidget "Overwrite $probtrack(output)?" Yes No ]
 	    }
+
+	    set deslashedFileName [ rmSlash  $probtrack(output) ]
+            if {[string index $deslashedFileName 0] != "/"} {
+		#remove ./ if name only typed in by tailing value
+		set deslashedFileName [file tail $deslashedFileName ]
+		set deslashedFileName [pwd]/$deslashedFileName
+		set probtrack(output) [rmSlash $deslashedFileName]
+	    }
+
        	    if { $canwrite } {
        		puts "rm -rf $probtrack(output)"
        		exec rm -rf $probtrack(output)
@@ -727,6 +736,7 @@ proc fdt:apply { w dialog } {
 	    }
             switch $probtrack(mode) {
 	       simple { 
+		    set singleFileName [ file tail $probtrack(output) ]
 		    set fd [ open "${filebase}_coordinates.txt" w ]
 		    set x $probtrack(x)
 		    set y $probtrack(y)
@@ -750,7 +760,7 @@ proc fdt:apply { w dialog } {
 		    puts $log "set probtrack(y) $probtrack(y)"
 		    puts $log "set probtrack(z) $probtrack(z)"
 		    puts $log "set probtrack(units) $probtrack(units)"
-                    set flags "--mode=simple --seedref=$probtrack(reference) -o $probtrack(output) -x ${filebase}_coordinates.txt $flags"
+		   set flags "--mode=simple --seedref=$probtrack(reference) -o ${probtrack(output)}/${singleFileName} -x ${filebase}_coordinates.txt $flags"
 	       } 
                seedmask {
 		   if { [ file exists ${FSLDIR}/bin/reord_OM ] } {
-- 
GitLab