Closed feilong closed 3 weeks ago
Attention: Patch coverage is 89.92629%
with 41 lines
in your changes missing coverage. Please review.
Project coverage is 94.39%. Comparing base (
76832f5
) to head (f34d609
). Report is 4 commits behind head on master.:exclamation: Current head f34d609 differs from pull request most recent head f69faaf
Please upload reports for the commit f69faaf to get more accurate results.
Files | Patch % | Lines |
---|---|---|
nitransforms/surface.py | 89.37% | 26 Missing and 13 partials :warning: |
nitransforms/base.py | 94.87% | 1 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
From the documentation for wb_command -surface-sphere-project-unproject
:
A surface registration starts with an input sphere, and moves its vertices around on the sphere until it matches the template data. This means that the registration deformation is actually represented as the difference between two separate files - the starting sphere, and the registered sphere. Since the starting sphere of the registration may not have vertex correspondence to any other sphere (often, it is a native sphere), it can be inconvenient to manipulate or compare these deformations across subjects, etc.
Based on that description, I think the next class we need is one that will represent registration deformation and contains the original sphere and the deformation sphere (in other words, mea culpa, @oesteban was right). I'm not 100% certain it will be useful for anything (maybe project-unproject?), but it is the representation of the deformation.
Edit: Ok actually the Surface Coordinate Transform class will already represent this deformation.
As I mentioned, I totally see why you wanted to focus on the interpolation matrix. In practical terms, it's all you care for.
But to calculate it, in one way or another you need to formalize the transform ;)
@oesteban Happy to talk about it more, but I think the SurfaceCoordinateTransform is the formalization of the transform. Isn't it? The deformation itself isn't useful and transforming data by subtracting the coordinate would less accurate than looking up the new coordinates by index.
@oesteban Happy to talk about it more, but I think the SurfaceCoordinateTransform is the formalization of the transform. Isn't it? The deformation itself isn't useful and transforming data by subtracting the coordinate would less accurate than looking up the new coordinates by index.
Yup, that's correct.
In terms of use cases for surface transformations, here's what I can think of:
1) Taking some metric defined on the cortical surface in subject T1w space and determining what the value of that metric would be for every vertex in a reference space (wb_command -metric-resample
).
2) Taking labels defined in a reference space and determining which vertices in subject space those labels should be applied to (wb_command -label-resample
).
3) Creating a surface in which every vertex corresponds to a vertex from a reference surface, but with coordinates defined in the subject's T1w space (wb_command -surface-sphere-project-unproject
).
We can kinda do 1 and 2 with the resampling method we've got now (though we've only implemented barycentric for this and they recommend adap_bary_area). I still have trouble wrapping my head around how surface-sphere-project-unproject
works, but I feel like that's the next use case to try implementing to confirm that this representation of surface transformation is sufficient.
Hi @Shotgunosine, I think surface-sphere-project-unproject
is closely related to the transform @oesteban wants.
It defines the warp using two spheres (e.g., sphere
and sphere.reg
). If a new sphere X
is aligned to one of them (say, sphere.reg
), we can use the barycentric weights (between sphere.reg
and X
) and the coordinates of sphere
to warp X
. That is, computing the new coordinates of X
when it's aligned to sphere
space. Conceptually, it's a diffeomorphic transform defined by the two spheres.
In practice, this is hardly used. The only use case I know is warping between fsaverage and fs_LR spheres. That being said, it's good to have it for completeness.
Transforms data between different surface spaces.
Dylan is working on algorithms to derive the transforms.