Re: [Freesurfer] recon-all bug
So the problem is that there are spaces in the path? That will probably cause a lot of FS to fail On 4/2/2021 11:30 PM, zalewk wrote: External Email - Use Caution Hi freesurfer team, I've tried running recon-all as mentioned before with the -xf flag under different conditions. As far as I can tell, any line using the UpdateNeeded function. e.g.: "set ud = `UpdateNeeded $thickness $pial $white`" fails with the following if statement because the variable $ud includes paths as strings in it instead of a 0/1 integer. Setting it to a 1 or 0 beforehand also seems to solve the problem. The function UpdateNeeded only seems to return an integer as an exit status, so I'm not sure why there are path strings in it causing it to fail. If I print out the $ud variable before it fails and the result is: "/subjectDirectory/subjectID_FREESURFER/mri mri mri_FREESURFER /subjectDirectory/subjectID_FREESURFER/mri/mri_FREESURFER/stats 1" It returns the exit status of 1 preceded by the path of the subject's mri directory, just "mri", "mri_FREESURFER" and the subject's stats directory (all subjects in this particular study have the suffix "_FREESURFER"). It prints this out these strings no matter the variables as .mgz file names, or number of variables passed to the UpdateNeeded function. I still don't have a clue what would cause this behavior. The UpdateNeeded function seems to work fine and as intended as far as I can tell, so I still don't know why these paths/strings are being added and causing it to crash. Best, Kody Zalewski Message: 3 Date: Fri, 02 Apr 2021 03:49:02 +0200 From: fsbuild Subject: Re: [Freesurfer] recon-all bug To: freesurfer@nmr.mgh.harvard.edu Cc: cm...@neurosurgery.washington.edu Message-ID: <1617328142.6066780ef2...@trashmail.com> Content-Type: text/plain; charset="utf-8" External Email - Use Caution Hello Kody, One thing you could try to get more information printed about what is going on is to edit the very first line in the recon-all script to be: #! /bin/tcsh -xf ? instead of #! /bin/tcsh -f Adding the x option will echo each line in the script as it?s run with the variable values expanded, and seeing that output could help with debugging. - R. On Apr 1, 2021, at 20:29, zalewk zal...@uw.edu wrote:External Email - Use CautionHi Freesurfer team,My lab recently switched over from FS6 to FS7 and I think I've encountered a bug with recon-all..I'm running subjects stepwise and editing them, running recon-all with the -autorecon2 and -autorecon3 flags initially are no problem, they run fine. Trying to re-run them or use the -autorecon2-wm, -autorecon-pial etc. flags lead to crashing at certain parts of the program. The error message I get is "if: expression syntax". Digging into the code, it seems to crash when it hits a line of code "if($ud || $ForceUpdate)". The syntax superficially looks right (I don't know tcsh), checking the variables it seems like $ForceUpdate is never set, but removing it from recon-all doesn't fix the problem.It seems the $ud variable is for checking if updates are ! needed fo r a set of volumes passed to the program. I don't know why that would be a problematic argument, removing that part seems to fix it, but this also seems like an important variable and I don't know enough about tcsh to understand why it works after removing it. Can one of the folks who wrote the recon-all script help me out? I'm running the commands step-wise as a work-around, but that is much less convenient.Best,Kody Zalewski___Freesurfer mailing listfreesur...@nmr.mgh.harvard.eduhttps://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
Re: [Freesurfer] recon-all bug
Run it with -debug as the first option, capture the output, and send it to us. On 4/1/2021 8:29 PM, zalewk wrote: External Email - Use Caution Hi Freesurfer team, My lab recently switched over from FS6 to FS7 and I think I've encountered a bug with recon-all. I'm running subjects stepwise and editing them, running recon-all with the -autorecon2 and -autorecon3 flags initially are no problem, they run fine. Trying to re-run them or use the -autorecon2-wm, -autorecon-pial etc. flags lead to crashing at certain parts of the program. The error message I get is "if: expression syntax". Digging into the code, it seems to crash when it hits a line of code "if($ud || $ForceUpdate)". The syntax superficially looks right (I don't know tcsh), checking the variables it seems like $ForceUpdate is never set, but removing it from recon-all doesn't fix the problem. It seems the $ud variable is for checking if updates are needed for a set of volumes passed to the program. I don't know why that would be a problematic argument, removing that part seems to fix it, but this also seems like an important variable and I don't know enough about tcsh to understand why it works after removing it. Can one of the folks who wrote the recon-all script help me out? I'm running the commands step-wise as a work-around, but that is much less convenient. Best, Kody Zalewski ___ 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
Re: [Freesurfer] recon-all bug
External Email - Use Caution Hi freesurfer team, I've tried running recon-all as mentioned before with the -xf flag under different conditions. As far as I can tell, any line using the UpdateNeeded function. e.g.: "set ud = `UpdateNeeded $thickness $pial $white`" fails with the following if statement because the variable $ud includes paths as strings in it instead of a 0/1 integer. Setting it to a 1 or 0 beforehand also seems to solve the problem. The function UpdateNeeded only seems to return an integer as an exit status, so I'm not sure why there are path strings in it causing it to fail. If I print out the $ud variable before it fails and the result is: "/subjectDirectory/subjectID_FREESURFER/mri mri mri_FREESURFER /subjectDirectory/subjectID_FREESURFER/mri/mri_FREESURFER/stats 1" It returns the exit status of 1 preceded by the path of the subject's mri directory, just "mri", "mri_FREESURFER" and the subject's stats directory (all subjects in this particular study have the suffix "_FREESURFER"). It prints this out these strings no matter the variables as .mgz file names, or number of variables passed to the UpdateNeeded function. I still don't have a clue what would cause this behavior. The UpdateNeeded function seems to work fine and as intended as far as I can tell, so I still don't know why these paths/strings are being added and causing it to crash. Best, Kody Zalewski Message: 3 Date: Fri, 02 Apr 2021 03:49:02 +0200 From: fsbuild Subject: Re: [Freesurfer] recon-all bug To: freesurfer@nmr.mgh.harvard.edu Cc: cm...@neurosurgery.washington.edu Message-ID: <1617328142.6066780ef2...@trashmail.com> Content-Type: text/plain; charset="utf-8" External Email - Use Caution Hello Kody, One thing you could try to get more information printed about what is going on is to edit the very first line in the recon-all script to be: #! /bin/tcsh -xf ? instead of #! /bin/tcsh -f Adding the x option will echo each line in the script as it?s run with the variable values expanded, and seeing that output could help with debugging. - R. On Apr 1, 2021, at 20:29, zalewk zal...@uw.edu wrote:External Email - Use CautionHi Freesurfer team,My lab recently switched over from FS6 to FS7 and I think I've encountered a bug with recon-all..I'm running subjects stepwise and editing them, running recon-all with the -autorecon2 and -autorecon3 flags initially are no problem, they run fine. Trying to re-run them or use the -autorecon2-wm, -autorecon-pial etc. flags lead to crashing at certain parts of the program. The error message I get is "if: expression syntax". Digging into the code, it seems to crash when it hits a line of code "if($ud || $ForceUpdate)". The syntax superficially looks right (I don't know tcsh), checking the variables it seems like $ForceUpdate is never set, but removing it from recon-all doesn't fix the problem.It seems the $ud variable is for checking if updates are ! needed fo r a set of volumes passed to the program. I don't know why that would be a problematic argument, removing that part seems to fix it, but this also seems like an important variable and I don't know enough about tcsh to understand why it works after removing it. Can one of the folks who wrote the recon-all script help me out? I'm running the commands step-wise as a work-around, but that is much less convenient.Best,Kody Zalewski___Freesurfer mailing listfreesur...@nmr.mgh.harvard.eduhttps://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
Re: [Freesurfer] recon-all bug
External Email - Use Caution Hello Kody, One thing you could try to get more information printed about what is going on is to edit the very first line in the recon-all script to be: #! /bin/tcsh -xf … instead of #! /bin/tcsh -f Adding the x option will echo each line in the script as it’s run with the variable values expanded, and seeing that output could help with debugging. - R. On Apr 1, 2021, at 20:29, zalewk zal...@uw.edu wrote:External Email - Use CautionHi Freesurfer team,My lab recently switched over from FS6 to FS7 and I think I've encountered a bug with recon-all..I'm running subjects stepwise and editing them, running recon-all with the -autorecon2 and -autorecon3 flags initially are no problem, they run fine. Trying to re-run them or use the -autorecon2-wm, -autorecon-pial etc. flags lead to crashing at certain parts of the program. The error message I get is "if: expression syntax". Digging into the code, it seems to crash when it hits a line of code "if($ud || $ForceUpdate)". The syntax superficially looks right (I don't know tcsh), checking the variables it seems like $ForceUpdate is never set, but removing it from recon-all doesn't fix the problem.It seems the $ud variable is for checking if updates are needed for a set of volumes passed to the program. I don't know why that would be a problematic argument, removing that part seems to fix it, but this also seems like an important variable and I don't know enough about tcsh to understand why it works after removing it. Can one of the folks who wrote the recon-all script help me out? I'm running the commands step-wise as a work-around, but that is much less convenient.Best,Kody Zalewski___Freesurfer mailing listfreesur...@nmr.mgh.harvard.eduhttps://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] recon-all bug
External Email - Use Caution Hi Freesurfer team, My lab recently switched over from FS6 to FS7 and I think I've encountered a bug with recon-all. I'm running subjects stepwise and editing them, running recon-all with the -autorecon2 and -autorecon3 flags initially are no problem, they run fine. Trying to re-run them or use the -autorecon2-wm, -autorecon-pial etc. flags lead to crashing at certain parts of the program. The error message I get is "if: expression syntax". Digging into the code, it seems to crash when it hits a line of code "if($ud || $ForceUpdate)". The syntax superficially looks right (I don't know tcsh), checking the variables it seems like $ForceUpdate is never set, but removing it from recon-all doesn't fix the problem. It seems the $ud variable is for checking if updates are needed for a set of volumes passed to the program. I don't know why that would be a problematic argument, removing that part seems to fix it, but this also seems like an important variable and I don't know enough about tcsh to understand why it works after removing it. Can one of the folks who wrote the recon-all script help me out? I'm running the commands step-wise as a work-around, but that is much less convenient. Best, Kody Zalewski ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer