[FieldTrip] Help Running ft_postfreesurferscript.sh

Michael Houston m.jameshouston81 at gmail.com
Mon May 19 01:23:54 CEST 2025


Hi Jan-Mathijs, thanks for checking this. I've looked into the script and
realized that, for the issue presented above, the wb_command function was
expecting the file called "single_subj.L.sulc.native.shape.gii" but it
seems an earlier wb function saved the expected file as
"lh.single_subj.L.sulc.native.shape.gii". After some trial and error I am
able to extract and display the decimated cortical sheets and their
corresponding atlases correctly with Fieldtrip visualization functions.
Thanks for your help!

Thanks,
Michael


On Thu, May 15, 2025 at 9:14 AM Schoffelen, J.M. (Jan Mathijs) via
fieldtrip <fieldtrip at science.ru.nl> wrote:

> Hi Michael,
>
> The error suggests that an expected file is missing. Could it be that
> freesurfer produced incomplete output? (in other words: do you get an error
> only for this particular subject?)
> If you don’t need the sulc/curv/thickness information, you can also try
> and bypass this error by commenting out the respective lines of code in the
> bash-script (including the lines that rely on using the newly create .gii
> files of those metrics).
>
> Best wishes,
> Jan-Mathijs
>
> On 8 May 2025, at 15:37, Michael Houston via fieldtrip <
> fieldtrip at science.ru.nl> wrote:
>
> Hi, everyone! I am trying to create a cortical sheet source model from the
> standard colin27 brain with accompanying DKT atlas for EEG source
> reconstruction (single_subj.nii in Fieldtrip template directory). After
> doing recon-all in FreeSurfer, the resulting meshes are far too large ~160k
> vertices per hemisphere which is taking too long to run the source analysis
> on. I followed the instructions according to this tutorial (
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.fieldtriptoolbox.org%2Ftutorial%2Fsource%2Fsourcemodel%2F&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cc0562f63b6cb41d679fe08dd96631b53%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638832074728909298%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=BfctUY1cmdsAn9WNb7maz%2Fqd%2Bp7gMxkfpe4Phl%2F1nUU%3D&reserved=0
> <https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.fieldtriptoolbox.org%2Ftutorial%2Fsource%2Fsourcemodel%2F&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cc0562f63b6cb41d679fe08dd96631b53%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638832074728937648%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=vrt7huJWbXsblV%2BBDSoxcGch7J7rx3y1dn7pPNBpa0Y%3D&reserved=0>)
> and set up the HCP-Workbench and copied the requested directory contents to
> a common folder to use ft_postfreesurferscript.sh to make the lower
> resolution cortical meshes.
>
> While I can get the script to run, I am facing the output and error copied
> below. If there is any other information I should provide please let me
> know. I am confused about this output because it looks like the error file
> is one that should be created by the script however it is not found. I
> would greatly appreciate any insight on how to fix this.:
>
> Command
> --------------
> /mnt/c/Users/mjame/Documents/MATLAB/fieldtrip-20240504/bin/ft_postfreesurferscript.sh
> /usr/local/freesurfer/7.4.1/subjects single_subj
> /usr/local/freesurfer/7.4.1/subjects/workbench_freesurfer
>
> Output & Error
> --------------------
> START: FS2CaretConvertRegisterNonlinear
> Saving
> /usr/local/freesurfer/7.4.1/subjects/single_subj/workbench/single_subj.L.white.native.surf.gii
> as a surface in TKREGISTER space
> Saving
> /usr/local/freesurfer/7.4.1/subjects/single_subj/workbench/single_subj.L.pial.native.surf.gii
> as a surface in TKREGISTER space
> Saving
> /usr/local/freesurfer/7.4.1/subjects/single_subj/workbench/single_subj.L.sphere.reg.native.surf.gii
> as a surface in TKREGISTER space
> Saving
> /usr/local/freesurfer/7.4.1/subjects/single_subj/workbench/single_subj.L.sphere.native.surf.gii
> as a surface in TKREGISTER space
>
> While running:
> wb_command -set-structure
> /usr/local/freesurfer/7.4.1/subjects/single_subj/workbench/single_subj.L.sulc.native.shape.gii
> CORTEX_LEFT
>
> ERROR: NAME OF FILE: single_subj.L.sulc.native.shape.gii
> PATH TO FILE: /usr/local/freesurfer/7.4.1/subjects/single_subj/workbench
>
> File does not exist.
>
> Thanks,
> Michael
> _______________________________________________
> fieldtrip mailing list
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cc0562f63b6cb41d679fe08dd96631b53%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638832074728953135%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=dm4xNyMTT%2Fo%2FlPo%2BEYFbJMH15T%2B7%2FJK0NgdyIfvf0yo%3D&reserved=0
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cc0562f63b6cb41d679fe08dd96631b53%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638832074728966331%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=leXIIqKTo3oxFLhbD5CopS%2FT4LhJaj94zUOLhG%2BMYrs%3D&reserved=0
>
>
> _______________________________________________
> fieldtrip mailing list
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cc0562f63b6cb41d679fe08dd96631b53%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638832074728980420%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=WDqn0dlOBwmul4tNEmWzfrEt%2BLNtarE7QKzc3i794uA%3D&reserved=0
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cc0562f63b6cb41d679fe08dd96631b53%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638832074728993147%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=ylEAD3cD4isBeQGTlTJ%2BMLi1LhIwhx5n0YKA2oOF35U%3D&reserved=0
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20250518/d9d3a1ff/attachment.htm>


More information about the fieldtrip mailing list