`CorticalParcels.BilateralParcellation`

— Method`BilateralParcellation{T}(surface)`

Create an empty `BilateralParcellation`

from `surface::CorticalSurface`

.

`CorticalParcels.BilateralParcellation`

— Method`BilateralParcellation{T}(surface, x)`

Create a `BilateralParcellation`

from a single-column `Matrix`

`x`

.

`CorticalParcels.BilateralParcellation`

— Method`BilateralParcellation{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`

— Method`BilateralParcellation{T}(surface, cifti)`

Create a `BilateralParcellation`

from `surface::CorticalSurface`

, with parcels initialized by the values given from a CiftiStruct (see CIFTI.jl)

`CorticalParcels.HemisphericParcellation`

— Method`HemisphericParcellation{T}(surface::Hemisphere)`

Create an empty `HemisphericParcellation`

.

`CorticalParcels.HemisphericParcellation`

— Method`HemisphericParcellation{T}(surface, x)`

Create a `HemisphericParcellation`

from a single-column `Matrix`

`x`

.

`CorticalParcels.HemisphericParcellation`

— Method`HemisphericParcellation{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`

— Method`Parcel(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`

— Method`Parcel(surface)`

Make an empty `Parcel`

where `surface::Hemisphere`

dictates the length of the representational space.

`CorticalParcels.Parcel`

— Method`Parcel(p)`

Create a new `Parcel`

that's a copy of another one `p`

.

`Base.append!`

— Method`append!(p, v)`

Add vertex `v::Int`

to the `p`

's membership vector.

`Base.deepcopy`

— Method`deepcopy(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`

— Method`deepcopy(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!`

— Method`delete!(px, k)`

Delete `Parcel`

with ID `k`

from a `Parcellation`

.

`Base.getindex`

— Method`getindex(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`

— Method`keys(px)`

Get the IDs of all `Parcel`

s within a `Parcellation`

.

`Base.length`

— Method`length(px)`

Get the number of vertices comprising the representation space of a `Parcellation`

.

`Base.length`

— Method`length(p)`

Get the length of the representational space in which a `Parcel`

is located.

`Base.merge!`

— Method`merge!(p1, p2, A)`

Merge two `Parcel`

s by moving the member vertices of `p2`

to `p1`

.

`Base.merge!`

— Method`merge!(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`

— Method`size(px)`

Get the number of Parcels comprising a Parcellation.

`Base.size`

— Method`size(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`

— Method`values(px)`

Access the `Parcel`

s in a `Parcellation`

.

`Base.vec`

— Method`vec(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`

— Method`vec(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`

— Method`centroid(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!`

— Method`clear!(p)`

Zero-out all membership vertices of a `Parcel`

.

`CorticalParcels.close!`

— Method`close!(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`

— Method`complement(p1, p2)`

Compute the number of member vertices in `Parcel`

`p1`

not shared by those of `p2`

.

`CorticalParcels.cut`

— Method`cut(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`

— Method`density(px)`

Get the proportion of assigned parcel vertices of a parcellation relative to the total number of vertices in its surface representation.

`CorticalParcels.density`

— Method`density(p)`

Get the proportion of member vertices in a `Parcel`

relative to the length of its space.

`CorticalParcels.dilate!`

— Method`dilate!(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!`

— Method`erode!(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`

— Method`interstices(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`

— Method`membership(p)`

Get a `BitVector`

denoting vertexwise parcel membership

`CorticalParcels.nnz`

— Method`nnz(px)`

Get the number of vertices within a parcellation that are assigned to at least one `Parcel`

.

`CorticalParcels.overlap`

— Method`overlap(p1, p2)`

Compute the number of member vertices shared between two `Parcel`

s `p1`

, `p2`

.

`CorticalParcels.unassigned`

— Method`unassigned(px)`

Get a `BitVector`

identifying unassigned vertices (`1`

) in a parcellation.

`CorticalSurfaces.vertices`

— Method`vertices(p)`

Get the vertex indices belonging to a `Parcel`

. Indices will be numbered inclusive of medial wall by default.