CorticalParcels.BilateralParcellation
— MethodBilateralParcellation{T}(surface)
Create an empty BilateralParcellation
from surface::CorticalSurface
.
CorticalParcels.BilateralParcellation
— MethodBilateralParcellation{T}(surface, x)
Create a BilateralParcellation
from a single-column Matrix
x
.
CorticalParcels.BilateralParcellation
— MethodBilateralParcellation{T}(surface, x)
Create a BilateralParcellation
from a Vector
x
, the length of which should match the size of the surface::CorticalSurface
being supplied. The distinct elements of that Vector
will become the Parcels
of the resulting struct. Parcels will be keyed by IDs of type T
; therefore the eltype of the Vector
you supply must be coercable to T
.
CorticalParcels.BilateralParcellation
— MethodBilateralParcellation{T}(surface, cifti)
Create a BilateralParcellation
from surface::CorticalSurface
, with parcels initialized by the values given from a CiftiStruct (see CIFTI.jl)
CorticalParcels.HemisphericParcellation
— MethodHemisphericParcellation{T}(surface::Hemisphere)
Create an empty HemisphericParcellation
.
CorticalParcels.HemisphericParcellation
— MethodHemisphericParcellation{T}(surface, x)
Create a HemisphericParcellation
from a single-column Matrix
x
.
CorticalParcels.HemisphericParcellation
— MethodHemisphericParcellation{T}(surface, x)
Create a HemisphericParcellation
from a Vector
x
, the length of which should match the size of the surface::Hemisphere
being supplied. The distinct elements of that Vector
will become the Parcels
of the resulting struct. Parcels will be keyed by IDs of type T
; therefore the eltype of the Vector
you supply must be coercable to T
.
CorticalParcels.Parcel
— MethodParcel(surface, coords, tree)
Given a Matrix
of arbitrary x, y, z coordinates and a KDTree
representing the positions of defined cortical vertex indices, make a Parcel
by mapping those coordinates to the set of defined indices via nearest neighbor search.
CorticalParcels.Parcel
— Method Parcel(surface, verts)
Make a Parcel
, given a surface::Hemisphere
its vertex indices.
CorticalParcels.Parcel
— MethodParcel(surface)
Make an empty Parcel
where surface::Hemisphere
dictates the length of the representational space.
CorticalParcels.Parcel
— MethodParcel(p)
Create a new Parcel
that's a copy of another one p
.
Base.append!
— Methodappend!(p, v)
Add vertex v::Int
to the p
's membership vector.
Base.deepcopy
— Methoddeepcopy(p)
Make a new Parcel
containing a deepcopy
of original parcel p
's membership
vector. Note however that the surface remains just a reference and is not itself copied, since it may be a large object.
Base.deepcopy
— Methoddeepcopy(px)
Make a new parcellation containing a deepcopy
of all parcels from px
. Note however that, as with deepcopy(p::Parcel)
, the surface remains just a reference and is not itself copied, since it may be a large object.
Base.delete!
— Methoddelete!(px, k)
Delete Parcel
with ID k
from a Parcellation
.
Base.getindex
— Methodgetindex(px, k)
Access a single Parcel within a Parcellation via its key of type T
".
Base.haskey
— Method haskey(px, k)
Check whether Parcellation{T} px
contains a parcel with key value k
.
Base.keys
— Methodkeys(px)
Get the IDs of all Parcel
s within a Parcellation
.
Base.length
— Methodlength(px)
Get the number of vertices comprising the representation space of a Parcellation
.
Base.length
— Methodlength(p)
Get the length of the representational space in which a Parcel
is located.
Base.merge!
— Methodmerge!(p1, p2, A)
Merge two Parcel
s by moving the member vertices of p2
to p1
.
Base.merge!
— Methodmerge!(px, k1, k2, A)
Given a Parcellation{T}
and two keys of type T
, merge the two Parcel
s denoted by those keys and delete the latter one from the dictionary.
Base.resize!
— Method resize!(p, desired_size, A, neighbors)
Resize a Parcel
p
, guided by an adjacency matrix and an adjacency list, by repeated dilation or erosion until p
reaches desired_size
.
Base.resize!
— Method resize!(p, desired_size)
Resize a Parcel
p
, using adjacency information from its surface
field.
Base.size
— Methodsize(px)
Get the number of Parcels comprising a Parcellation.
Base.size
— Methodsize(p)
Get the size (number of non-zero vertices) of a Parcel
".
Base.split
— Method split(p, v)
Remove vertices v
from a graph representation of a Parcel
, and return a new set of Parcel
s: one for each connected component remaining.
Base.values
— Methodvalues(px)
Access the Parcel
s in a Parcellation
.
Base.vec
— Methodvec(px)
Convert a BilateralParcellation
from its internal Dict
-based representation into a Vector{T}
. T
must have a zeros(T, ...)
method. Warning: this is not a sensible representation in the event that any Parcel
s overlap.
Base.vec
— Methodvec(px)
Convert a HemisphericParcellation
from its internal Dict
-based representation into a Vector{T}
. T
must have a zeros(T, ...)
method. Warning: this is not a sensible representation in the event that any Parcel
s overlap.
CorticalParcels.borders
— Method borders(p)
Get a BitVector
of the just the vertices of Parcel p
that lie on its outermost edge.
CorticalParcels.centroid
— Methodcentroid(p, distances)
Find the centroid of a parcel (the vertex that has the least summed distance to all other vertices in the parcel). distances
is expected to be a square distance matrix of dimensions (length(p), length(p)).
CorticalParcels.clear!
— Methodclear!(p)
Zero-out all membership vertices of a Parcel
.
CorticalParcels.close!
— Methodclose!(p, neighbors)
Given a Parcel
p
and an adjacency list neighbors
, perform a morphological closing to fill in gaps, if any, by finding vertices in p
where all of its neighbors but one belong to p
. Note: for performance reasons, this may not be technically quite the same as a true closing operation, erode!(dilate!(p))
.
CorticalParcels.complement
— Methodcomplement(p1, p2)
Compute the number of member vertices in Parcel
p1
not shared by those of p2
.
CorticalParcels.cut
— Methodcut(p, A)
Cut articulation point(s), if any, from a graph representation of a Parcel
, and return a new set of Parcel
s: one for each connected component remaining after the vertex cut.
CorticalParcels.density
— Methoddensity(px)
Get the proportion of assigned parcel vertices of a parcellation relative to the total number of vertices in its surface representation.
CorticalParcels.density
— Methoddensity(p)
Get the proportion of member vertices in a Parcel
relative to the length of its space.
CorticalParcels.dilate!
— Methoddilate!(p, A; limit = nothing)
Perform a single pass of dilation on Parcel
p
, guided by adjacency matrix A
; optionally specify a limit::Int
on the number of new vertices that can be added.
CorticalParcels.distance
— Function distance(p1, p2; method = CentroidToCentroid())
Find the distance between Parcel
s p1
and p2
using method
(one of CentroidToCentroid()
or ClosestVertices
). This method call will expect to find a distance matrix :distances
belonging to the first parcel's SurfaceSpace
struct
CorticalParcels.distance
— Method distance(p1, p2, distances; method = CentroidToCentroid())
Find the distance between Parcel
s p1
and p2
according to distance matrix distances
, using method
(one of CentroidToCentroid()
or ClosestVertices
)
CorticalParcels.erode!
— Methoderode!(p, neighbors; limit = nothing)
Perform a single pass of erosion on Parcel
p
, guided by adjacency list neighbors
; optionally specify a limit::Int
on the number of vertices that you want to remove.
CorticalParcels.interstices
— Methodinterstices(px, A)
Iterate through a parcellation and find, for each pair of neighboring Parcel
s separated by a 1-vertex-wide gap, the vertices in that interstitial region.
CorticalParcels.membership
— Methodmembership(p)
Get a BitVector
denoting vertexwise parcel membership
CorticalParcels.nnz
— Methodnnz(px)
Get the number of vertices within a parcellation that are assigned to at least one Parcel
.
CorticalParcels.overlap
— Methodoverlap(p1, p2)
Compute the number of member vertices shared between two Parcel
s p1
, p2
.
CorticalParcels.unassigned
— Methodunassigned(px)
Get a BitVector
identifying unassigned vertices (1
) in a parcellation.
CorticalSurfaces.vertices
— Methodvertices(p)
Get the vertex indices belonging to a Parcel
. Indices will be numbered inclusive of medial wall by default.