The function reconstruct reconstructs outline
into spherical surface Reconstruct outline into spherical
surface.
retistruct::OutlineCommon -> ReconstructedOutline
olAnnotated outline
ol0Original Annotated outline
PtTransformed cartesian mesh points
TtTransformed triangulation
CtTransformed links
CutTransformed links
BtTransformed binary vector representation of edge indices onto a binary vector representation of the indices of the points linked by the edge
LtTransformed lengths
htTransformed correspondences
uIndices of unique points in untransformed space
UTransformed indices of unique points in untransformed space
RsettTransformed rim set
i0tTransformed marker
Hmapping from edges onto corresponding edges
HtTransformed mapping from edges onto corresponding edges
phi0Rim angle
RRadius of spherical template
lambda0Longitude of pole on rim
lambdaLongitudes of transformed mesh points
phiLatitudes of transformed mesh points
PsLocation of mesh point on sphere in spherical coordinates
nNumber of mesh points
alphaWeighting of areas in energy function
x0Area cut-off coefficient
nflip0Initial number flipped triangles
nflipFinal number flipped triangles
optOptimisation object
E.totEnergy function including area
E.lEnergy function based on lengths alone
mean.strainMean strain
mean.logstrainMean log strain
debugDebug function
loadOutline()Load AnnotatedOutline into ReconstructedOutline object
ReconstructedOutline$loadOutline( ol, n = 500, alpha = 8, x0 = 0.5, plot.3d = FALSE, dev.flat = NA, dev.polar = NA, report = retistruct::report, debug = FALSE )
olAnnotatedOutline object, containing the following information
nNumber of points in triangulation.
alphaArea scaling coefficient
x0Area cut-off coefficient
plot.3dWhether to show 3D picture during optimisation.
dev.flatDevice to plot grid onto. Value of NA (default)
means no plotting.
dev.polarDevice display projection. Value of NA (default) means no plotting.
reportFunction to report progress.
debugIf TRUE print extra debugging output
reconstruct()Reconstruct Reconstruction proceeds in a number of stages:
The flat object is triangulated with at least n
triangles. This can introduce new vertices in the rim.
The triangulated object is stitched.
The stitched object is triangulated again, but this time it is not permitted to add extra vertices to the rim.
The corresponding points determined by the stitching process are merged to form a new set of merged points and a new triangulation.
The merged points are projected roughly to a sphere.
The locations of the points on the sphere are moved so as to minimise the energy function.
ReconstructedOutline$reconstruct(
plot.3d = FALSE,
dev.flat = NA,
dev.polar = NA,
report = getOption("retistruct.report")
)plot.3dIf TRUE make a 3D plot in an RGL window
dev.flatDevice handle for plotting flatplot updates to. If
NA don't make any flat plots
dev.polarDevice handle for plotting polar plot updates
to. If NA don't make any polar plots.
reportFunction to report progress.
Controlargument to pass to optim
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
ReconstructedOutline$mergePointsEdges()
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.
ReconstructedOutline$projectToSphere()
getStrains()Return strains edges are under in spherical retina Set information about how edges on the sphere have been deformed from their flat state.
ReconstructedOutline$getStrains()
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
optimiseMapping()Optimise the mapping from the flat outline to the sphere
ReconstructedOutline$optimiseMapping( alpha = 4, x0 = 0.5, nu = 1, optim.method = "BFGS", plot.3d = FALSE, dev.flat = NA, dev.polar = NA, control = list() )
alphaArea penalty scaling coefficient
x0Area penalty cut-off coefficient
nuPower to which to raise area
optim.methodMethod to pass to optim
plot.3dIf TRUE make a 3D plot in an RGL window
dev.flatDevice handle for plotting flatplot updates to. If
NA don't make any flat plots
dev.polarDevice handle for plotting polar plot updates
to. If NA don't make any polar plots.
controlControl argument to pass to optim
optimiseMappingCart()Optimise the mapping from the flat outline to the sphere
ReconstructedOutline$optimiseMappingCart( alpha = 4, x0 = 0.5, nu = 1, method = "BFGS", plot.3d = FALSE, dev.flat = NA, dev.polar = NA, ... )
alphaArea penalty scaling coefficient
x0Area penalty cut-off coefficient
nuPower to which to raise area
methodMethod to pass to optim
plot.3dIf TRUE make a 3D plot in an RGL window
dev.flatDevice handle for plotting grid to
dev.polarDevice handle for plotting polar plot to
...Extra arguments to pass to fire
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
ReconstructedOutline$transformImage()
getIms()Get coordinates of corners of pixels of image in spherical coordinates
ReconstructedOutline$getIms()
Coordinates of corners of pixels in spherical coordinates
getTearCoords()Get location of tear coordinates in spherical coordinates
ReconstructedOutline$getTearCoords()
Location of tear coordinates in spherical coordinates
getFeatureSet()ReconstructedOutline$getFeatureSet(type)
typeBase type of FeatureSet as string.
E.g. PointSet returns a ReconstructedPointSet
reconstructFeatureSets()Reconstruct any attached feature sets.
ReconstructedOutline$reconstructFeatureSets()
getPoints()Get mesh points in spherical coordinates
ReconstructedOutline$getPoints()
Matrix with columns phi (latitude) and lambda
(longitude)
mapFlatToSpherical()Return location of point on sphere corresponding to point on the flat outline
ReconstructedOutline$mapFlatToSpherical(P)
PCartesian coordinates on flat outline as a matrix
with X and Y columns
clone()The objects of this class are cloneable with this method.
ReconstructedOutline$clone(deep = FALSE)
deepWhether to make a deep clone.