Replies: 1 comment
-
The reason is that those were the only types of data anybody had available (or found to test with) when the feature was added. As the warning says, You're definitely welcome to propose a patch. I think just permitting |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
Does anyone know why
nibabel.freesurfer.io.read_geometry
only allows either[20]
or[2, 0, 20]
as the first entry in the metadata section of a FreeSurfer surface file (referred to ashead
in the metadata dict)? The reason I am asking is that I am interested in being able to tell whether a surface is stored in surface RAS (tkregister space) or scanner RAS. Currently, it seems thatread_geometry
only supports reading the metadata when a surface is in surface RAS.To test this, I tried to convert a surface file (created during a
recon-all
run) to scanner RAS like thismris_convert --to-scanner lh.white lh.white.scanner
nibabel reads the metadata of
lh.white
just fine, however, forlh.white.scanner
I get.../nibabel/freesurfer/io.py:62: UserWarning: Unknown extension code. warnings.warn('Unknown extension code.') .../nibabel/freesurfer/io.py:188: UserWarning: No volume information contained in the file warnings.warn('No volume information contained in the file')
It turns out that it reads the
head
property just fine in both cases. Forlh.white
it is[2, 0, 20]
but forlh.white.scanner
it is[2, 1, 20]
which, from looking into the freesurfer code (e.g., here https://github.com/freesurfer/freesurfer/blob/920f33cade45b901f702192ace64b37ef2c4b3e1/utils/mrisurf_io.cpp#L5348), is what I would expect as it seems that these three numbers signify[TAG_OLD_USEREALRAS (= 2), value associated with this tag (= 0 or 1), TAG_OLD_SURF_GEOM (= 20)]
. From the FS code, it is difficult to tell whether this is always the pattern or not but I was thinking that it might make sense to add[2, 1, 20]
as an allowed value ofhead
metadata - and perhaps even add it as an entry in the returned metadata dict (e.g.,realras = True/False
). Any thoughts? I can do a PR if needed.Beta Was this translation helpful? Give feedback.
All reactions