You are correct. The problem is actually that the echo commands sees the
question marks and interprets them as wildcards (like *) for file names,
but it cannot find such files and it it dies. I've attached a new
mri_mergelabels script which should fix the problem. Copy it to
$FREESURFER_HOME/bin (you may need to make it executable)
doug
On 08/06/2014 08:53 AM, Agoston Mihalik wrote:
I looked more into label files and coordinate systems, and finally I think I
found the reasons why bblabel did not work. Here they are:
1. The example in bblabel is wrong, because the bounding box points to the right
hemisphere (xmin>0), that's why it returns a file with no vertices (the file
contains 2 lines, where the second line is 0), when lh.G_cuneus.label is used as
input
2. My own label was created with mri_mergelabels and whilst in the original
label files the first line looks like this:
#!asciii label , from subject fsaverage vox2ras=TkReg
After merging the first line of the output file looks like this:
#label , from subject ??
If I manually edit ?? to fsaverage vox2ras=TkReg, then bblabel works fine also
with my label. Otherwise the output file is empty and the terminal output is:
Finding points within bounds
Writing new label to lh.out.label
Echo: No match
Please, could you check if I am right and why mri_mergelabels does not
recognise fsaverage and writes out ?? for the first line.
Thanks a lot.
Agoston
-----Original Message-----
From: freesurfer-boun...@nmr.mgh.harvard.edu
[mailto:freesurfer-boun...@nmr.mgh.harvard.edu] On Behalf Of Douglas N Greve
Sent: 05 August 2014 23:01
To: freesurfer@nmr.mgh.harvard.edu
Subject: Re: [Freesurfer] bblabel
Can you send the full terminal output? Are you sure that there is something in
the .label file?
On 08/05/2014 08:47 AM, Agoston Mihalik wrote:
Dear All
I have problems using bblabel and would like to ask for expertise.
At first, I tried to make a coronal cut in the following way:
'bblabel --l lh.DLPFCsd.label --o lh.out.label --ymin 26'
I got a runtime error with:
'echo: No match'
Then I used the example in bblabel help:
'bblabel --l lh.G_cuneus.label --o lh.out.label --xmin 0 --ymax -90
--zmin 10 --zmax 20'
During running it seemed to be fine:
'bblabel done'
However, inspecting the output label in freeview I got the following
error:
'no data in label file'
Any help would be appreciated.
Thanks and regards
Agoston
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
--
Douglas N. Greve, Ph.D.
MGH-NMR Center
gr...@nmr.mgh.harvard.edu
Phone Number: 617-724-2358
Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2
www.nmr.mgh.harvard.edu/facility/filedrop/index.html
Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine
at http://www.partners.org/complianceline . If the e-mail was sent to you in
error but does not contain patient information, please contact the sender and
properly dispose of the e-mail.
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
--
Douglas N. Greve, Ph.D.
MGH-NMR Center
gr...@nmr.mgh.harvard.edu
Phone Number: 617-724-2358
Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2
www.nmr.mgh.harvard.edu/facility/filedrop/index.html
Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
#! /bin/tcsh -f
#
# mri_mergelabels
#
# REPLACE_WITH_ONE_LINE_SHORT_DESCRIPTION
#
# Original Author: REPLACE_WITH_FULL_NAME_OF_CREATING_AUTHOR
# CVS Revision Info:
# $Author: greve $
# $Date: 2014/08/06 22:25:37 $
# $Revision: 1.6.2.1 $
#
# Copyright © 2011 The General Hospital Corporation (Boston, MA) "MGH"
#
# Terms and conditions for use, reproduction, distribution and contribution
# are found in the 'FreeSurfer Software License Agreement' contained
# in the file 'LICENSE' found in the FreeSurfer distribution, and here:
#
# https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferSoftwareLicense
#
# Reporting: freesurfer@nmr.mgh.harvard.edu
#
#
# evspatfil - front end for fast_evspatfil.m to filter
# a functional data set by projecting out the eigenvectors
# as computed from evfunc (fast_evfunc.m)
#
set VERSION = '$Id: mri_mergelabels,v 1.6.2.1 2014/08/06 22:25:37 greve Exp $'
set inputargs = ($argv);
set PWDCMD = `getpwdcmd`;
set inputlist = ();
set outlabel = ();
set n = `echo $argv | grep version | wc -l`
if($n != 0) then
echo $VERSION
exit 0;
endif
if($#argv == 0) then
goto usage_exit;
exit 1;
endif
goto parse_args;
parse_args_return:
goto check_params;
check_params_return:
set outdir = `dirname $outlabel`;
mkdir -p $outdir
set firstline = `head -n 1 $inputlist[1]`;
# Count the total number in the label #
set nlabelsum = 0;
foreach inlabel ($inputlist)
set nlabel = `head -2 $inlabel | tail -1`;
set nlabelsum = `echo "$nlabelsum + $nlabel" | bc -l`;
end
#echo "#label , from subject ??" > $outlabel
echo "$firstline" > $outlabel
echo $nlabelsum >> $outlabel
# Cat the data into the label #
foreach inlabel ($inputlist)
tail -n +3 $inlabel >> $outlabel
end
echo "Done"
exit 0;
############--------------##################
parse_args:
set cmdline = ($argv);
while( $#argv != 0 )
set flag = $argv[1]; shift;
switch($flag)
case "-o"
if ( $#argv == 0) goto arg1err;
set outlabel = $argv[1]; shift;
breaksw
case "-i"
if ( $#argv == 0) goto arg1err;
set input = $argv[1];shift;
if(! -e $input) then
echo "ERROR: $input does not exist"
exit 1;
endif
set inputlist = ($inputlist $input);
breaksw
case "-d"
if ($#argv == 0) goto arg1err;
set d = $argv[1];shift;
if(! -e $d) then
echo "ERROR: $d does not exist"
exit 1;
endif
set inputlist = ($inputlist `ls $d/*.label`);
breaksw
case "-verbose":
set verbose = 1;
breaksw
case "-echo":
set echo = 1;
breaksw
case "-debug":
set verbose = 1;
set echo = 1;
breaksw
default:
echo "ERROR: $flag not regocnized"
exit 1;
breaksw
endsw
end
goto parse_args_return;
############--------------##################
############--------------##################
check_params:
if($#inputlist < 2) then
echo "ERROR: not enough inputs specified"
exit 1;
endif
if($#outlabel == 0) then
echo "ERROR: no output specified"
exit 1;
endif
goto check_params_return;
############--------------##################
############--------------##################
arg1err:
echo "ERROR: flag $flag requires one argument"
exit 1
############--------------##################
############--------------##################
usage_exit:
echo ""
echo "USAGE: mri_mergelabels"
echo ""
echo " -i label1 -i label2 ..."
echo " -o outputlabel"
echo " -d dir : all labels in directory dir"
echo ""
echo "This is a simple script that will merge two or more label"
echo "files. It does this by catting the label files together"
echo "(after removing the first two lines). It inserts a new"
echo "header (the first two lines). The number of entries in"
echo "the new file (ie, the number on the second line), is "
echo "computed by summing those from the input files."
echo ""
exit 1;
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.