Workbench Command is a set of command-line tools that can be used to perform simple and complex operations within Connectome Workbench.
COPY REGISTRATION DEFORMATIONS TO DIFFERENT SPHERE
wb_command -surface-sphere-project-unproject
<sphere-in> - a sphere with the desired output mesh, to apply the
deformations to
<sphere-project-to> - <sphere-unproject-from>, but 'before' the
deformation that is desired, i.e., is aligned with <sphere-in>
<sphere-unproject-from> - <sphere-project-to>, deformed to the desired
output registration
<sphere-out> - output - <sphere-in> after the deformations are applied
Background: A surface registration starts with an input sphere and data,
and moves the vertices around on the sphere until the new spherical
location of the data matches the template data (side note: this does not
deform the anatomical position of any data, nor does surface-based
resampling, as long as the same pair of spheres is used to resample both
the surface and metric files). This means that the spherical
deformations produced by the registration are 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-mesh sphere), it can be inconvenient to manipulate or compare
these spherical deformations across subjects, etc.
The purpose of this command is to be able to apply these deformations
onto a new sphere of the user's choice, to make it easier to compare or
manipulate them. Common uses are to concatenate two successive separate
registrations (e.g. Human to Chimpanzee, and then Chimpanzee to Macaque)
or inversion (for dedrifting or symmetric registration schemes).
<sphere-in> must already be considered to be in alignment with one of the
two ends of the registration (if your registration is Human to
Chimpanzee, <sphere-in> must be in register with either Human or
Chimpanzee). The 'project-to' sphere must be the side of the
registration that is aligned with <sphere-in> (if your registration is
Human to Chimpanzee, and <sphere-in> is aligned with Human, then
'project-to' should be the original Human sphere). The 'unproject-from'
sphere must be the remaining sphere of the registration pair (original vs
deformed/registered). The output is as if you had run the same
registration with <sphere-in> as the starting sphere, in the direction of
deforming the 'project-to' sphere to create the 'unproject-from' sphere.
Note that this command cannot check for you what spheres are aligned with
other spheres, and using the wrong spheres or in the incorrect order will
not necessarily cause an error message. In some cases, it may be useful
to use a new, arbitrary sphere as the input, which can be created with
the -surface-create-sphere command.
Example 1: You have a Human to Chimpanzee registration, and a Chimpanzee
to Macaque registration, and want to combine them. If you use the Human
sphere registered to Chimpanzee as sphere-in, the Chimpanzee standard
sphere as project-to, and the Chimpanzee sphere registered to Macaque as
unproject-from, the output will be the Human sphere in register with the
Macaque.
Example 2: You have a Human to Chimpanzee registration, but what you
really want is the inverse, that is, the sphere as if you had run the
registration from Chimpanzee to Human. If you use the Chimpanzee
standard sphere as sphere-in, the Human sphere registered to Chimpanzee
as project-to, and the standard Human sphere as unproject-from, the
output will be the Chimpanzee sphere in register with the Human.
Technical details: Each vertex of <sphere-in> is projected to a triangle
of <sphere-project-to>, and its new position is determined by the
position of the corresponding triangle in <sphere-unproject-from>. The
output is a sphere with the topology of <sphere-in>, but coordinates
shifted by the deformation from <sphere-project-to> to
<sphere-unproject-from>. <sphere-project-to> and <sphere-unproject-from>
must have the same topology as each other, but <sphere-in> may have any
topology.