Learn R Programming

retistruct (version 0.6.3)

ReconstructedOutline: Class containing functions to reconstruct StitchedOutlines and store the associated data

Description

The function reconstruct reconstructs outline into spherical surface Reconstruct outline into spherical surface.

Arguments

Super class

retistruct::OutlineCommon -> ReconstructedOutline

Public fields

ol

Annotated outline

ol0

Original Annotated outline

Pt

Transformed cartesian mesh points

Tt

Transformed triangulation

Ct

Transformed links

Cut

Transformed links

Bt

Transformed binary vector representation of edge indices onto a binary vector representation of the indices of the points linked by the edge

Lt

Transformed lengths

ht

Transformed correspondences

u

Indices of unique points in untransformed space

U

Transformed indices of unique points in untransformed space

Rsett

Transformed rim set

i0t

Transformed marker

H

mapping from edges onto corresponding edges

Ht

Transformed mapping from edges onto corresponding edges

phi0

Rim angle

R

Radius of spherical template

lambda0

Longitude of pole on rim

lambda

Longitudes of transformed mesh points

phi

Latitudes of transformed mesh points

Ps

Location of mesh point on sphere in spherical coordinates

n

Number of mesh points

alpha

Weighting of areas in energy function

x0

Area cut-off coefficient

nflip0

Initial number flipped triangles

nflip

Final number flipped triangles

opt

Optimisation object

E.tot

Energy function including area

E.l

Energy function based on lengths alone

mean.strain

Mean strain

mean.logstrain

Mean log strain

debug

Debug function

Methods

Public methods

Method loadOutline()

Load AnnotatedOutline into ReconstructedOutline object

Usage

ReconstructedOutline$loadOutline(
  ol,
  n = 500,
  alpha = 8,
  x0 = 0.5,
  plot.3d = FALSE,
  dev.flat = NA,
  dev.polar = NA,
  report = retistruct::report,
  debug = FALSE
)

Arguments

ol

AnnotatedOutline object, containing the following information

n

Number of points in triangulation.

alpha

Area scaling coefficient

x0

Area cut-off coefficient

plot.3d

Whether to show 3D picture during optimisation.

dev.flat

Device to plot grid onto. Value of NA (default) means no plotting.

dev.polar

Device display projection. Value of NA (default) means no plotting.

report

Function to report progress.

debug

If TRUE print extra debugging output

Method reconstruct()

Reconstruct Reconstruction proceeds in a number of stages:

  1. The flat object is triangulated with at least n triangles. This can introduce new vertices in the rim.

  2. The triangulated object is stitched.

  3. The stitched object is triangulated again, but this time it is not permitted to add extra vertices to the rim.

  4. The corresponding points determined by the stitching process are merged to form a new set of merged points and a new triangulation.

  5. The merged points are projected roughly to a sphere.

  6. The locations of the points on the sphere are moved so as to minimise the energy function.

Usage

ReconstructedOutline$reconstruct(
  plot.3d = FALSE,
  dev.flat = NA,
  dev.polar = NA,
  report = getOption("retistruct.report")
)

Arguments

plot.3d

If TRUE make a 3D plot in an RGL window

dev.flat

Device handle for plotting flatplot updates to. If NA don't make any flat plots

dev.polar

Device handle for plotting polar plot updates to. If NA don't make any polar plots.

report

Function to report progress.

Control

argument to pass to optim

Method mergePointsEdges()

Merge stitched points and edges. Create merged and transformed versions (all suffixed with t) of a number of existing variables, as well as a matrix Bt, which maps a binary vector representation of edge indices onto a binary vector representation of the indices of the points linked by the edge. Sets following fields

  • PtTransformed point locations

  • TtTransformed triangulation

  • CtTransformed connection set

  • CutTransformed symmetric connection set

  • BtTransformed binary vector representation of edge indices onto a binary vector representation of the indices of the points linked by the edge

  • LtTransformed edge lengths

  • htTransformed correspondences

  • uIndices of unique points in untransformed space

  • UTransformed indices of unique points in untransformed space

  • RsetThe set of points on the rim (which has been reordered)

  • RsettTransformed set of points on rim

  • i0tTransformed index of the landmark

  • Hmapping from edges onto corresponding edges

  • HtTransformed mapping from edges onto corresponding edges

Usage

ReconstructedOutline$mergePointsEdges()

Method projectToSphere()

Project mesh points in the flat outline onto a sphere This takes the mesh points from the flat outline and maps them to the curtailed sphere. It uses the area of the flat outline and phi0 to determine the radius R of the sphere. It tries to get a good first approximation by using the function stretchMesh. The following fields are set:

  • phiLatitude of mesh points.

  • lmabdaLongitude of mesh points.

  • RRadius of sphere.

Usage

ReconstructedOutline$projectToSphere()

Method getStrains()

Return strains edges are under in spherical retina Set information about how edges on the sphere have been deformed from their flat state.

Usage

ReconstructedOutline$getStrains()

Returns

A list containing two data frames flat and spherical. Each data frame contains for each edge in the flat or spherical meshes:

  • LLength of the edge in the flat outline

  • lLength of the corresponding edge on the sphere

  • strainThe strain of each connection

  • logstrainThe logarithmic strain of each connection

Method optimiseMapping()

Optimise the mapping from the flat outline to the sphere

Usage

ReconstructedOutline$optimiseMapping(
  alpha = 4,
  x0 = 0.5,
  nu = 1,
  optim.method = "BFGS",
  plot.3d = FALSE,
  dev.flat = NA,
  dev.polar = NA,
  control = list()
)

Arguments

alpha

Area penalty scaling coefficient

x0

Area penalty cut-off coefficient

nu

Power to which to raise area

optim.method

Method to pass to optim

plot.3d

If TRUE make a 3D plot in an RGL window

dev.flat

Device handle for plotting flatplot updates to. If NA don't make any flat plots

dev.polar

Device handle for plotting polar plot updates to. If NA don't make any polar plots.

control

Control argument to pass to optim

Method optimiseMappingCart()

Optimise the mapping from the flat outline to the sphere

Usage

ReconstructedOutline$optimiseMappingCart(
  alpha = 4,
  x0 = 0.5,
  nu = 1,
  method = "BFGS",
  plot.3d = FALSE,
  dev.flat = NA,
  dev.polar = NA,
  ...
)

Arguments

alpha

Area penalty scaling coefficient

x0

Area penalty cut-off coefficient

nu

Power to which to raise area

method

Method to pass to optim

plot.3d

If TRUE make a 3D plot in an RGL window

dev.flat

Device handle for plotting grid to

dev.polar

Device handle for plotting polar plot to

...

Extra arguments to pass to fire

Method transformImage()

Transform an image into the reconstructed space Transform an image into the reconstructed space. The four corner coordinates of each pixel are transformed into spherical coordinates and a mask matrix with the same dimensions as im is created. This has TRUE for pixels that should be displayed and FALSE for ones that should not. Sets the field

  • imsCoordinates of corners of pixels in spherical coordinates

Usage

ReconstructedOutline$transformImage()

Method getIms()

Get coordinates of corners of pixels of image in spherical coordinates

Usage

ReconstructedOutline$getIms()

Returns

Coordinates of corners of pixels in spherical coordinates

Method getTearCoords()

Get location of tear coordinates in spherical coordinates

Usage

ReconstructedOutline$getTearCoords()

Returns

Location of tear coordinates in spherical coordinates

Method getFeatureSet()

Get ReconstructedFeatureSet

Usage

ReconstructedOutline$getFeatureSet(type)

Arguments

type

Base type of FeatureSet as string. E.g. PointSet returns a ReconstructedPointSet

Method reconstructFeatureSets()

Reconstruct any attached feature sets.

Usage

ReconstructedOutline$reconstructFeatureSets()

Method getPoints()

Get mesh points in spherical coordinates

Usage

ReconstructedOutline$getPoints()

Returns

Matrix with columns phi (latitude) and lambda (longitude)

Method mapFlatToSpherical()

Return location of point on sphere corresponding to point on the flat outline

Usage

ReconstructedOutline$mapFlatToSpherical(P)

Arguments

P

Cartesian coordinates on flat outline as a matrix with X and Y columns

Method clone()

The objects of this class are cloneable with this method.

Usage

ReconstructedOutline$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.