Abdel,

Indeed mris_fix_topology had the same bug as mris_anatomical_stats (when
running on Slackware Linux). I've posted a fixed version of
mris_fix_topology here:

  http://surfer.nmr.mgh.harvard.edu/pub/dist/

named:

  mris_fix_topology.gz

mv this to your $FREESURFER_HOME/bin, then type:

  gunzip mris_fix_topology.gz
  chmod a+x mris_fix_topology

Let me know if you encounter similar bugs.  This fixed binary will
appear in the next release.

Nick

On Fri, 2007-01-05 at 14:43 +0000, Abdel Douiri wrote:
> Hi Nick
> We have done a new update to our Linux system and i have found the same error 
> that i report a while ago (see bellow) But this time is for mris_fix_topology 
> program.
> Can you please check it again for mris_fix_topology.c file, the error that 
> you found was problem with sprintf! (sprintf(fname,"%s.mgz",fname) to 
> strcat(fname,".mgz")
> ).
> Thanks
> Abdel
>   
> 
> 
> 
> Abdel,
> 
> Thanks for testing this.  The bug fix will appear in an upcoming
> release, but you can continue using the mris_anatomical_stats that you
> have now.
> 
> For those interested in the perils of testing a multi-platform app, the
> buggy line of code was:
> 
>   sprintf(fname,"%s.mgz",fname)
> 
> Here the source and destination are the same, which, according to glibc
> docs for sprintf, is undefined behavior.  The odd thing is that these
> Linux variants: RedHat 7.3, RedHat 9, Centos4, Debian and SuSE; and Mac
> OS X, all have a shared libc lib that handles the line of code properly.
> The libc included with Slackware, however, did not (and understandably
> so).  libc.so is included not with Freesurfer, but with the OS, so this
> means that testing even on a half-dozen different platforms doesn't
> guarantee trouble-free performance on a seemingly identical platform.
> 
> The proper code in this case is:
> 
>   strcat(fname,".mgz");
> 
> N.
> 
> 
> On Fri, 2006-08-18 at 18:40 +0100, A. Douiri wrote:
> > that s works!
> > Cheers!
> > 
> > 
> > At 01:51 18/08/2006, Nick Schmansky wrote:
> > >Abdel,
> > >
> > >I don't think there is a matlab alternative to mris_anatomical_stats.
> > >
> > >However, there is a suspicious line of code in mris_anatomical_stats that
> > >I have fixed, and I'm wondering if you can give a new binary a try.  It is
> > >found here:
> > >
> > >   http://surfer.nmr.mgh.harvard.edu/pub/dist/
> > >
> > >and named:
> > >
> > >   mris_anatomical_stats.gz
> > >
> > >To install, after downloading:
> > >
> > >   gunzip mris_anatomical_stats.gz
> > >   chmod o+x mris_anatomical_stats
> > >   mv mris_anatomical_stats $FREESURFER_HOME/bin
> > >
> > >While I cannot recreate the error you see, I do not have a Slackware
> > >installation, and I am wondering if its core libs are revealing a bug in
> > >our code.
> > >
> > >Let me know if it works.
> > >
> > >Thanks,
> > >
> > >Nick
> > >
> > >
> > > > Hi Nick,
> > > > Thanks in advance for your help and i would like to ask is there an
> > > > alternative in matlab for example to do mris_anatomical_stats?
> > > > The detail of the outjkputs is:
> > > >
> > > > the output of:
> > > > $ mris_anatomical_stats --all-info
> > > > ProgramName: mris_anatomical_stats ProgramArguments: --all-info
> > > > ProgramVersion: $Name: stable3 $ TimeStamp: 06/08/17-10:28:55-GMT CVS:
> > > > $Id:
> > > > mris_anatomical_stats.c,v 1.35.2.1 2006/04/21 19:45:19 nicks Exp $ User:
> > > > douiri Machine: img-179 Platform: Linux PlatformVersion: 2.6.16.22
> > > > CompilerName: GCC CompilerVersion: 30400
> > > >
> > > > I tried with other subjects and also bert and i get the same problem:
> > > >
> > > > $ mris_anatomical_stats -mgz -f ../stats/lh.aparc.stats     -b -a
> > > > ../label/lh.aparc.annot     -c ../stats/aparc.annot.ctab bert lh
> > > > INFO: assuming MGZ format for volumes.
> > > > computing statistics for each annotation in ../label/lh.aparc.annot.
> > > > reading volume .mgz...
> > > > zcat: /home/samba/user/douiri/freesurfer/subjects/01_00/scripts/.mgz.gz:
> > > > No
> > > > such file or directory
> > > > mghRead(/home/samba/user/douiri/freesurfer/subjects/01_00/scripts/.mgz,
> > > > -1):
> > > > read error
> > > > mris_anatomical_stats: could not read input volume .mgz
> > > >
> > > >
> > > > the freesurfer version
> > > > $ cat $FREESURFER_HOME/build-stamp.txt
> > > > freesurfer-Linux-centos4-stable-pub-v3.0.3
> > > >
> > > >
> > > > and the linux version is:
> > > > $ cat /etc/slackware-version
> > > > Slackware 10.2.0
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: [EMAIL PROTECTED]
> > > > [mailto:[EMAIL PROTECTED] On Behalf Of Nick
> > > > Schmansky
> > > > Sent: 17 August 2006 00:06
> > > > To: Abdel Douiri
> > > > Cc: Freesurfer Mailing List
> > > > Subject: RE: [Freesurfer] problem with mris_anatomical_stats
> > > >
> > > > Abdel,
> > > >
> > > > This problem is truly strange.  The filename seems to just disappear.
> > > >
> > > > Can you send me the output of:
> > > >
> > > >   mris_anatomical_stats --all-info
> > > >
> > > > Also, does this error repeat?  That is, if you try:
> > > >
> > > >   cd $SUBJECTS_DIR/01_00/scripts
> > > >   mris_anatomical_stats -mgz -f ../stats/lh.aparc.stats \
> > > >     -b -a ../label/lh.aparc.annot \
> > > >     -c ../stats/aparc.annot.ctab 01_00 lh
> > > >
> > > > does it fail again?  And does this happen for other subjects?
> > > >
> > > > Also, which freesurfer version is being used?  To find out, type:
> > > >
> > > >   cat $FREESURFER_HOME/build-stamp.txt
> > > >
> > > > And which Linux OS is it installed upon?
> > > >
> > > > Nick
> > > >
> > > >
> > > > On Wed, 2006-08-16 at 17:16 +0100, Abdel Douiri wrote:
> > > >> Thanks Bruce
> > > >> I have put the subject and that is "01_00" and the first and second
> > > >> autorecon was OK only the autorecon3 where it was the problem. Attached
> > > > the
> > > >> log file.
> > > >> Thanks a lot for your help
> > > >> Abdel
> > > >> -----Original Message-----
> > > >> From: [EMAIL PROTECTED]
> > > >> [mailto:[EMAIL PROTECTED] On Behalf Of Bruce
> > > >> Fischl
> > > >> Sent: 16 August 2006 14:01
> > > >> To: Abdel Douiri
> > > >> Cc: freesurfer@nmr.mgh.harvard.edu
> > > >> Subject: Re: [Freesurfer] problem with mris_anatomical_stats
> > > >>
> > > >> Hi Abdel,
> > > >>
> > > >> is that the full command line? If so, you need to specify a subject 
> > > >> with
> > > >> -subjid. If not, could you send us the full command line and
> > > > recon-all.log?
> > > >>
> > > >> cheers,
> > > >> Bruce
> > > >>
> > > >>
> > > >>   On Wed, 16 Aug 2006, Abdel  Douiri wrote:
> > > >>
> > > >> > Hi all,
> > > >> >
> > > >> >
> > > >> >
> > > >> > I will be grateful if someone can tell me what going wrong in the
> > > >> following
> > > >> > problem:
> > > >> >
> > > >> > When running "recon-all -autorecon3" the program stop with error
> > > >> exactly
> > > >> in
> > > >> > the "mris_anatomical_stats" cmd stage and I have the following error:
> > > >> >
> > > >> >
> > > >> >
> > > >> > mris_anatomical_stats -mgz -f ../stats/lh.aparc.stats -b -a
> > > >> > ../label/lh.aparc.annot -c ../stats/aparc.annot.ctab 01_00 lh
> > > >> >
> > > >> >
> > > >> >
> > > >> > computing statistics for each annotation in ../label/lh.aparc.annot.
> > > >> >
> > > >> > reading volume .mgz...
> > > >> >
> > > >> > zcat:
> > > >> /home/samba/user/douiri/freesurfer/subjects/01_00/scripts/.mgz.gz:
> > > >> No
> > > >> > such file or directory
> > > >> >
> > > >> > mghRead(/home/samba/user/douiri/freesurfer/subjects/01_00/scripts/.mgz,
> > > >> -1):
> > > >> > read error
> > > >> >
> > > >> > mris_anatomical_stats: could not read input volume .mgz
> > > >> >
> > > >> > INFO: assuming MGZ format for volumes.
> > > >> >
> > > >> > Linux img-179 2.6.16.22 #2 SMP Mon Jun 26 15:49:31 BST 2006 i686
> > > >> unknown
> > > >> > unknown GNU/Linux
> > > >> >
> > > >> >
> > > >> >
> > > >> > recon-all exited with ERRORS at Tue Aug 15 20:52:49 BST 2006
> > > >> >
> > > >> >
> > > >> >
> > > >> >
> > > >> >
> > > >> > Thanks
> > > >> >
> > > >> > A
> > > >> >
> > > >> >
> > > >> _______________________________________________
> > > >> Freesurfer mailing list
> > > >> Freesurfer@nmr.mgh.harvard.edu
> > > >> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> > > >> _______________________________________________
> > > >> Freesurfer mailing list
> > > >> Freesurfer@nmr.mgh.harvard.edu
> > > >> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> > > >
> > > > _______________________________________________
> > > > Freesurfer mailing list
> > > > Freesurfer@nmr.mgh.harvard.edu
> > > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> > > >
> > > >
> > > >
> > 
> > 

_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Reply via email to