CSample {riemtan}R Documentation

CSample Class

Description

This class represents a sample of connectomes, with various properties and methods to handle their tangent and vectorized images.

Active bindings

connectomes

Connectomes data

tangent_images

Tangent images data

vector_images

Vector images data

sample_size

Sample size

matrix_size

Matrix size

mfd_dim

Manifold dimension

is_centered

Centering status

frechet_mean

Frechet mean

riem_metric

Riemannian Metric used

variation

Variation of the sample

sample_cov

Sample covariance

ref_point

Reference point for tangent or vectorized images

Methods

Public methods


Method new()

Initialize a CSample object

Usage
CSample$new(
  conns = NULL,
  tan_imgs = NULL,
  vec_imgs = NULL,
  centered = NULL,
  ref_pt = NULL,
  metric_obj
)
Arguments
conns

A list of connectomes (default is NULL).

tan_imgs

A list of tangent images (default is NULL).

vec_imgs

A matrix whose rows are vectorized images (default is NULL).

centered

Boolean indicating whether tangent or vectorized images are centered (default is NULL).

ref_pt

A connectome (default is identity)

metric_obj

Object of class rmetric representing the Riemannian metric used.

Returns

A new CSample object.


Method compute_tangents()

This function computes the tangent images from the connectomes.

Usage
CSample$compute_tangents(ref_pt = default_ref_pt(private$p))
Arguments
ref_pt

A reference point, which must be a dppMatrix object (default is default_ref_pt).

Details

Error if ref_pt is not a dppMatrix object or if conns is not specified.

Returns

None


Method compute_conns()

This function computes the connectomes from the tangent images.

Usage
CSample$compute_conns()
Details

Error if tangent images are not specified.

Returns

None


Method compute_vecs()

This function computes the vectorized tangent images from the tangent images.

Usage
CSample$compute_vecs()
Details

Error if tangent images are not specified.

Returns

None


Method compute_unvecs()

This function computes the tangent images from the vector images.

Usage
CSample$compute_unvecs()
Details

Error if vec_imgs is not specified.

Returns

None


Method compute_fmean()

This function computes the Frechet mean of the sample.

Usage
CSample$compute_fmean(tol = 0.05, max_iter = 20, lr = 0.2)
Arguments
tol

Tolerance for the convergence of the mean (default is 0.05).

max_iter

Maximum number of iterations for the computation (default is 20).

lr

Learning rate for the optimization algorithm (default is 0.2).

Returns

None


Method change_ref_pt()

This function changes the reference point for the tangent images.

Usage
CSample$change_ref_pt(new_ref_pt)
Arguments
new_ref_pt

A new reference point, which must be a dppMatrix object.

Details

Error if tangent images have not been computed or if new_ref_pt is not a dppMatrix object.

Returns

None


Method center()

Center the sample

Usage
CSample$center()
Details

This function centers the sample by computing the Frechet mean if it is not already computed, and then changing the reference point to the computed Frechet mean. Error if tangent images are not specified. Error if the sample is already centered.

Returns

None. This function is called for its side effects.


Method compute_variation()

Compute Variation

Usage
CSample$compute_variation()
Details

This function computes the variation of the sample. It first checks if the vector images are null, and if so, it computes the vectors, computing first the tangent images if necessary. If the sample is not centered, it centers the sample and recomputes the vectors. Finally, it calculates the variation as the mean of the sum of squares of the vector images. Error if vec_imgs is not specified.

Returns

None. This function is called for its side effects.


Method compute_sample_cov()

Compute Sample Covariance

Usage
CSample$compute_sample_cov()
Details

This function computes the sample covariance matrix for the vector images. It first checks if the vector images are null, and if so, it computes the vectors, computing first the tangent images if necessary.

Returns

None. This function is called for its side effects.


Method clone()

The objects of this class are cloneable with this method.

Usage
CSample$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


[Package riemtan version 0.1.0 Index]