You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A newline appears to have been removed from MRISwriteTriangularSurface at some point, and this breaks downstream readers when generating things with latest FreeSurfer.
On Freesurfer 6 produces a file fsaverage_brain that starts with:
ÿÿþcreated by larsoner on Tue Aug 20 13:55:57 2019
^@^@(^B^@^@P^@À^K^[SÁ<89>8:Bªñ»A<98>ü<98>...
And on latest Freesurfer dev starts with:
ÿÿþcreated by larsoner on Tue Aug 20 13:59:19 2019
^@^@(^B^@^@P^@À^DìðÁ<8c>ËúB¨<93><A<9a>;˾¾^TB^ZÓnB<85>äÄÁ<9a>^VRB^X·WA<9c>...
There is a newline missing, which is problematic because downstream readers such as nibabel assume the procedure for reading should be the following:
Read magic
Read stamp
dump the next line
Read dimensionality
Read data
Because of the missing newline, on latest freesurfer the fobj.readline() dump-the-next-line step must be removed in order for the file to be read properly. This behavior should probably be reverted (?) so that downstream readers don't suffer from this problem.
I assume this change is buried somewhere in the history of MRISwriteTriangularSurface, but don't actually know:
You're right - the extra newline was accidentally removed as a result of the c++ refactor, and this change only got caught by external surface readers. The newline has been re-added as of 2aae19d, and any previously "broken" surface files can be correctly resaved with an updated mris_convert (or one from a previous stable release).
A newline appears to have been removed from
MRISwriteTriangularSurface
at some point, and this breaks downstream readers when generating things with latestFreeSurfer
.For example, the output of this command:
On Freesurfer 6 produces a file
fsaverage_brain
that starts with:And on latest Freesurfer dev starts with:
There is a newline missing, which is problematic because downstream readers such as
nibabel
assume the procedure for reading should be the following:Because of the missing newline, on latest
freesurfer
thefobj.readline()
dump-the-next-line step must be removed in order for the file to be read properly. This behavior should probably be reverted (?) so that downstream readers don't suffer from this problem.I assume this change is buried somewhere in the history of
MRISwriteTriangularSurface
, but don't actually know:https://github.com/freesurfer/freesurfer/blame/5e5b72f4871bfffe0246aed964a588b97ace65fc/utils/mrisurf_io.cpp#L5837-L5840
My best guess is that in the old code (about a year ago when it was in mrisurf.c?), the
current_date_time()
maybe had a newline on it?This would have caused two newlines to be written before the data. But this is just speculation on my part!
The text was updated successfully, but these errors were encountered: