Title: | Atomic Force Microscope Image Analysis |
---|---|
Description: | Provides Atomic Force Microscope images analysis such as Gaussian mixes identification, Power Spectral Density, roughness against lengthscale, experimental variogram and variogram models, fractal dimension and scale, 2D network analysis. The AFM images can be exported to STL format for 3D printing. |
Authors: | Mathieu Beauvais [aut, cre], Irma Liascukiene [aut], Jessem Landoulsi [aut] |
Maintainer: | Mathieu Beauvais <[email protected]> |
License: | AGPL-3 |
Version: | 2.0 |
Built: | 2024-11-19 05:42:30 UTC |
Source: | https://github.com/cran/AFM |
The AFM package provides statistics analysis tools for Atomic Force Microscopy image analysis.
Licence: Affero GPL v3
A graphical user interface is available by using runAFMApp
command.
Several high level functions are :
create your AFM image from a list of measured heights (see example section of AFMImage
)
import your image from Nanoscope Analysis (TM) tool (importFromNanoscope
)
check if your sample is normally distributed and isotropic and get a pdf report (generateCheckReport
)
calculate the Gaussian mixes of the heights (performGaussianMixCalculation
)
perform variance (variogram), roughness against lengthscale, fractal analysis and get a pdf report (generateReport
)
identify 2D networks (getNetworkParameters
)
Other functions are :
check sample: for normality (checkNormality
) and for isotropy (checkIsotropy
)
calculate total RMS roughness: quick calculation of total root mean square roughness(totalRMSRoughness
)
calculate omnidirectional variogram: calculate estimated variogram (calculateOmnidirectionalVariogram
)
calculate roughness against lenghscale and Power Spectrum Density (PSD): calculate roughness against length scale (RoughnessByLengthScale
), PSD 1D (PSD1DAgainstFrequency
) or PSD 2D (PSD2DAgainstFrequency
) against frequencies
calculate fractal dimension and scale: use (getFractalDimensions
) function
print in 3D (3D print) (exportToSTL
) your AFM image
An EC2 instance is available for basic testing at the following address: http://www.afmist.org
Note: To use with a Brucker(TM) Atomic Force Microscope, use nanoscope analysis(TM) software and
Use the "Flatten" function.
Save the flattened image.
Use the "Browse Data Files" windows, right click on image name and then Export the AFM image with the headers and the "Export> ASCII" contextual menu option.
M.Beauvais, J.Landoulsi, I.Liascukiene
Gneiting2012, Tilmann Gneiting, Hana Sevcikova and Donald B. Percival 'Estimators of Fractal Dimension: Assessing the Roughness of Time Series and Spatial Data - Statistics in statistical Science, 2012, Vol. 27, No. 2, 247-277'
Olea2006, Ricardo A. Olea "A six-step practical approach to semivariogram modeling", 2006, "Stochastic Environmental Research and Risk Assessment, Volume 20, Issue 5 , pp 307-318"
Sidick2009, Erkin Sidick "Power Spectral Density Specification and Analysis of Large Optical Surfaces", 2009, "Modeling Aspects in Optical Metrology II, Proc. of SPIE Vol. 7390 73900L-1"
## Not run: library(AFM) # Analyse the AFMImageOfRegularPeaks AFM Image from this package data("AFMImageOfRegularPeaks") AFMImage<-AFMImageOfRegularPeaks # exportDirectory="C:/Users/my_windows_login" or exportDirectory="/home/ubuntu" exportDirectory=tempdir() AFMImage@fullfilename<-paste(exportDirectory,"AFMImageOfRegularPeaks.txt",sep="/") # Start to check if your sample is normaly distributed and isotropic. generateCheckReport(AFMImage) # If the sample is normaly distributed and isotropic, generate a full report generateReport(AFMImage) ## End(Not run)
## Not run: library(AFM) # Analyse the AFMImageOfRegularPeaks AFM Image from this package data("AFMImageOfRegularPeaks") AFMImage<-AFMImageOfRegularPeaks # exportDirectory="C:/Users/my_windows_login" or exportDirectory="/home/ubuntu" exportDirectory=tempdir() AFMImage@fullfilename<-paste(exportDirectory,"AFMImageOfRegularPeaks.txt",sep="/") # Start to check if your sample is normaly distributed and isotropic. generateCheckReport(AFMImage) # If the sample is normaly distributed and isotropic, generate a full report generateReport(AFMImage) ## End(Not run)
A S4 class to store and manipulate images from Atomic Force Microscopes.
AFMImage( data, samplesperline, lines, hscansize, vscansize, scansize, fullfilename ) ## S4 method for signature 'AFMImage' initialize( .Object, data, samplesperline, lines, hscansize, vscansize, scansize, fullfilename ) AFMImage( data, samplesperline, lines, hscansize, vscansize, scansize, fullfilename )
AFMImage( data, samplesperline, lines, hscansize, vscansize, scansize, fullfilename ) ## S4 method for signature 'AFMImage' initialize( .Object, data, samplesperline, lines, hscansize, vscansize, scansize, fullfilename ) AFMImage( data, samplesperline, lines, hscansize, vscansize, scansize, fullfilename )
data |
($x,$y,$h): a data.table storing the coordinates of the sample and the measured heights |
samplesperline |
number of samples per line (e.g.: 512) |
lines |
number of line (e.g.: 512) |
hscansize |
horizontal size of scan usualy in nanometer (e.g.: hscansize=1000 for a scan size of 1000 nm) |
vscansize |
vertical size of scan usualy in nanometer (e.g.: vscansize=1000 for a scan size of 1000 nm) |
scansize |
if hscansize equals vscansize, scansize is the size of scan usualy in nanometer (e.g.: scansize=1000 for a scan size of 1000 nm) |
fullfilename |
directory and filename on the disk (e.g.: /users/ubuntu/flatten-image.txt) |
.Object |
an AFMImage object |
data
($x,$y,$h): a data.table storing the coordinates of the sample and the measured heights
samplesperline
number of samples per line (e.g.: 512)
lines
number of line (e.g.: 512)
hscansize
horizontal size of scan usualy in nanometer (e.g.: hscansize=1000 for a scan size of 1000 nm)
vscansize
vertical size of scan usualy in nanometer (e.g.: vscansize=1000 for a scan size of 1000 nm)
scansize
if hscansize equals vscansize, scansize is the size of scan usualy in nanometer (e.g.: scansize=1000 for a scan size of 1000 nm)
fullfilename
directory and filename on the disk (e.g.: /users/ubuntu/flatten-image.txt)
M.Beauvais
## Not run: library(AFM) library(data.table) # create a 128 pixels by 128 pixels AFM image Lines=128 Samplesperline=128 fullfilename="RandomFakeAFMImage" # the size of scan is 128 nm ScanSize=128 # the heights is a normal distribution in nanometers nm<-c(rnorm(128*128, mean=0, sd=1 )) scanby<-ScanSize/Samplesperline endScan<-ScanSize*(1-1/Samplesperline) RandomFakeAFMImage<-AFMImage( data = data.table(x = rep(seq(0,endScan, by= scanby), times = Lines), y = rep(seq(0,endScan, by= scanby), each = Samplesperline), h = nm), samplesperline = Samplesperline, lines = Lines, vscansize = ScanSize, hscansize = ScanSize, scansize = ScanSize, fullfilename = fullfilename ) ## End(Not run)
## Not run: library(AFM) library(data.table) # create a 128 pixels by 128 pixels AFM image Lines=128 Samplesperline=128 fullfilename="RandomFakeAFMImage" # the size of scan is 128 nm ScanSize=128 # the heights is a normal distribution in nanometers nm<-c(rnorm(128*128, mean=0, sd=1 )) scanby<-ScanSize/Samplesperline endScan<-ScanSize*(1-1/Samplesperline) RandomFakeAFMImage<-AFMImage( data = data.table(x = rep(seq(0,endScan, by= scanby), times = Lines), y = rep(seq(0,endScan, by= scanby), each = Samplesperline), h = nm), samplesperline = Samplesperline, lines = Lines, vscansize = ScanSize, hscansize = ScanSize, scansize = ScanSize, fullfilename = fullfilename ) ## End(Not run)
AFMImage3DModelAnalysis
f1
a face of the 3D model
f2
a face of the 3D model
f3
a face of the 3D model
f4
a face of the 3D model
M.Beauvais
A S4 class to handle the analysis of one AFM Image.
AFMImageAnalyser(AFMImage) AFMImageAnalyser(AFMImage)
AFMImageAnalyser(AFMImage) AFMImageAnalyser(AFMImage)
AFMImage |
an |
AFMImage
AFMImage
to be analysed
variogramAnalysis
psdAnalysis
fdAnalysis
gaussianMixAnalysis
networksAnalysis
mean
the mean of heights of the AFMImage
variance
the variance of heights of the AFMImage
TotalRrms
the total Root Mean Square Roughness of the AFMImage
calculated from variance
Ra
mean roughness or mean of absolute values of heights
fullfilename
to be removed ?
updateProgress
a function to update a graphical user interface
M.Beauvais
A real dataset containing an AFMImage
of a collagen network.
The image is made of 192*192 samples of a 1500 nm * 1500 nm surface.
samplesperline=192
lines=192
hscansize=1500
vscansize=1500
AFMImageFractalDimensionMethod
stores calculation from one fractal dimension method
AFMImageFractalDimensionMethod(fd_method, fd, fd_scale) ## S4 method for signature 'AFMImageFractalDimensionMethod' initialize(.Object, fd_method, fd, fd_scale) AFMImageFractalDimensionMethod(fd_method, fd, fd_scale)
AFMImageFractalDimensionMethod(fd_method, fd, fd_scale) ## S4 method for signature 'AFMImageFractalDimensionMethod' initialize(.Object, fd_method, fd, fd_scale) AFMImageFractalDimensionMethod(fd_method, fd, fd_scale)
fd_method |
Two dimensional function names used to evaluate the fractal dimension and fractal scale |
fd |
the value of the fractal dimension |
fd_scale |
the value of the fractal scale |
.Object |
an AFMImageFractalDimensionMethod object |
fd_method
Two dimensional function names used to evaluate the fractal dimension and fractal scale
fd
the value of the fractal dimension
fd_scale
the value of the fractal scale
M.Beauvais
A S4 class to handle the fractal dimension calculation with several fractal dimension methods
AFMImageFractalDimensionsAnalysis() ## S4 method for signature 'AFMImageFractalDimensionsAnalysis' initialize(.Object, fractalDimensionMethods, csvFullfilename) AFMImageFractalDimensionsAnalysis() fractalDimensionMethods(object) ## S4 method for signature 'AFMImageFractalDimensionsAnalysis' fractalDimensionMethods(object)
AFMImageFractalDimensionsAnalysis() ## S4 method for signature 'AFMImageFractalDimensionsAnalysis' initialize(.Object, fractalDimensionMethods, csvFullfilename) AFMImageFractalDimensionsAnalysis() fractalDimensionMethods(object) ## S4 method for signature 'AFMImageFractalDimensionsAnalysis' fractalDimensionMethods(object)
.Object |
an AFMImageFractalDimensionsAnalysis Class |
fractalDimensionMethods |
a list of |
csvFullfilename |
To be removed ? |
object |
fractalDimensionMethods
a list of AFMImageFractalDimensionMethod
csvFullfilename
To be removed ?
updateProgress
a function to update a graphical user interface
M.Beauvais
AFMImageGaussianMixAnalysis
handles an AFMImage
Gaussian mix of heights analysis
AFMImageGaussianMixAnalysis() ## S4 method for signature 'AFMImageGaussianMixAnalysis' initialize(.Object) AFMImageGaussianMixAnalysis() summaryMixture(object) ## S4 method for signature 'AFMImageGaussianMixAnalysis' summaryMixture(object) eachComponentsCounts(object) ## S4 method for signature 'AFMImageGaussianMixAnalysis' eachComponentsCounts(object) tcdfsEcdfsCheck(object) densityCurvesAllHeights(object) ## S4 method for signature 'AFMImageGaussianMixAnalysis' densityCurvesAllHeights(object) tcdfsEcdfsCheck(object) ## S4 method for signature 'AFMImageGaussianMixAnalysis' tcdfsEcdfsCheck(object) gaussianMix(object) ## S4 method for signature 'AFMImageGaussianMixAnalysis' gaussianMix(object) minGaussianMix(object) ## S4 method for signature 'AFMImageGaussianMixAnalysis' minGaussianMix(object) maxGaussianMix(object) ## S4 method for signature 'AFMImageGaussianMixAnalysis' maxGaussianMix(object) epsilonGaussianMix(object) ## S4 method for signature 'AFMImageGaussianMixAnalysis' epsilonGaussianMix(object)
AFMImageGaussianMixAnalysis() ## S4 method for signature 'AFMImageGaussianMixAnalysis' initialize(.Object) AFMImageGaussianMixAnalysis() summaryMixture(object) ## S4 method for signature 'AFMImageGaussianMixAnalysis' summaryMixture(object) eachComponentsCounts(object) ## S4 method for signature 'AFMImageGaussianMixAnalysis' eachComponentsCounts(object) tcdfsEcdfsCheck(object) densityCurvesAllHeights(object) ## S4 method for signature 'AFMImageGaussianMixAnalysis' densityCurvesAllHeights(object) tcdfsEcdfsCheck(object) ## S4 method for signature 'AFMImageGaussianMixAnalysis' tcdfsEcdfsCheck(object) gaussianMix(object) ## S4 method for signature 'AFMImageGaussianMixAnalysis' gaussianMix(object) minGaussianMix(object) ## S4 method for signature 'AFMImageGaussianMixAnalysis' minGaussianMix(object) maxGaussianMix(object) ## S4 method for signature 'AFMImageGaussianMixAnalysis' maxGaussianMix(object) epsilonGaussianMix(object) ## S4 method for signature 'AFMImageGaussianMixAnalysis' epsilonGaussianMix(object)
.Object |
an AFMImageGaussianMixAnalysis object |
object |
minGaussianMix
the minimum number of components to calculate
maxGaussianMix
the maximum number of components to calculate
epsilonGaussianMix
the convergence criterion
gaussianMix
a data.table to store the calculated Gaussian mixes
summaryMixture
a data.table to summaryse the mixtures
tcdfsEcdfsCheck
an array to store the points to draw tcdfs ecdfs check
densityCurvesAllHeights
an array to store the points to draw the density curves
eachComponentsCounts
an array to store the points to draw counts of each components
updateProgress
a function to update a graphical user interface
M.Beauvais
A S4 class to handle the networks calculation
AFMImageNetworksAnalysis() ## S4 method for signature 'AFMImageNetworksAnalysis' initialize( .Object, vertexHashsize, binaryAFMImage, binaryAFMImageWithCircles, circlesTable, edgesTable, fusionedNodesCorrespondance, fusionedNodesEdgesTable, isolatedNodesList, heightNetworksslider, filterNetworkssliderMin, filterNetworkssliderMax, smallBranchesTreatment, originalGraph, skeletonGraph, shortestPaths, networksCharacteristics, holes, holesCharacteristics, graphEvcent, graphBetweenness, libVersion ) AFMImageNetworksAnalysis()
AFMImageNetworksAnalysis() ## S4 method for signature 'AFMImageNetworksAnalysis' initialize( .Object, vertexHashsize, binaryAFMImage, binaryAFMImageWithCircles, circlesTable, edgesTable, fusionedNodesCorrespondance, fusionedNodesEdgesTable, isolatedNodesList, heightNetworksslider, filterNetworkssliderMin, filterNetworkssliderMax, smallBranchesTreatment, originalGraph, skeletonGraph, shortestPaths, networksCharacteristics, holes, holesCharacteristics, graphEvcent, graphBetweenness, libVersion ) AFMImageNetworksAnalysis()
.Object |
an AFMImageNetworksAnalysis Class |
vertexHashsize |
hash to transform coordinates to vertexId |
binaryAFMImage |
the AFMImage after transformation before analysis |
binaryAFMImageWithCircles |
the AFMImage after transformation with the spotted circles |
circlesTable |
a data.table of identified circles |
edgesTable |
a data.table of edges |
fusionedNodesCorrespondance |
a data.table of correspon |
fusionedNodesEdgesTable |
a data.table of corresponsdance between intial node and fusioned node |
isolatedNodesList |
a data.table of isolated nodes |
heightNetworksslider |
used multiplier of heights to facilitate analysis |
filterNetworkssliderMin |
used filter minimum value to facilitate analysis |
filterNetworkssliderMax |
used filter maximum value to facilitate analysis |
smallBranchesTreatment |
boolean - smallest circle used or not |
originalGraph |
a list of |
skeletonGraph |
a list of |
shortestPaths |
a data.table of shortest path |
networksCharacteristics |
a data.table to store the skeleton graph characteristics |
holes |
a data.table to store the cluster number of each point |
holesCharacteristics |
a data.table to summarize the data about holes |
graphEvcent |
an array to store Evcent |
graphBetweenness |
an array to store the graph betweenness |
libVersion |
version of the AFM library used to perform the analysis |
vertexHashsize
hash to transform coordinates to vertexId
binaryAFMImage
the AFMImage after transformation before analysis
binaryAFMImageWithCircles
the AFMImage after transformation with the spotted circles
circlesTable
a data.table of identified circles
edgesTable
a data.table of edges
fusionedNodesCorrespondance
a data.table of corresponsdance between intial node and fusioned node
fusionedNodesEdgesTable
a data.table of nodes fusioned because of intersecting
isolatedNodesTable
a data.table of isolated nodes
heightNetworksslider
used multiplier of heights to facilitate analysis
filterNetworkssliderMin
used filter minimum value to facilitate analysis
filterNetworkssliderMax
used filter maximum value to facilitate analysis
smallBranchesTreatment
boolean - smallest circle used or not
originalGraph
a list of igraph
skeletonGraph
a list of igraph
shortestPaths
a data.table of shortest paths
networksCharacteristics
a data.table to store the skeleton graph characteristics
graphEvcent
an array to store Evcent
graphBetweenness
an array to store the graph betweenness
libVersion
version of the AFM library used to perform the analysis
updateProgress
a function to update a graphical user interface
M.Beauvais
A real dataset containing an AFMImage
of an Aluminium interface.
The image is made of 512*512 samples of a 1000 nm * 1000 nm surface.
samplesperline=512
lines=512
hscansize=1000
vscansize=1000
J.Landoulsi, I.Liascukiene
A fake dataset containing a manually generated AFMImage
(a normal distribution of heights).
The image is made of 128*128 samples of a 128 nm * 128 nm surface.
samplesperline= 128
lines= 128
hscansize= 128
vscansize= 128
A fake dataset containing a manually generated AFMImage
(one peak positioned on the surface).
The image is made of 128*128 samples of a 128 nm * 128 nm surface.
samplesperline= 128
lines= 128
hscansize= 128
vscansize= 128
A fake dataset containing a manually generated AFMImage
(peaks regularly positioned on the surface).
The image is made of 128*128 samples of a 128 nm * 128 nm surface.
samplesperline= 128
lines= 128
hscansize= 128
vscansize= 128
AFMImagePSDAnalysis
handles an AFMImage
roughness against lenghscale analysis
AFMImagePSDAnalysis() ## S4 method for signature 'AFMImagePSDAnalysis' initialize(.Object) AFMImagePSDAnalysis() psd1d_breaks(object) ## S4 method for signature 'AFMImagePSDAnalysis' psd1d_breaks(object) psd2d_maxHighLengthScale(object) ## S4 method for signature 'AFMImagePSDAnalysis' psd2d_maxHighLengthScale(object) psd2d_truncHighLengthScale(object) ## S4 method for signature 'AFMImagePSDAnalysis' psd2d_truncHighLengthScale(object) psd1d(object) ## S4 method for signature 'AFMImagePSDAnalysis' psd1d(object) psd2d(object) ## S4 method for signature 'AFMImagePSDAnalysis' psd2d(object) roughnessAgainstLengthscale(object) ## S4 method for signature 'AFMImagePSDAnalysis' roughnessAgainstLengthscale(object) intersections(object) ## S4 method for signature 'AFMImagePSDAnalysis' intersections(object)
AFMImagePSDAnalysis() ## S4 method for signature 'AFMImagePSDAnalysis' initialize(.Object) AFMImagePSDAnalysis() psd1d_breaks(object) ## S4 method for signature 'AFMImagePSDAnalysis' psd1d_breaks(object) psd2d_maxHighLengthScale(object) ## S4 method for signature 'AFMImagePSDAnalysis' psd2d_maxHighLengthScale(object) psd2d_truncHighLengthScale(object) ## S4 method for signature 'AFMImagePSDAnalysis' psd2d_truncHighLengthScale(object) psd1d(object) ## S4 method for signature 'AFMImagePSDAnalysis' psd1d(object) psd2d(object) ## S4 method for signature 'AFMImagePSDAnalysis' psd2d(object) roughnessAgainstLengthscale(object) ## S4 method for signature 'AFMImagePSDAnalysis' roughnessAgainstLengthscale(object) intersections(object) ## S4 method for signature 'AFMImagePSDAnalysis' intersections(object)
.Object |
an AFMImagePSDAnalysis object |
object |
roughnessAgainstLengthscale
a data.table to store the roughness against lengthscale data
intersections
a list to store the lengthscales values as the intersections between slopes and the sill in roughness against lenghscale graph
updateProgress
a function to update a graphical user interface
M.Beauvais
AFMImagePSDSlopesAnalysis
stores the analysis of the second slope in roughness against lenghtscale
AFMImagePSDSlopesAnalysis() ## S4 method for signature 'AFMImagePSDSlopesAnalysis' initialize(.Object) AFMImagePSDSlopesAnalysis()
AFMImagePSDSlopesAnalysis() ## S4 method for signature 'AFMImagePSDSlopesAnalysis' initialize(.Object) AFMImagePSDSlopesAnalysis()
.Object |
an AFMImagePSDSlopesAnalysis object |
lc
to be removed ?
wsat
to be removed ?
slope
to be removed ?
yintersept
to be removed ?
M.Beauvais
AFMImageVariogramAnalysis
manages the variogram analysis of an AFMImage
AFMImageVariogramAnalysis(sampleFitPercentage) ## S4 method for signature 'AFMImageVariogramAnalysis' initialize(.Object, sampleFitPercentage, updateProgress) AFMImageVariogramAnalysis(sampleFitPercentage) variogramModels(object) ## S4 method for signature 'AFMImageVariogramAnalysis' variogramModels(object) omnidirectionalVariogram(object) ## S4 method for signature 'AFMImageVariogramAnalysis' omnidirectionalVariogram(object) directionalVariograms(object) ## S4 method for signature 'AFMImageVariogramAnalysis' directionalVariograms(object) variogramSlopeAnalysis(object) ## S4 method for signature 'AFMImageVariogramAnalysis' variogramSlopeAnalysis(object)
AFMImageVariogramAnalysis(sampleFitPercentage) ## S4 method for signature 'AFMImageVariogramAnalysis' initialize(.Object, sampleFitPercentage, updateProgress) AFMImageVariogramAnalysis(sampleFitPercentage) variogramModels(object) ## S4 method for signature 'AFMImageVariogramAnalysis' variogramModels(object) omnidirectionalVariogram(object) ## S4 method for signature 'AFMImageVariogramAnalysis' omnidirectionalVariogram(object) directionalVariograms(object) ## S4 method for signature 'AFMImageVariogramAnalysis' directionalVariograms(object) variogramSlopeAnalysis(object) ## S4 method for signature 'AFMImageVariogramAnalysis' variogramSlopeAnalysis(object)
sampleFitPercentage |
a sample size as a percentage (e.g. "5" for 5 percents) of random points in the |
.Object |
an AFMImageVariogramAnalysis class |
updateProgress |
a function to update a graphical user interface |
object |
a |
width
(optional) a distance step for the calculation of the variograms (e.g.: width= integer of (scan Size divided by number of lines)= ceil(1000 / 512) for AFMImageOfAluminiumInterface
omnidirectionalVariogram
a data.table to store the omnidirectional variogram
variogramSlopeAnalysis
a AFMImageVariogramAnalysis to analyse slope in log log omnidirectional semivariogram
directionalVariograms
a data.table to store the directional variograms
sampleFitPercentage
a sample size as a percentage of random points in the AFMImage
. These points will be used to fit the variogram models.
chosenFitSample
the chosen random points of the AFMImage
to perform the fitting of the variogram models.
cuts
the cuts for spplot of the AFMImage
. The same cuts will be used for the predicted AFMImage
variogramModels
A list of AFMImageVariogramModel
containing the various evaluated variogram models.
fullfilename
to be removed ?
updateProgress
a function to update a graphical user interface
M.Beauvais
AFMImageVariogramModel
stores the evaluation of one experimental variogram model
AFMImageVariogramModel() ## S4 method for signature 'AFMImageVariogramModel' initialize( .Object, model, fit.v = data.table(), mykrige, res = data.table(), cor, press, sill, imageFullfilename ) AFMImageVariogramModel()
AFMImageVariogramModel() ## S4 method for signature 'AFMImageVariogramModel' initialize( .Object, model, fit.v = data.table(), mykrige, res = data.table(), cor, press, sill, imageFullfilename ) AFMImageVariogramModel()
.Object |
an AFMImageVariogramModel object |
model |
the variogram model name |
fit.v |
the values from the |
mykrige |
the values from the |
res |
a data.table to store: (cor) the correlation between the predicted sample and the real sample (press) the sum of the square of the differences between real and predicted values for each point of the sample |
cor |
to be removed ? |
press |
to be removed ? |
sill |
to be removed ? |
imageFullfilename |
to be removed ? |
model
the variogram model name
fit.v
the values from the fit.variogram
function in the gstat package
mykrige
the values from the krige
function in the gstat library
res
a data.table to store: (cor) the correlation between the predicted sample and the real sample (press) the sum of the square of the differences between real and predicted values for each point of the sample
cor
to be removed ?
press
to be removed ?
sill
to be removed ?
imageFullfilename
to be removed ?
M.Beauvais
A function to wrap all the analysis of an AFMImage
variogram analysis including evaluation of basic variogram models with sill and range calculation
power spectrum density analysis including roughness against lengthscale calculation
fractal dimension analysis including fractal dimensions calculation
basic roughness parameters analysis such as mean, variance, Rrms, Ra
analyse(AFMImageAnalyser)
analyse(AFMImageAnalyser)
AFMImageAnalyser |
a |
an AFMImageAnalyser
containing all the analysis
M.Beauvais
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) AFMImage<-extractAFMImage(AFMImageOfAluminiumInterface, 0, 0, 32) AFMImageAnalyser<-new("AFMImageAnalyser", AFMImage= AFMImage, fullfilename = AFMImage@fullfilename) AFMImageAnalyser<-analyse(AFMImageAnalyser) print(AFMImageAnalyser@fdAnalysis) ## End(Not run)
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) AFMImage<-extractAFMImage(AFMImageOfAluminiumInterface, 0, 0, 32) AFMImageAnalyser<-new("AFMImageAnalyser", AFMImage= AFMImage, fullfilename = AFMImage@fullfilename) AFMImageAnalyser<-analyse(AFMImageAnalyser) print(AFMImageAnalyser@fdAnalysis) ## End(Not run)
check if nodes represented by circles are connected. The function defines all the possible segments between the circles and check if at least one segment exists.
AreNodesConnected(binaryAFMImage, center1, radius1, center2, radius2)
AreNodesConnected(binaryAFMImage, center1, radius1, center2, radius2)
binaryAFMImage |
a binary |
center1 |
the center of the circle with center$lon as the x coordinates and center$lat as the y coordinates |
radius1 |
the radius of the circle |
center2 |
the center of the circle with center$lon as the x coordinates and center$lat as the y coordinates |
radius2 |
the radius of the circle |
TRUE if the nodes are connected
M.Beauvais
calculate3DModel
update AFMImage3DModelAnalysis
calculate3DModel(AFMImage3DModelAnalysis, AFMImage) ## S4 method for signature 'AFMImage3DModelAnalysis' calculate3DModel(AFMImage3DModelAnalysis, AFMImage)
calculate3DModel(AFMImage3DModelAnalysis, AFMImage) ## S4 method for signature 'AFMImage3DModelAnalysis' calculate3DModel(AFMImage3DModelAnalysis, AFMImage)
AFMImage3DModelAnalysis |
n |
AFMImage |
an |
M.Beauvais
calculate four experimental directional variograms of an AFMImage
with the variogram
function of the gstat package.
The directional semi-variogram can be used to check the isotropy of the sample.
Note: The sample will be isotropic if the slopes of the four variograms are similar.
calculateDirectionalVariograms(AFMImageVariogramAnalysis, AFMImage)
calculateDirectionalVariograms(AFMImageVariogramAnalysis, AFMImage)
AFMImageVariogramAnalysis |
an |
AFMImage |
an |
calculateDirectionalVariograms
returns the directional variograms
Four directional variograms
M.Beauvais
## Not run: library(AFM) library(ggplot2) data(AFMImageOfRegularPeaks) variogramAnalysis<-AFMImageVariogramAnalysis(sampleFitPercentage=3.43/100) varios<-AFM::calculateDirectionalVariograms(AFMImage= AFMImageOfRegularPeaks, AFMImageVariogramAnalysis= variogramAnalysis) dist<-gamma<-NULL p <- ggplot(varios, aes(x=dist, y=gamma, color= as.factor(dir.hor), shape=as.factor(dir.hor))) p <- p + expand_limits(y = 0) p <- p + geom_point() p <- p + geom_line() p <- p + ylab("semivariance (nm^2)") p <- p + xlab("distance (nm)") p <- p + ggtitle("Directional") p ## End(Not run)
## Not run: library(AFM) library(ggplot2) data(AFMImageOfRegularPeaks) variogramAnalysis<-AFMImageVariogramAnalysis(sampleFitPercentage=3.43/100) varios<-AFM::calculateDirectionalVariograms(AFMImage= AFMImageOfRegularPeaks, AFMImageVariogramAnalysis= variogramAnalysis) dist<-gamma<-NULL p <- ggplot(varios, aes(x=dist, y=gamma, color= as.factor(dir.hor), shape=as.factor(dir.hor))) p <- p + expand_limits(y = 0) p <- p + geom_point() p <- p + geom_line() p <- p + ylab("semivariance (nm^2)") p <- p + xlab("distance (nm)") p <- p + ggtitle("Directional") p ## End(Not run)
calculateGaussianMixture
return a data.table containing the result of the Gaussian Mixture and result of the test
calculateGaussianMixture(AFMImage)
calculateGaussianMixture(AFMImage)
AFMImage |
an |
M.Beauvais
## Not run: library(AFM) data(AFMImageOfNetworks) mixtureCharacteristics<-calculateGaussianMixture(AFMImageOfNetworks) print(mixtureCharacteristics) ## End(Not run)
## Not run: library(AFM) data(AFMImageOfNetworks) mixtureCharacteristics<-calculateGaussianMixture(AFMImageOfNetworks) print(mixtureCharacteristics) ## End(Not run)
Calculate the holes characteristics
calculateHolesCharacteristics(AFMImageNetworksAnalysis)
calculateHolesCharacteristics(AFMImageNetworksAnalysis)
AFMImageNetworksAnalysis |
a data.table with all the parameters
M.Beauvais
calculateIgraph
return
calculateIgraph(AFMImage, AFMImageNetworksAnalysis)
calculateIgraph(AFMImage, AFMImageNetworksAnalysis)
AFMImage |
an |
AFMImageNetworksAnalysis |
an |
M.Beauvais
Calculate and return the networks parameters
calculateNetworkParameters(AFMImageNetworksAnalysis, AFMImage)
calculateNetworkParameters(AFMImageNetworksAnalysis, AFMImage)
AFMImageNetworksAnalysis |
|
AFMImage |
a |
a data.table with all the parameters
M.Beauvais
calculateNetworks
update AFMImageNetworksAnalysis
calculateNetworks(AFMImageNetworksAnalysis, AFMImage) ## S4 method for signature 'AFMImageNetworksAnalysis' calculateNetworks(AFMImageNetworksAnalysis, AFMImage)
calculateNetworks(AFMImageNetworksAnalysis, AFMImage) ## S4 method for signature 'AFMImageNetworksAnalysis' calculateNetworks(AFMImageNetworksAnalysis, AFMImage)
AFMImageNetworksAnalysis |
n |
AFMImage |
an |
M.Beauvais
calculateNetworkSkeleton
return
calculateNetworkSkeleton(AFMImage, AFMImageNetworksAnalysis)
calculateNetworkSkeleton(AFMImage, AFMImageNetworksAnalysis)
AFMImage |
an |
AFMImageNetworksAnalysis |
an |
M.Beauvais
calculateOmnidirectionalVariogram
returns the semivariance calculated for all the directions
calculate the experimental omnidirectional variogram of an AFMImage
with the variogram
function of the gstat package.
The experimental semi-variogram is used to fit (find the best sill and range) the theoretical variogram models.
With 512*512 images, it takes several minutes to calculate.
calculateOmnidirectionalVariogram(AFMImageVariogramAnalysis, AFMImage)
calculateOmnidirectionalVariogram(AFMImageVariogramAnalysis, AFMImage)
AFMImageVariogramAnalysis |
an |
AFMImage |
an |
the semivariance calculated in all the directions
M.Beauvais
## Not run: library(AFM) library(ggplot2) data(AFMImageOfRegularPeaks) variogramAnalysis<-AFMImageVariogramAnalysis(sampleFitPercentage=3.43/100) avario<-AFM::calculateOmnidirectionalVariogram(AFMImageVariogramAnalysis= variogramAnalysis, AFMImage= AFMImageOfRegularPeaks) dist<-gamma<-NULL p <- ggplot(avario, aes(x=dist, y=gamma)) p <- p + geom_point() p <- p + geom_line() p <- p + ylab("semivariance") p <- p + xlab("distance (nm)") p <- p + ggtitle("Experimental semivariogram") p ## End(Not run)
## Not run: library(AFM) library(ggplot2) data(AFMImageOfRegularPeaks) variogramAnalysis<-AFMImageVariogramAnalysis(sampleFitPercentage=3.43/100) avario<-AFM::calculateOmnidirectionalVariogram(AFMImageVariogramAnalysis= variogramAnalysis, AFMImage= AFMImageOfRegularPeaks) dist<-gamma<-NULL p <- ggplot(avario, aes(x=dist, y=gamma)) p <- p + geom_point() p <- p + geom_line() p <- p + ylab("semivariance") p <- p + xlab("distance (nm)") p <- p + ggtitle("Experimental semivariogram") p ## End(Not run)
calculate the physical distances between nodes
calculatePhysicalDistanceFromPath(pathVidVector, hscale, vscale)
calculatePhysicalDistanceFromPath(pathVidVector, hscale, vscale)
pathVidVector |
a network path |
hscale |
the hscale of the |
vscale |
the vscale of the |
the physical distance the extrmities of the path
M.Beauvais
Calculate the shortest path between all nodes of degree different to 2 that are connected with nodes of degree equal to 2 Calculate the distance between the above nodes.
calculateShortestPaths(..., AFMImageNetworksAnalysis)
calculateShortestPaths(..., AFMImageNetworksAnalysis)
... |
cl: a cluster object from the parallel package |
AFMImageNetworksAnalysis |
M.Beauvais
canBeRemoved
return
canBeRemoved(vertexId, g, allVertices, DEGREE_LIMIT_FOR_CANDIDATE_VERTICE)
canBeRemoved(vertexId, g, allVertices, DEGREE_LIMIT_FOR_CANDIDATE_VERTICE)
vertexId |
a vertex id |
g |
a igraph |
allVertices |
list of all vertices |
DEGREE_LIMIT_FOR_CANDIDATE_VERTICE |
degree |
M.Beauvais
checkIsotropy
is used to check the isotropy of an AFMImage
.
A directional variogram is calculated for various directions.
If the variogram is very similar for all the directions then the sample is isotropic.
checkIsotropy(AFMImage, AFMImageAnalyser)
checkIsotropy(AFMImage, AFMImageAnalyser)
AFMImage |
an |
AFMImageAnalyser |
an |
an AFMImageAnalyser
containing the directional variograms
M.Beauvais
## Not run: library(AFM) library(ggplot2) data(AFMImageOfAluminiumInterface) AFMImage<-extractAFMImage(AFMImageOfAluminiumInterface, 0, 0, 32) AFMImageAnalyser<-new("AFMImageAnalyser", AFMImage= AFMImage, fullfilename = AFMImage@fullfilename) AFMImageAnalyser<-checkIsotropy(AFMImage,AFMImageAnalyser) varios<-AFMImageAnalyser@variogramAnalysis@directionalVariograms p2 <- ggplot(varios, aes(x=dist, y=gamma, color= as.factor(dir.hor), shape=as.factor(dir.hor))) p2 <- p2 + expand_limits(y = 0) p2 <- p2 + geom_point() p2 <- p2 + geom_line() p2 <- p2 + ylab("semivariance (nm^2)") p2 <- p2 + xlab("distance (nm)") p2 <- p2 + ggtitle("Directional") p2 ## End(Not run)
## Not run: library(AFM) library(ggplot2) data(AFMImageOfAluminiumInterface) AFMImage<-extractAFMImage(AFMImageOfAluminiumInterface, 0, 0, 32) AFMImageAnalyser<-new("AFMImageAnalyser", AFMImage= AFMImage, fullfilename = AFMImage@fullfilename) AFMImageAnalyser<-checkIsotropy(AFMImage,AFMImageAnalyser) varios<-AFMImageAnalyser@variogramAnalysis@directionalVariograms p2 <- ggplot(varios, aes(x=dist, y=gamma, color= as.factor(dir.hor), shape=as.factor(dir.hor))) p2 <- p2 + expand_limits(y = 0) p2 <- p2 + geom_point() p2 <- p2 + geom_line() p2 <- p2 + ylab("semivariance (nm^2)") p2 <- p2 + xlab("distance (nm)") p2 <- p2 + ggtitle("Directional") p2 ## End(Not run)
checkNormality
performs a visual check to know if the distribution of heights of an AFMImage
follows a normal distribution. The function displays Quantile/Quantile and distribution plots.
checkNormality(..., AFMImage)
checkNormality(..., AFMImage)
... |
pngfullfilename (optional): directory and filename to save the visual check to png or pdffullfilename(optional): directory and filename to save the visual check to pdf |
AFMImage |
an |
M.Beauvais
Olea2006, Ricardo A. Olea "A six-step practical approach to semivariogram modeling", 2006, "Stochastic Environmental Research and Risk Assessment, Volume 20, Issue 5 , pp 307-318"
## Not run: library(AFM) # display Quantile/Quantile and distribution plots. data(AFMImageOfNormallyDistributedHeights) checkNormality(AFMImage= AFMImageOfNormallyDistributedHeights) # display and save on disk Quantile/Quantile and distribution plots. data(AFMImageOfNormallyDistributedHeights) checkNormality(AFMImage= AFMImageOfNormallyDistributedHeights, pngfullfilename=paste(tempdir(), "checkNormality.png", sep="/")) ## End(Not run)
## Not run: library(AFM) # display Quantile/Quantile and distribution plots. data(AFMImageOfNormallyDistributedHeights) checkNormality(AFMImage= AFMImageOfNormallyDistributedHeights) # display and save on disk Quantile/Quantile and distribution plots. data(AFMImageOfNormallyDistributedHeights) checkNormality(AFMImage= AFMImageOfNormallyDistributedHeights, pngfullfilename=paste(tempdir(), "checkNormality.png", sep="/")) ## End(Not run)
create the igraph weighted graph from the nodes and edges
createGraph(AFMImageNetworksAnalysis)
createGraph(AFMImageNetworksAnalysis)
AFMImageNetworksAnalysis |
M.Beauvais
display network
displayColoredNetworkWithVerticesSize(AFMImageNetworksAnalysis, fullfilename)
displayColoredNetworkWithVerticesSize(AFMImageNetworksAnalysis, fullfilename)
AFMImageNetworksAnalysis |
|
fullfilename |
a directory plus filename for export |
M.Beauvais
display the network of nodes and edges
displaygridIgraphPlot(AFMImageNetworksAnalysis)
displaygridIgraphPlot(AFMImageNetworksAnalysis)
AFMImageNetworksAnalysis |
M.Beauvais
display the network of nodes and edges
displaygridIgraphPlotFromEdges(AFMImage, edges, isolates)
displaygridIgraphPlotFromEdges(AFMImage, edges, isolates)
AFMImage |
an |
edges |
list of edges |
isolates |
list of isolated edges |
M.Beauvais
Display a 3D image of the holes in an AFMImage and store it on disk if fullfilename variable is set.
It uses the rgl
package.
displayHolesIn3D(AFMImage, width, fullfilename, changeViewpoint, noLight)
displayHolesIn3D(AFMImage, width, fullfilename, changeViewpoint, noLight)
AFMImage |
the AFM image to be displayed in three dimensions. |
width |
(optional) width of the image. Default is 512 pixels. Note: width can't be superior to screen resolution. |
fullfilename |
(optional) the directory and filename to save the png of the 3D image. If this variable is missing, the function will not save on disk the 3D image. |
changeViewpoint |
(optional) if TRUE, the viewpoint is changed. Default is TRUE. |
noLight |
if TRUE, the ligth is set off |
M.Beauvais
Display a 3D image of an AFMImage and store it on disk if fullfilename variable is set.
It uses the rgl
package.
displayIn3D(AFMImage, width, fullfilename, changeViewpoint, noLight)
displayIn3D(AFMImage, width, fullfilename, changeViewpoint, noLight)
AFMImage |
the AFM image to be displayed in three dimensions. |
width |
(optional) width of the image. Default is 512 pixels. Note: width can't be superior to screen resolution. |
fullfilename |
(optional) the directory and filename to save the png of the 3D image. If this variable is missing, the function will not save on disk the 3D image. |
changeViewpoint |
(optional) if TRUE, the viewpoint is changed. Default is TRUE. |
noLight |
if TRUE, the ligth is set off |
M.Beauvais
dnormalmix density of a mixture of normals
dnormalmix(x, mixture, log = FALSE)
dnormalmix(x, mixture, log = FALSE)
x |
a vector of quantiles |
mixture |
a gaussian mixture |
log |
perform a log transsformation of the result |
evaluateVariogramModels method to evaluate the basic variogram models available in the gstat
package
A AFMImageVariogramAnalysis
method to handle the variogram analysis of an AFMImage
.
The variogram models used can be seen with the show.vgms() function from the gstat
package.
evaluateVariogramModels(AFMImageVariogramAnalysis, AFMImage) ## S4 method for signature 'AFMImageVariogramAnalysis' evaluateVariogramModels(AFMImageVariogramAnalysis, AFMImage)
evaluateVariogramModels(AFMImageVariogramAnalysis, AFMImage) ## S4 method for signature 'AFMImageVariogramAnalysis' evaluateVariogramModels(AFMImageVariogramAnalysis, AFMImage)
AFMImageVariogramAnalysis |
an object |
AFMImage |
an |
## Not run: library(AFM) data("AFMImageOfRegularPeaks") # take an extract of the image to fasten the calculation AFMImage<-extractAFMImage(AFMImageOfRegularPeaks, 40, 40, 32) # e.g. AFMImage@fullfilename<-"/users/ubuntu/AFMImageOfRegularPeaks-extract.txt" AFMImage@fullfilename<-paste(tempdir(), "AFMImageOfRegularPeaks-extract.txt", sep="/") AFMImageAnalyser<-AFMImageAnalyser(AFMImage) # Variogram analysis sampleFitPercentage<-3.43/100 variogramAnalysis<-AFMImageVariogramAnalysis(sampleFitPercentage) variogramAnalysis@omnidirectionalVariogram<- AFM::calculateOmnidirectionalVariogram(AFMImage=AFMImage, AFMImageVariogramAnalysis=variogramAnalysis) variogramAnalysis@directionalVariograms<- AFM::calculateDirectionalVariograms(AFMImage=AFMImage, AFMImageVariogramAnalysis=variogramAnalysis) # manage model evaluations AFMImageVariogram<-variogramAnalysis@omnidirectionalVariogram class(AFMImageVariogram)=c("gstatVariogram","data.frame") variogramAnalysis<-evaluateVariogramModels(variogramAnalysis, AFMImage) mergedDT<-getDTModelEvaluation(variogramAnalysis) mergedDT sillRangeDT<-getDTModelSillRange(variogramAnalysis) sillRangeDT ## End(Not run)
## Not run: library(AFM) data("AFMImageOfRegularPeaks") # take an extract of the image to fasten the calculation AFMImage<-extractAFMImage(AFMImageOfRegularPeaks, 40, 40, 32) # e.g. AFMImage@fullfilename<-"/users/ubuntu/AFMImageOfRegularPeaks-extract.txt" AFMImage@fullfilename<-paste(tempdir(), "AFMImageOfRegularPeaks-extract.txt", sep="/") AFMImageAnalyser<-AFMImageAnalyser(AFMImage) # Variogram analysis sampleFitPercentage<-3.43/100 variogramAnalysis<-AFMImageVariogramAnalysis(sampleFitPercentage) variogramAnalysis@omnidirectionalVariogram<- AFM::calculateOmnidirectionalVariogram(AFMImage=AFMImage, AFMImageVariogramAnalysis=variogramAnalysis) variogramAnalysis@directionalVariograms<- AFM::calculateDirectionalVariograms(AFMImage=AFMImage, AFMImageVariogramAnalysis=variogramAnalysis) # manage model evaluations AFMImageVariogram<-variogramAnalysis@omnidirectionalVariogram class(AFMImageVariogram)=c("gstatVariogram","data.frame") variogramAnalysis<-evaluateVariogramModels(variogramAnalysis, AFMImage) mergedDT<-getDTModelEvaluation(variogramAnalysis) mergedDT sillRangeDT<-getDTModelSillRange(variogramAnalysis) sillRangeDT ## End(Not run)
existsEdge
return TRUE if an edge exists for this vertex id
existsEdge(AFMImage, vertexId)
existsEdge(AFMImage, vertexId)
AFMImage |
an |
vertexId |
the vertex id |
M.Beauvais
existsSegment
return a boolean
existsSegment(AFMImage, segment)
existsSegment(AFMImage, segment)
AFMImage |
a |
segment |
a data.table coming from the getBresenham2Dsegment - x and y should start from 1,1 #TODO Segment class |
TRUE if all the heights of the segment are different from zero
M.Beauvais
Export an AFMImage
as a STL format file thanks to the rgl
package. The STL file can be used as an input for a 3D printing software tool.
exportToSTL is compatible with slicr (http://slic3r.org) version 1.2.9 (GPL v3 licence).
In order to 3D print the AFM Image with slic3r, do as following:
Use "File> Repair STL file..." menu option to create a file with the obj extension.
Use "Add" button below the menu to display your AFM Image on the print board
Right click on your AFM image. Use "Scale> uniformely" option, Set "15
exportToSTL(AFMImage3DModelAnalysis, AFMImage, stlfullfilename)
exportToSTL(AFMImage3DModelAnalysis, AFMImage, stlfullfilename)
AFMImage3DModelAnalysis |
|
AFMImage |
an |
stlfullfilename |
directory and filename to save as a stl file |
M.Beauvais
## Not run: library(AFM) data("AFMImageOfRegularPeaks") AFMImage<-AFMImageOfRegularPeaks # calculate the 3D model : surface and the faces AFMImage3DModelAnalysis<-new ("AFMImage3DModelAnalysis") AFMImage3DModelAnalysis<-calculate3DModel(AFMImage3DModelAnalysis= AFMImage3DModelAnalysis, AFMImage= AFMImage) # export the 3D model to file exportDirectory=tempdir() print(paste("saving model in ", exportDirectory)) exportToSTL(AFMImage3DModelAnalysis=AFMImage3DModelAnalysis, AFMImage=AFMImage, stlfullfilename=paste(exportDirectory, "myFile.stl", sep="/")) ## End(Not run)
## Not run: library(AFM) data("AFMImageOfRegularPeaks") AFMImage<-AFMImageOfRegularPeaks # calculate the 3D model : surface and the faces AFMImage3DModelAnalysis<-new ("AFMImage3DModelAnalysis") AFMImage3DModelAnalysis<-calculate3DModel(AFMImage3DModelAnalysis= AFMImage3DModelAnalysis, AFMImage= AFMImage) # export the 3D model to file exportDirectory=tempdir() print(paste("saving model in ", exportDirectory)) exportToSTL(AFMImage3DModelAnalysis=AFMImage3DModelAnalysis, AFMImage=AFMImage, stlfullfilename=paste(exportDirectory, "myFile.stl", sep="/")) ## End(Not run)
The extract will be a square of the specified size.
If the size is too large for the original AFMImage
, only the biggest valid size will be kept.
extractAFMImage(AFMImage, cornerX, cornerY, size)
extractAFMImage(AFMImage, cornerX, cornerY, size)
AFMImage |
an |
cornerX |
horizontal coordinates of the extract |
cornerY |
vertical coordinates of the extract |
size |
square size of the extract in number of pixels |
extractAFMImage
returns an extract of the AFMImage
a new AFMImage
sample
M.Beauvais
## Not run: data(AFMImageOfAluminiumInterface) anAFMImageExtract<-extractAFMImage(AFMImageOfAluminiumInterface,15,15,256) ## End(Not run)
## Not run: data(AFMImageOfAluminiumInterface) anAFMImageExtract<-extractAFMImage(AFMImageOfAluminiumInterface,15,15,256) ## End(Not run)
filterAFMImage
returns a filtered AFMImage
filterAFMImage(AFMImage, Min, Max)
filterAFMImage(AFMImage, Min, Max)
AFMImage |
an |
Min |
the minimun height value to keep |
Max |
the maximun height value to keep |
an AFMImage
M.Beauvais
manage the fusion of nodes which circles instersect keep all the circles, manage a fusion table node id / fusion id
fusionCloseNodes(AFMImageNetworksAnalysis)
fusionCloseNodes(AFMImageNetworksAnalysis)
AFMImageNetworksAnalysis |
the AFMImageNetworksAnalysis instance |
a list of edges with fusioned nodes
M.Beauvais
generateAFMImageReport
generates a report from an AFMImageAnalyser object
generateAFMImageReport(AFMImageAnalyser, reportFullfilename, isCheckReport)
generateAFMImageReport(AFMImageAnalyser, reportFullfilename, isCheckReport)
AFMImageAnalyser |
an |
reportFullfilename |
location on disk where to save the generated report |
isCheckReport |
TRUE to generate a check report must be generated, FALSE to generate a full report |
M.Beauvais
Generate a check report in pdf format in order to analyse the distribution and the isotropy of heights of the AFMImage
.
generateCheckReport(AFMImage)
generateCheckReport(AFMImage)
AFMImage |
an |
M.Beauvais
## Not run: library(AFM) # Analyse the AFMImageOfRegularPeaks AFMImage sample from this package data("AFMImageOfRegularPeaks") AFMImage<-AFMImageOfRegularPeaks # exportDirectory="C:/Users/my_windows_login" or exportDirectory="/home/ubuntu" exportDirectory=tempdir() AFMImage@fullfilename<-paste(exportDirectory,"AFMImageOfRegularPeaks.txt",sep="/") # Start to check if your sample is normaly distributed and isotropic. generateCheckReport(AFMImage) # If the sample is normaly distributed and isotropic, generate a full report generateReport(AFMImage) # Analyse your own AFM image from nanoscope analysis (TM) software tool anotherAFMImage<-importFromNanoscope("c:/users/me/myimage.txt") # Start to check if your sample is normaly distributed and isotropic. generateCheckReport(anotherAFMImage) # If your sample is normaly distributed and isotropic, generate a full report generateReport(anotherAFMImage) ## End(Not run)
## Not run: library(AFM) # Analyse the AFMImageOfRegularPeaks AFMImage sample from this package data("AFMImageOfRegularPeaks") AFMImage<-AFMImageOfRegularPeaks # exportDirectory="C:/Users/my_windows_login" or exportDirectory="/home/ubuntu" exportDirectory=tempdir() AFMImage@fullfilename<-paste(exportDirectory,"AFMImageOfRegularPeaks.txt",sep="/") # Start to check if your sample is normaly distributed and isotropic. generateCheckReport(AFMImage) # If the sample is normaly distributed and isotropic, generate a full report generateReport(AFMImage) # Analyse your own AFM image from nanoscope analysis (TM) software tool anotherAFMImage<-importFromNanoscope("c:/users/me/myimage.txt") # Start to check if your sample is normaly distributed and isotropic. generateCheckReport(anotherAFMImage) # If your sample is normaly distributed and isotropic, generate a full report generateReport(anotherAFMImage) ## End(Not run)
generate a convex polygon from circles
generatePolygonEnvelope(AFMImageNetworksAnalysis, centers, radius)
generatePolygonEnvelope(AFMImageNetworksAnalysis, centers, radius)
AFMImageNetworksAnalysis |
|
centers |
a matrix ? |
radius |
a vector of radius |
a polygon
M.Beauvais
A function to analyse an AFMImage
and save on disk the analysis. The analysis are saved in outputs directory located in the image directory.
All the rdata and image files in the reportDirectory directory are loaded to generate one report for one AFMImage
.
generateReport(AFMImage)
generateReport(AFMImage)
AFMImage |
an |
M.Beauvais
## Not run: library(AFM) # Analyse the AFMImageOfRegularPeaks AFMImage sample from this package data("AFMImageOfRegularPeaks") AFMImage<-AFMImageOfRegularPeaks # exportDirectory="C:/Users/my_windows_login" or exportDirectory="/home/ubuntu" exportDirectory=tempdir() AFMImage@fullfilename<-paste(exportDirectory,"AFMImageOfRegularPeaks.txt",sep="/") # Start to check if your sample is normaly distributed and isotropic. generateCheckReport(AFMImage) # If the sample is normaly distributed and isotropic, generate a full report generateReport(AFMImage) # Analyse your own AFM image from nanoscope analysis (TM) software tool anotherAFMImage<-importFromNanoscope("c:/users/my_windows_login/myimage.txt") # Start to check if your sample is normaly distributed and isotropic. generateCheckReport(anotherAFMImage) # If your sample is normaly distributed and isotropic, generate a full report generateReport(anotherAFMImage) ## End(Not run)
## Not run: library(AFM) # Analyse the AFMImageOfRegularPeaks AFMImage sample from this package data("AFMImageOfRegularPeaks") AFMImage<-AFMImageOfRegularPeaks # exportDirectory="C:/Users/my_windows_login" or exportDirectory="/home/ubuntu" exportDirectory=tempdir() AFMImage@fullfilename<-paste(exportDirectory,"AFMImageOfRegularPeaks.txt",sep="/") # Start to check if your sample is normaly distributed and isotropic. generateCheckReport(AFMImage) # If the sample is normaly distributed and isotropic, generate a full report generateReport(AFMImage) # Analyse your own AFM image from nanoscope analysis (TM) software tool anotherAFMImage<-importFromNanoscope("c:/users/my_windows_login/myimage.txt") # Start to check if your sample is normaly distributed and isotropic. generateCheckReport(anotherAFMImage) # If your sample is normaly distributed and isotropic, generate a full report generateReport(anotherAFMImage) ## End(Not run)
A function to generate a pdf report for each AFMImage
in a directory. Images should be in export Nanoscope format as the importFromNanoscope
function will be used.
generateReportFromNanoscopeImageDirectory(imageDirectory, imageNumber)
generateReportFromNanoscopeImageDirectory(imageDirectory, imageNumber)
imageDirectory |
a directory where are located image as Nanoscope export format |
imageNumber |
(optional) an image number in the directory. If it is set only the selected image will be processed. |
M.Beauvais
## Not run: library(AFM) # A report will be generated for all the images in imageDirectory directory # imageDirectory="c:/images" imageDirectory=tempdir() exit<-generateReportFromNanoscopeImageDirectory(imageDirectory) # A report will be generated for the fifth image in the imageDirectory directory exit<-generateReportFromNanoscopeImageDirectory(imageDirectory,5) ## End(Not run)
## Not run: library(AFM) # A report will be generated for all the images in imageDirectory directory # imageDirectory="c:/images" imageDirectory=tempdir() exit<-generateReportFromNanoscopeImageDirectory(imageDirectory) # A report will be generated for the fifth image in the imageDirectory directory exit<-generateReportFromNanoscopeImageDirectory(imageDirectory,5) ## End(Not run)
get 3D image full filename
get3DImageFullfilename(exportDirectory, imageName)
get3DImageFullfilename(exportDirectory, imageName)
exportDirectory |
a diretcory to export image |
imageName |
the image name |
M.Beauvais
get the points inside envelope
getAllPointsToRemove(AFMImageNetworksAnalysis, envelope)
getAllPointsToRemove(AFMImageNetworksAnalysis, envelope)
AFMImageNetworksAnalysis |
|
envelope |
an envelope of points ? |
a data.table of points
M.Beauvais
calculate the angle between two vectors
getAngle(x, y)
getAngle(x, y)
x |
a vector |
y |
a vector |
the angle between the vectors
M.Beauvais
getAutoIntersectionForOmnidirectionalVariogram
returns the slope in the omnidirectional variogramsCalculate slopes and intersections in variogram
getAutoIntersectionForOmnidirectionalVariogram
returns the slope in the omnidirectional variograms
getAutoIntersectionForOmnidirectionalVariogram(AFMImageAnalyser)
getAutoIntersectionForOmnidirectionalVariogram(AFMImageAnalyser)
AFMImageAnalyser |
M.Beauvais
getAutoIntersectionForRoughnessAgainstLengthscale
get the intersection between tangente and plateau
getAutoIntersectionForRoughnessAgainstLengthscale( AFMImageAnalyser, second_slope = FALSE )
getAutoIntersectionForRoughnessAgainstLengthscale( AFMImageAnalyser, second_slope = FALSE )
AFMImageAnalyser |
an |
second_slope |
a boolean to manage first or second slope in the roughness against lenghtscale curve |
M.Beauvais
calculate a width to be used for experimental variogram calculation in order to generate a line instead of a cloud of points. If the chosen width is too small, the experimental variogram will be a cloud of points instead of a line.
getAutomaticWidthForVariogramCalculation(AFMImage)
getAutomaticWidthForVariogramCalculation(AFMImage)
AFMImage |
an |
getAutomaticWidthForVariogramCalculation
returns the width to be used for variogram calculation
the smallest width to be used for variogram calculation
M.Beauvais
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) print(getAutomaticWidthForVariogramCalculation(AFMImageOfAluminiumInterface)) ## End(Not run)
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) print(getAutomaticWidthForVariogramCalculation(AFMImageOfAluminiumInterface)) ## End(Not run)
getBresenham2DSegment
return the Bresenham segment in 2D from extremities coordinates
getBresenham2DSegment(x1, y1, x2, y2)
getBresenham2DSegment(x1, y1, x2, y2)
x1 |
abscissa coordinates of the first point |
y1 |
ordinate coordinates of the first point |
x2 |
abscissa coordinates of the second point |
y2 |
ordinate coordinates of the second point |
a data.table of points - data.table(x, y)
M.Beauvais
get the spatial points on the circle including the center of the circle
getCircleSpatialPoints(binaryAFMImage, center, circleRadius)
getCircleSpatialPoints(binaryAFMImage, center, circleRadius)
binaryAFMImage |
a binary |
center |
the center of the circle with center$lon as the x coordinates and center$lat as the y coordinates |
circleRadius |
the radius of the circle |
a SpatialPoints
object of all the points of the circle including the center of the circle
M.Beauvais
getCoordinatesFromVertexId
return a list x,y coordinates
getCoordinatesFromVertexId(vId)
getCoordinatesFromVertexId(vId)
vId |
the vertex id |
M.Beauvais
getDTModelEvaluation method
getDTModelEvaluation(AFMImageVariogramAnalysis) ## S4 method for signature 'AFMImageVariogramAnalysis' getDTModelEvaluation(AFMImageVariogramAnalysis)
getDTModelEvaluation(AFMImageVariogramAnalysis) ## S4 method for signature 'AFMImageVariogramAnalysis' getDTModelEvaluation(AFMImageVariogramAnalysis)
AFMImageVariogramAnalysis |
an AFMImageVariogramAnalysis object |
getDTModelSillRange method
getDTModelSillRange(AFMImageVariogramAnalysis) ## S4 method for signature 'AFMImageVariogramAnalysis' getDTModelSillRange(AFMImageVariogramAnalysis)
getDTModelSillRange(AFMImageVariogramAnalysis) ## S4 method for signature 'AFMImageVariogramAnalysis' getDTModelSillRange(AFMImageVariogramAnalysis)
AFMImageVariogramAnalysis |
an AFMImageVariogramAnalysis object |
getFractalDimensions
calculates fractal dimensions and scales of an AFMImage
with the fd.estim.method from the fractaldim
package.
getFractalDimensions(AFMImage, AFMImageFractalDimensionsAnalysis)
getFractalDimensions(AFMImage, AFMImageFractalDimensionsAnalysis)
AFMImage |
an |
AFMImageFractalDimensionsAnalysis |
an |
a list of AFMImageFractalDimensionMethod
objects with the calculated fractal dimensions and scales
M.Beauvais
Gneiting2012, Tilmann Gneiting, Hana Sevcikova and Donald B. Percival 'Estimators of Fractal Dimension: Assessing the Roughness of Time Series and Spatial Data - Statistics in statistical Science, 2012, Vol. 27, No. 2, 247-277'
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) print(getFractalDimensions(AFMImageOfAluminiumInterface)) ## End(Not run)
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) print(getFractalDimensions(AFMImageOfAluminiumInterface)) ## End(Not run)
getHolesStatistics
returns a binary AFMImage
getHolesStatistics(AFMImage)
getHolesStatistics(AFMImage)
AFMImage |
an |
an AFMImage
M.Beauvais
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) newAFMImage<-copy(AFMImageOfAluminiumInterface) displayIn3D(newAFMImage,noLight=TRUE) newAFMImage<-multiplyHeightsAFMImage(newAFMImage, multiplier=2) displayIn3D(newAFMImage,noLight=TRUE) newAFMImage<-filterAFMImage(newAFMImage, Min=140, Max=300) displayIn3D(newAFMImage,noLight=TRUE) newAFMImage<-makeBinaryAFMImage(newAFMImage) displayIn3D(newAFMImage,noLight=TRUE) holesStats<-getHolesStatistics(newAFMImage) print(holesStats) ## End(Not run)
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) newAFMImage<-copy(AFMImageOfAluminiumInterface) displayIn3D(newAFMImage,noLight=TRUE) newAFMImage<-multiplyHeightsAFMImage(newAFMImage, multiplier=2) displayIn3D(newAFMImage,noLight=TRUE) newAFMImage<-filterAFMImage(newAFMImage, Min=140, Max=300) displayIn3D(newAFMImage,noLight=TRUE) newAFMImage<-makeBinaryAFMImage(newAFMImage) displayIn3D(newAFMImage,noLight=TRUE) holesStats<-getHolesStatistics(newAFMImage) print(holesStats) ## End(Not run)
getIntersectionForRoughnessAgainstLengthscale
get the intersection between tangente and plateau
getIntersectionForRoughnessAgainstLengthscale( AFMImageAnalyser, minValue, maxValue, second_slope = FALSE )
getIntersectionForRoughnessAgainstLengthscale( AFMImageAnalyser, minValue, maxValue, second_slope = FALSE )
AFMImageAnalyser |
an |
minValue |
index of the lowest point to be used for the tangent |
maxValue |
index of the highest point to be used for the tangent |
second_slope |
a boolean to manage first or second slope in the roughness against lenghtscale curve |
M.Beauvais
getIntersectionPointWithBorder
return a data.table
getIntersectionPointWithBorder(AFMImage, center, r, deg)
getIntersectionPointWithBorder(AFMImage, center, r, deg)
AFMImage |
a |
center |
center |
r |
radius |
deg |
degree |
M.Beauvais
getListOfDiameters
return
getListOfDiameters(g)
getListOfDiameters(g)
g |
list of igraph networks |
M.Beauvais
getLogLogOmnidirectionalSlopeGraph
returns Get the graph of the Log Log omnidirectional variogramGet the graph of the Log Log omnidiretction variogram
getLogLogOmnidirectionalSlopeGraph
returns Get the graph of the Log Log omnidirectional variogram
getLogLogOmnidirectionalSlopeGraph(AFMImageAnalyser, withFratcalSlope = FALSE)
getLogLogOmnidirectionalSlopeGraph(AFMImageAnalyser, withFratcalSlope = FALSE)
AFMImageAnalyser |
|
withFratcalSlope |
a boolean to indicate if the graph should contain a line representating the slope for the calculation of the fractal index and topothesy |
a ggplot2 graph
M.Beauvais
## Not run: library(AFM) library(ggplot2) data(AFMImageOfRegularPeaks) AFMImageAnalyser = new("AFMImageAnalyser", fullfilename="/home/ubuntu/AFMImageOfRegularPeaks-Analyser.txt") variogramAnalysis<-AFMImageVariogramAnalysis(sampleFitPercentage=3.43/100) AFMImageAnalyser@variogramAnalysis<-variogramAnalysis AFMImageAnalyser@variogramAnalysis@omnidirectionalVariogram<- calculateOmnidirectionalVariogram(AFMImage= AFMImageOfRegularPeaks, AFMImageVariogramAnalysis= variogramAnalysis) p<-getLogLogOmnidirectionalSlopeGraph(AFMImageAnalyser, withFratcalSlope=TRUE) p ## End(Not run)
## Not run: library(AFM) library(ggplot2) data(AFMImageOfRegularPeaks) AFMImageAnalyser = new("AFMImageAnalyser", fullfilename="/home/ubuntu/AFMImageOfRegularPeaks-Analyser.txt") variogramAnalysis<-AFMImageVariogramAnalysis(sampleFitPercentage=3.43/100) AFMImageAnalyser@variogramAnalysis<-variogramAnalysis AFMImageAnalyser@variogramAnalysis@omnidirectionalVariogram<- calculateOmnidirectionalVariogram(AFMImage= AFMImageOfRegularPeaks, AFMImageVariogramAnalysis= variogramAnalysis) p<-getLogLogOmnidirectionalSlopeGraph(AFMImageAnalyser, withFratcalSlope=TRUE) p ## End(Not run)
for each pixel of the image, if the pixel is not empty try to place one circle start with biggets circle as soon as a circle is found the circle, the pixel is associated with with the circle raidus
getMaxCircleMatrix(..., newCircleAFMImage, CIRCLE_RADIUS_INIT)
getMaxCircleMatrix(..., newCircleAFMImage, CIRCLE_RADIUS_INIT)
... |
cl: a cluster object from the parallel package |
newCircleAFMImage |
a |
CIRCLE_RADIUS_INIT |
CIRCLE_RADIUS_INIT |
res a matrix
M.Beauvais
getNetworkGridLayout
return a list x,y coordinates
getNetworkGridLayout(AFMImage, vId)
getNetworkGridLayout(AFMImage, vId)
AFMImage |
an |
vId |
the vertex id |
M.Beauvais
Get basic network parameters :
Total root mean square Roughness or Total Rrms or totalRMSRoughness_TotalRrms
Mean roughness or Ra or MeanRoughness_Ra
getNetworkParameters(AFMImageNetworksAnalysis, AFMImage) ## S4 method for signature 'AFMImageNetworksAnalysis' getNetworkParameters(AFMImageNetworksAnalysis, AFMImage)
getNetworkParameters(AFMImageNetworksAnalysis, AFMImage) ## S4 method for signature 'AFMImageNetworksAnalysis' getNetworkParameters(AFMImageNetworksAnalysis, AFMImage)
AFMImageNetworksAnalysis |
|
AFMImage |
an |
getNetworkParameters
returns a data.table of network parameters
a data.table of network parameters:
totalNumberOfNodes the total number of nodes with degree different of 2
totalNumberOfNodesWithDegreeTwoOrMore the total number of nodes with degree 2 or more
totalNumberOfNodesWithDegreeOne the total number of nodes with degree one
numberOfNodesPerArea the total number of nodes with degree diffrent of 2 per area
numberOfNodesPerSurfaceArea the total number of nodes with degree diffrent of 2 per surface area
MeanPhysicalDistanceBetweenNodes the mean physical distance between nodes of degree different of two
M.Beauvais
## Not run: library(AFM) library(parallel) data(AFMImageCollagenNetwork) AFMImage<-AFMImageCollagenNetwork AFMIA = new("AFMImageNetworksAnalysis") AFMIA@heightNetworksslider=10 AFMIA@filterNetworkssliderMin=150 AFMIA@filterNetworkssliderMax=300 AFMIA@smallBranchesTreatment=TRUE clExist<-TRUE cl <- makeCluster(2,outfile="") AFMIA<-transformAFMImageForNetworkAnalysis(AFMImageNetworksAnalysis=AFMIA,AFMImage= AFMImage) AFMIA<-identifyNodesAndEdges(cl=cl,AFMImageNetworksAnalysis= AFMIA,maxHeight= 300) AFMIA<-identifyEdgesFromCircles(cl=cl,AFMImageNetworksAnalysis= AFMIA, MAX_DISTANCE = 75) AFMIA<-identifyIsolatedNodes(AFMIA) AFMIA<-createGraph(AFMIA) AFMIA<-calculateShortestPaths(cl=cl, AFMImageNetworksAnalysis=AFMIA) AFMIA<-calculateNetworkParameters(AFMImageNetworksAnalysis=AFMIA, AFMImage=AFMImage) AFMIA<-calculateHolesCharacteristics(AFMImageNetworksAnalysis=AFMIA) stopCluster(cl) ## End(Not run)
## Not run: library(AFM) library(parallel) data(AFMImageCollagenNetwork) AFMImage<-AFMImageCollagenNetwork AFMIA = new("AFMImageNetworksAnalysis") AFMIA@heightNetworksslider=10 AFMIA@filterNetworkssliderMin=150 AFMIA@filterNetworkssliderMax=300 AFMIA@smallBranchesTreatment=TRUE clExist<-TRUE cl <- makeCluster(2,outfile="") AFMIA<-transformAFMImageForNetworkAnalysis(AFMImageNetworksAnalysis=AFMIA,AFMImage= AFMImage) AFMIA<-identifyNodesAndEdges(cl=cl,AFMImageNetworksAnalysis= AFMIA,maxHeight= 300) AFMIA<-identifyEdgesFromCircles(cl=cl,AFMImageNetworksAnalysis= AFMIA, MAX_DISTANCE = 75) AFMIA<-identifyIsolatedNodes(AFMIA) AFMIA<-createGraph(AFMIA) AFMIA<-calculateShortestPaths(cl=cl, AFMImageNetworksAnalysis=AFMIA) AFMIA<-calculateNetworkParameters(AFMImageNetworksAnalysis=AFMIA, AFMImage=AFMImage) AFMIA<-calculateHolesCharacteristics(AFMImageNetworksAnalysis=AFMIA) stopCluster(cl) ## End(Not run)
Get the Nyquist spatial frequency of an AFMImage
calculated as following:
0.5 multiplied by the minimum between the horizontal scansize divided by the number of samples per line and the vertical scansize divided by the number of lines
getNyquistSpatialFrequency(AFMImage) ## S4 method for signature 'AFMImage' getNyquistSpatialFrequency(AFMImage)
getNyquistSpatialFrequency(AFMImage) ## S4 method for signature 'AFMImage' getNyquistSpatialFrequency(AFMImage)
AFMImage |
an |
getNyquistSpatialFrequency
returns the Nyquist spatial frequency as a numeric
the Nyquist spatial frequency of the AFMImage
M.Beauvais
## Not run: library(AFM) data(AFMImageOfNormallyDistributedHeights) NyquistSpatialFrequency<-getNyquistSpatialFrequency(AFMImageOfNormallyDistributedHeights) print(NyquistSpatialFrequency) ## End(Not run)
## Not run: library(AFM) data(AFMImageOfNormallyDistributedHeights) NyquistSpatialFrequency<-getNyquistSpatialFrequency(AFMImageOfNormallyDistributedHeights) print(NyquistSpatialFrequency) ## End(Not run)
Get a zero padded AFMImage
useful in Power Spectral Density analysis. The original AFMImage
is padded with zero in order to get a larger square AFMImage which size is a power of 2.
getPaddedAFMImage(AFMImage)
getPaddedAFMImage(AFMImage)
AFMImage |
an |
a zero-padded AFMImage
with a fullfilename equals to the original fullfilename pasted with padded-to-"ScanSize".txt
M.Beauvais
## Not run: library(AFM) data(AFMImageOfNormallyDistributedHeights) paddedAFMImage<-getPaddedAFMImage(AFMImageOfNormallyDistributedHeights) displayIn3D(AFMImage= paddedAFMImage, width= 1024,noLight=TRUE) ## End(Not run)
## Not run: library(AFM) data(AFMImageOfNormallyDistributedHeights) paddedAFMImage<-getPaddedAFMImage(AFMImageOfNormallyDistributedHeights) displayIn3D(AFMImage= paddedAFMImage, width= 1024,noLight=TRUE) ## End(Not run)
Get basic roughness parameters as amplitude parameters:
Total root mean square Roughness or Total Rrms or totalRMSRoughness_TotalRrms
Mean roughness or Ra or MeanRoughness_Ra
getRoughnessParameters(AFMImage) ## S4 method for signature 'AFMImage' getRoughnessParameters(AFMImage)
getRoughnessParameters(AFMImage) ## S4 method for signature 'AFMImage' getRoughnessParameters(AFMImage)
AFMImage |
an |
getRoughnessParameters
returns a data.table of roughness parameters
a data.table of roughness parameters:
totalRMSRoughness_TotalRrms the total RMS Roughness as the square root of the variance of heights
MeanRoughness_Ra the average roughness as the mean of absolute value of heights
M.Beauvais
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) roughnessParameters<-getRoughnessParameters(AFMImageOfAluminiumInterface) print(roughnessParameters) ## End(Not run)
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) roughnessParameters<-getRoughnessParameters(AFMImageOfAluminiumInterface) print(roughnessParameters) ## End(Not run)
get a Lattice (trellis) plot of an AFMImage
using the spplot
method of the sp package.
This function is used to evaluate visually the quality of the predicted surface when a variogram model is used.
getSpplotFromAFMImage(AFMImage, expectedWidth, expectHeight, withoutLegend)
getSpplotFromAFMImage(AFMImage, expectedWidth, expectHeight, withoutLegend)
AFMImage |
an |
expectedWidth |
(optional) expected width of the saved image. Default is 400px. |
expectHeight |
(optional) expected height of the saved image. Default is 300px. |
withoutLegend |
(optional) set at FALSE, the cuts legend will be included in the plot. Default is FALSE. |
getSpplotFromAFMImage
get a Lattice (trellis) plot of an AFMImage
on disk
M.Beauvais
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) p<-getSpplotFromAFMImage(AFMImageOfAluminiumInterface, 800,800, TRUE) print(p) ## End(Not run)
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) p<-getSpplotFromAFMImage(AFMImageOfAluminiumInterface, 800,800, TRUE) print(p) ## End(Not run)
getSurroundingVertexesList
return the vertexId
getSurroundingVertexesList(AFMImage, x, y)
getSurroundingVertexesList(AFMImage, x, y)
AFMImage |
an |
x |
coordinates in x axis |
y |
coordinates in y axis |
M.Beauvais
getTopologyAFMImage
return the global topological distance
getTopologyAFMImage(BinaryAFMImage, AFMImageNetworksAnalysis)
getTopologyAFMImage(BinaryAFMImage, AFMImageNetworksAnalysis)
BinaryAFMImage |
an |
AFMImageNetworksAnalysis |
an |
M.Beauvais
getTriangle
return a data.table points of a triangle
getTriangle(AFMImage, center, r, deg1, deg2)
getTriangle(AFMImage, center, r, deg1, deg2)
AFMImage |
a |
center |
center |
r |
length of segment |
deg1 |
angle 1 |
deg2 |
angel 2 |
M.Beauvais
getVertexId
return the vertexId
getVertexId(AFMImage, x, y)
getVertexId(AFMImage, x, y)
AFMImage |
an |
x |
coordinates in x axis |
y |
coordinates in y axis |
M.Beauvais
gridIgraphPlot
return TRUE if vertex is adjacent to a better vertex
gridIgraphPlot(AFMImage, g)
gridIgraphPlot(AFMImage, g)
AFMImage |
an |
g |
the networks |
M.Beauvais
display the network of nodes and edges
identifyEdgesFromCircles(..., AFMImageNetworksAnalysis, MAX_DISTANCE = 40)
identifyEdgesFromCircles(..., AFMImageNetworksAnalysis, MAX_DISTANCE = 40)
... |
cl: a cluster object from the parallel package |
AFMImageNetworksAnalysis |
|
MAX_DISTANCE |
the maximum distance between nodes to check if nodes are connected. Default value is 40. |
M.Beauvais
identify isolated nodes comparing the list of edges and the list of nodes
identifyIsolatedNodes(AFMImageNetworksAnalysis)
identifyIsolatedNodes(AFMImageNetworksAnalysis)
AFMImageNetworksAnalysis |
the AFMImageNetworksAnalysis instance |
the updated instance of AFMImageNetworksAnalysis
M.Beauvais
identifyMaxCircleRadius
identifyMaxCircleRadius( i, allXY, newCircleAFMImage, binaryAFMImageMatrix, maxCircleRadiusMatrix, circleRadius, circlenm )
identifyMaxCircleRadius( i, allXY, newCircleAFMImage, binaryAFMImageMatrix, maxCircleRadiusMatrix, circleRadius, circlenm )
i |
an integer |
allXY |
combinations of ? |
newCircleAFMImage |
a |
binaryAFMImageMatrix |
a |
maxCircleRadiusMatrix |
a matrix |
circleRadius |
a vector of radius ? |
circlenm |
a ? |
a data table with x,y,radius columns
M.Beauvais
find nodes and edges
identifyNodesAndEdges(..., AFMImageNetworksAnalysis, maxHeight)
identifyNodesAndEdges(..., AFMImageNetworksAnalysis, maxHeight)
... |
cl: a cluster object from the parallel package |
AFMImageNetworksAnalysis |
|
maxHeight |
a double for filtering the heights - upper to this height the heights are set to zero |
AFMImageNetworksAnalysis a AFMImageNetworksAnalysis
M.Beauvais
identifyNodesWithCircles
return TRUE if vertex is adjacent to a better vertex
identifyNodesWithCircles(..., AFMImageNetworksAnalysis)
identifyNodesWithCircles(..., AFMImageNetworksAnalysis)
... |
cl: a cluster object from the parallel package |
AFMImageNetworksAnalysis |
AFMImageNetworksAnalysis the AFMImageNetworksAnalysis
instance
M.Beauvais
The imported file should contain a header and list of heights The header should contain the following fields:
Lines: number of scanned lines (e.g. 512)
Sampsline: number of scan per line (e.g. 512)
ScanSize: the sample size (e.g. 1000nm) the extension nm is mandatory and will be removed
importFromNanoscope(fullfilename)
importFromNanoscope(fullfilename)
fullfilename |
a concatenated string of the directory and filename exported with Nanoscope analysis(TM) software |
importFromNanoscope
returns an AFMImage
M.Beauvais
## Not run: library(AFM) fullfilename<-"/user/ubuntu/NanoscopeFlattenExportedFile.txt" myAFMimage<-importFromNanoscope(fullfilename) displayIn3D(myAFMimage, width=1024, noLight=TRUE)) ## End(Not run)
## Not run: library(AFM) fullfilename<-"/user/ubuntu/NanoscopeFlattenExportedFile.txt" myAFMimage<-importFromNanoscope(fullfilename) displayIn3D(myAFMimage, width=1024, noLight=TRUE)) ## End(Not run)
Constructor method of AFMImageAnalyser Class.
## S4 method for signature 'AFMImageAnalyser' initialize( .Object, AFMImage, variogramAnalysis, psdAnalysis, fdAnalysis, gaussianMixAnalysis, networksAnalysis, threeDimensionAnalysis, mean, variance, TotalRrms, Ra, fullfilename )
## S4 method for signature 'AFMImageAnalyser' initialize( .Object, AFMImage, variogramAnalysis, psdAnalysis, fdAnalysis, gaussianMixAnalysis, networksAnalysis, threeDimensionAnalysis, mean, variance, TotalRrms, Ra, fullfilename )
.Object |
an AFMImageAnalyser object |
AFMImage |
an |
variogramAnalysis |
|
psdAnalysis |
|
fdAnalysis |
|
gaussianMixAnalysis |
|
networksAnalysis |
|
threeDimensionAnalysis |
|
mean |
the mean of heights of the |
variance |
the variance of heights of the |
TotalRrms |
the total Root Mean Square Roughness of the |
Ra |
mean roughness or mean of absolute values of heights |
fullfilename |
to be removed? |
invertBinaryAFMImage
returns a binary AFMImage
invertBinaryAFMImage(AFMImage)
invertBinaryAFMImage(AFMImage)
AFMImage |
an |
an AFMImage
M.Beauvais
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) newAFMImage<-copy(AFMImageOfAluminiumInterface) displayIn3D(newAFMImage,noLight=TRUE) newAFMImage<-multiplyHeightsAFMImage(newAFMImage, multiplier=2) displayIn3D(newAFMImage,noLight=TRUE) newAFMImage<-filterAFMImage(newAFMImage, Min=140, Max=300) displayIn3D(newAFMImage,noLight=TRUE) newAFMImage<-makeBinaryAFMImage(newAFMImage) displayIn3D(newAFMImage,noLight=TRUE) newAFMImage<-invertBinaryAFMImage(newAFMImage) displayIn3D(newAFMImage,noLight=TRUE) ## End(Not run)
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) newAFMImage<-copy(AFMImageOfAluminiumInterface) displayIn3D(newAFMImage,noLight=TRUE) newAFMImage<-multiplyHeightsAFMImage(newAFMImage, multiplier=2) displayIn3D(newAFMImage,noLight=TRUE) newAFMImage<-filterAFMImage(newAFMImage, Min=140, Max=300) displayIn3D(newAFMImage,noLight=TRUE) newAFMImage<-makeBinaryAFMImage(newAFMImage) displayIn3D(newAFMImage,noLight=TRUE) newAFMImage<-invertBinaryAFMImage(newAFMImage) displayIn3D(newAFMImage,noLight=TRUE) ## End(Not run)
isAdjacentToBetterVertex
return TRUE if vertex is adjacent to a better vertex
isAdjacentToBetterVertex(AFMImage, x, y)
isAdjacentToBetterVertex(AFMImage, x, y)
AFMImage |
an |
x |
coordinates in x axis |
y |
coordinates in y axis |
M.Beauvais
check if all the angles between one edge and a list of edges is superior to a specified value.
isAngleBetweenEdgesAlwaysSuperiorToMinAngle( binaryAFMImage, edge1, edges2, minAngle )
isAngleBetweenEdgesAlwaysSuperiorToMinAngle( binaryAFMImage, edge1, edges2, minAngle )
binaryAFMImage |
a binary |
edge1 |
one edge |
edges2 |
list of edges |
minAngle |
the minimum angle value |
TRUE if all the angle are superior to the specified value
M.Beauvais
isBinary
returns TRUE is the heights of the AFMImage is 0 or 1
isBinary(AFMImage)
isBinary(AFMImage)
AFMImage |
an |
a boolean
M.Beauvais
loglike sum of density of a mixture of normals
loglike.normalmix(x, mixture)
loglike.normalmix(x, mixture)
x |
a vector of quantiles |
mixture |
a gaussian mixture |
makeBinaryAFMImage
returns a binary AFMImage
makeBinaryAFMImage(AFMImage)
makeBinaryAFMImage(AFMImage)
AFMImage |
an |
an AFMImage
M.Beauvais
multiplyHeightsAFMImage
returns a simplified AFMImage
multiplyHeightsAFMImage(AFMImage, multiplier)
multiplyHeightsAFMImage(AFMImage, multiplier)
AFMImage |
an |
multiplier |
the number to multiply the heights with |
an AFMImage
M.Beauvais
## Not run: data(AFMImageOfAluminiumInterface) newAFMImage<-multiplyHeightsAFMImage(AFMImageOfAluminiumInterface,10) displayIn3D(newAFMImage,noLight=TRUE) ## End(Not run)
## Not run: data(AFMImageOfAluminiumInterface) newAFMImage<-multiplyHeightsAFMImage(AFMImageOfAluminiumInterface,10) displayIn3D(newAFMImage,noLight=TRUE) ## End(Not run)
omniVariogramSlopeAnalysis
stores the analysis of the second slope in roughness against lenghtscale
omniVariogramSlopeAnalysis() ## S4 method for signature 'omniVariogramSlopeAnalysis' initialize(.Object) omniVariogramSlopeAnalysis()
omniVariogramSlopeAnalysis() ## S4 method for signature 'omniVariogramSlopeAnalysis' initialize(.Object) omniVariogramSlopeAnalysis()
.Object |
an omniVariogramSlopeAnalysis object |
intersection_sill
to be removed ?
sill
to be removed ?
slope
to be removed ?
yintersept
to be removed ?
M.Beauvais
performAllPSDCalculation
perform all the calculation for PSD exploitation
performAllPSDCalculation(AFMImagePSDAnalysis, AFMImage)
performAllPSDCalculation(AFMImagePSDAnalysis, AFMImage)
AFMImagePSDAnalysis |
an |
AFMImage |
an |
M.Beauvais
## Not run: library(AFM) data(AFMImageOfNormallyDistributedHeights) newAFMImage<-AFMImageOfNormallyDistributedHeights newAFMImage@fullfilename<-"C:/Users/one/AFMImageOfNormallyDistributedHeights.txt" psdAnalysis<-AFMImagePSDAnalysis() # Create a closure to update progress psdAnalysis@updateProgress<- function(value = NULL, detail = NULL, message = NULL) { if (exists("progressPSD")){ if (!is.null(message)) { progressPSD$set(message = message, value = 0) }else{ progressPSD$set(value = value, detail = detail) } } } psdAnalysis@psd1d_breaks<-2^3 psdAnalysis@psd2d_truncHighLengthScale<-TRUE psdAnalysis<-performAllPSDCalculation(AFMImagePSDAnalysis= psdAnalysis, AFMImage= newAFMImage) print("done psdAnalysis") ## End(Not run)
## Not run: library(AFM) data(AFMImageOfNormallyDistributedHeights) newAFMImage<-AFMImageOfNormallyDistributedHeights newAFMImage@fullfilename<-"C:/Users/one/AFMImageOfNormallyDistributedHeights.txt" psdAnalysis<-AFMImagePSDAnalysis() # Create a closure to update progress psdAnalysis@updateProgress<- function(value = NULL, detail = NULL, message = NULL) { if (exists("progressPSD")){ if (!is.null(message)) { progressPSD$set(message = message, value = 0) }else{ progressPSD$set(value = value, detail = detail) } } } psdAnalysis@psd1d_breaks<-2^3 psdAnalysis@psd2d_truncHighLengthScale<-TRUE psdAnalysis<-performAllPSDCalculation(AFMImagePSDAnalysis= psdAnalysis, AFMImage= newAFMImage) print("done psdAnalysis") ## End(Not run)
performGaussianMixCalculation
perform all the calculation for PSD exploitation
performGaussianMixCalculation(AFMImageGaussianMixAnalysis, AFMImage)
performGaussianMixCalculation(AFMImageGaussianMixAnalysis, AFMImage)
AFMImageGaussianMixAnalysis |
an |
AFMImage |
an |
M.Beauvais
## Not run: library(AFM) data(AFMImageCollagenNetwork) AFMImage<-AFMImageCollagenNetwork AFMImage@fullfilename<-"/Users/one/AFMImageCollagenNetwork.txt" gMixAnalysis<-AFMImageGaussianMixAnalysis() # from two components gMixAnalysis@minGaussianMix<-2 # to four components gMixAnalysis@maxGaussianMix<-4 # convergence criteria gMixAnalysis@epsilonGaussianMix<-1e-4 # Create a closure to update progress gMixAnalysis@updateProgress<- function(value = NULL, detail = NULL, message = NULL) { if (exists("progressGaussianMix")){ if (!is.null(message)) { progressGaussianMix$set(message = message, value = 0) }else{ progressGaussianMix$set(value = value, detail = detail) } } } gMixAnalysis<-performGaussianMixCalculation(AFMImageGaussianMixAnalysis= gMixAnalysis, AFMImage) print("done performGaussianMixCalculation") ## End(Not run)
## Not run: library(AFM) data(AFMImageCollagenNetwork) AFMImage<-AFMImageCollagenNetwork AFMImage@fullfilename<-"/Users/one/AFMImageCollagenNetwork.txt" gMixAnalysis<-AFMImageGaussianMixAnalysis() # from two components gMixAnalysis@minGaussianMix<-2 # to four components gMixAnalysis@maxGaussianMix<-4 # convergence criteria gMixAnalysis@epsilonGaussianMix<-1e-4 # Create a closure to update progress gMixAnalysis@updateProgress<- function(value = NULL, detail = NULL, message = NULL) { if (exists("progressGaussianMix")){ if (!is.null(message)) { progressGaussianMix$set(message = message, value = 0) }else{ progressGaussianMix$set(value = value, detail = detail) } } } gMixAnalysis<-performGaussianMixCalculation(AFMImageGaussianMixAnalysis= gMixAnalysis, AFMImage) print("done performGaussianMixCalculation") ## End(Not run)
pnormmix distribution of a mixture of normals
pnormmix(q, mixture)
pnormmix(q, mixture)
q |
a vector of quantiles |
mixture |
a gaussian mixture |
printVariogramModelEvaluations
generates a graphic element containing the evaluation of all variogram models
printVariogramModelEvaluations( AFMImageAnalyser, sampleDT, numberOfModelsPerPage )
printVariogramModelEvaluations( AFMImageAnalyser, sampleDT, numberOfModelsPerPage )
AFMImageAnalyser |
an |
sampleDT |
a data.table containg the evaluation information |
numberOfModelsPerPage |
numeric to specify the number of model evaluations per pages |
M.Beauvais
PSD2DAgainstFrequency
by using
breaks in the log space to sum PSD 2D and frequency values.Calculate the 1D Power Spectral Density; returns a data table of PSD 1D and PSD 2D values
against spatial frequencies.
As mentionned in Sidick2009, this function calculates the
PSD against spatial frequencies in 1D from PSD2DAgainstFrequency
by using
breaks in the log space to sum PSD 2D and frequency values.
PSD1DAgainstFrequency(AFMImage, AFMImagePSDAnalysis) ## S4 method for signature 'AFMImage' PSD1DAgainstFrequency(AFMImage, AFMImagePSDAnalysis)
PSD1DAgainstFrequency(AFMImage, AFMImagePSDAnalysis) ## S4 method for signature 'AFMImage' PSD1DAgainstFrequency(AFMImage, AFMImagePSDAnalysis)
AFMImage |
an |
AFMImagePSDAnalysis |
n |
PSD1DAgainstFrequency
returns a data table of frequencies and PSD values
freq: the considered frequency
PSD: the considered PSD value
type: PSD-1D
fullfilename: directory and filename on the disk
## Not run: library(AFM) library(ggplot2) library(plyr) library(scales) data("AFMImageOfNormallyDistributedHeights") newAFMImage<-AFMImageOfNormallyDistributedHeights newAFMImage@fullfilename<-"C:/Users/one/AFMImageOfNormallyDistributedHeights.txt" psdAnalysis<-AFMImagePSDAnalysis() # Create a closure to update progress psdAnalysis@updateProgress<- function(value = NULL, detail = NULL, message = NULL) { if (exists("progressPSD")){ if (!is.null(message)) { progressPSD$set(message = message, value = 0) }else{ progressPSD$set(value = value, detail = detail) } } } psdAnalysis@psd1d_breaks<-2^3 psdAnalysis@psd2d_truncHighLengthScale<-TRUE psdAnalysis<-performAllPSDCalculation(AFMImagePSDAnalysis= psdAnalysis, AFMImage= newAFMImage) datap<-psdAnalysis@psd1d p <- ggplot(data=datap) p <- p + geom_point(aes(freq, PSD, color=type),data=datap[datap$type %in% c("PSD-2D")]) p <- p + geom_line(aes(freq, PSD, color=type),data=datap[datap$type %in% c("PSD-1D")],size=1.1) p <- p + scale_x_log10() p <- p + scale_y_log10() p <- p + ylab("PSD (nm^4)") p <- p + xlab("Frequency (nm^-1)") p ## End(Not run)
## Not run: library(AFM) library(ggplot2) library(plyr) library(scales) data("AFMImageOfNormallyDistributedHeights") newAFMImage<-AFMImageOfNormallyDistributedHeights newAFMImage@fullfilename<-"C:/Users/one/AFMImageOfNormallyDistributedHeights.txt" psdAnalysis<-AFMImagePSDAnalysis() # Create a closure to update progress psdAnalysis@updateProgress<- function(value = NULL, detail = NULL, message = NULL) { if (exists("progressPSD")){ if (!is.null(message)) { progressPSD$set(message = message, value = 0) }else{ progressPSD$set(value = value, detail = detail) } } } psdAnalysis@psd1d_breaks<-2^3 psdAnalysis@psd2d_truncHighLengthScale<-TRUE psdAnalysis<-performAllPSDCalculation(AFMImagePSDAnalysis= psdAnalysis, AFMImage= newAFMImage) datap<-psdAnalysis@psd1d p <- ggplot(data=datap) p <- p + geom_point(aes(freq, PSD, color=type),data=datap[datap$type %in% c("PSD-2D")]) p <- p + geom_line(aes(freq, PSD, color=type),data=datap[datap$type %in% c("PSD-1D")],size=1.1) p <- p + scale_x_log10() p <- p + scale_y_log10() p <- p + ylab("PSD (nm^4)") p <- p + xlab("Frequency (nm^-1)") p ## End(Not run)
PSD2DAgainstFrequency returns a data table of PSD 2D values against spatial frequencies
PSD2DAgainstFrequency(AFMImage, AFMImagePSDAnalysis) ## S4 method for signature 'AFMImage,AFMImagePSDAnalysis' PSD2DAgainstFrequency(AFMImage, AFMImagePSDAnalysis)
PSD2DAgainstFrequency(AFMImage, AFMImagePSDAnalysis) ## S4 method for signature 'AFMImage,AFMImagePSDAnalysis' PSD2DAgainstFrequency(AFMImage, AFMImagePSDAnalysis)
AFMImage |
an |
AFMImagePSDAnalysis |
an |
PSD2DAgainstFrequency
returns a data table of frequencies and PSD values
freq: the considered frequency
PSD: the considered PSD value
type: PSD-2D
fullfilename: directory and filename on the disk
Sidick2009, Erkin Sidick "Power Spectral Density Specification and Analysis of Large Optical Surfaces", 2009, "Modeling Aspects in Optical Metrology II, Proc. of SPIE Vol. 7390 73900L-1"
## Not run: library(AFM) library(ggplot2) library(plyr) # Calculate Power Spectrum Density in 2D against frequency data("AFMImageOfNormallyDistributedHeights") oneAFMImage<-AFMImageOfNormallyDistributedHeights psd2d<-PSD2DAgainstFrequency(oneAFMImage) p <- ggplot(data=psd2d) p <- p + geom_point(aes(freq, PSD, color=type),subset = .(type %in% c("PSD-2D"))) p <- p + geom_line(aes(freq, PSD, color=type),subset = .(type %in% c("PSD-1D")),size=1.1) p <- p + scale_x_log10() p <- p + scale_y_log10() p <- p + ylab("PSD (nm^4)") p <- p + xlab("Frequency (nm^-1)") p <- p + ggtitle(basename(oneAFMImage@fullfilename)) p ## End(Not run)
## Not run: library(AFM) library(ggplot2) library(plyr) # Calculate Power Spectrum Density in 2D against frequency data("AFMImageOfNormallyDistributedHeights") oneAFMImage<-AFMImageOfNormallyDistributedHeights psd2d<-PSD2DAgainstFrequency(oneAFMImage) p <- ggplot(data=psd2d) p <- p + geom_point(aes(freq, PSD, color=type),subset = .(type %in% c("PSD-2D"))) p <- p + geom_line(aes(freq, PSD, color=type),subset = .(type %in% c("PSD-1D")),size=1.1) p <- p + scale_x_log10() p <- p + scale_y_log10() p <- p + ylab("PSD (nm^4)") p <- p + xlab("Frequency (nm^-1)") p <- p + ggtitle(basename(oneAFMImage@fullfilename)) p ## End(Not run)
A function to export to all the data from all analysis of an AFMImage
and put them on disk as rdata file
putAnalysisOnDisk(AFMImageAnalyser, AFMImage) ## S4 method for signature 'AFMImageAnalyser' putAnalysisOnDisk(AFMImageAnalyser, AFMImage)
putAnalysisOnDisk(AFMImageAnalyser, AFMImage) ## S4 method for signature 'AFMImageAnalyser' putAnalysisOnDisk(AFMImageAnalyser, AFMImage)
AFMImageAnalyser |
|
AFMImage |
an |
M.Beauvais
A function to put on disk all the images from variogram, PSD Analysis of an AFMImage
An AFM Image 3D representation is saved on disk thanks to the rgl
package.
On Unix system, it is necessary to have a X server connection to be able to use the rgl
package.
putImagesFromAnalysisOnDisk(AFMImageAnalyser, AFMImage, exportDirectory)
putImagesFromAnalysisOnDisk(AFMImageAnalyser, AFMImage, exportDirectory)
AFMImageAnalyser |
|
AFMImage |
an |
exportDirectory |
where the images will be stored |
M.Beauvais
Find and remove the longuest edge if it is unique
removeLonguestEdge(k, res, sides, myRes, vertex1)
removeLonguestEdge(k, res, sides, myRes, vertex1)
k |
an integer |
res |
res ? |
sides |
data.table |
myRes |
data.table? |
vertex1 |
a vertex ? |
a data.table with from, to
M.Beauvais
remove a node from an AFMImage
removeNode(circleAFMImage, nodeDT)
removeNode(circleAFMImage, nodeDT)
circleAFMImage |
a |
nodeDT |
a data.table lon lat circleRadius |
an AFMImage
M.Beauvais
The calculation of the roughness against lengthscale is performed throught a FFT 2D calculation, PSD 2D calculation and a meshgrid of frequencies.
RoughnessByLengthScale
returns a data.table of roughnesses against length scales
RoughnessByLengthScale(AFMImage, AFMImagePSDAnalysis) ## S4 method for signature 'AFMImage' RoughnessByLengthScale(AFMImage, AFMImagePSDAnalysis)
RoughnessByLengthScale(AFMImage, AFMImagePSDAnalysis) ## S4 method for signature 'AFMImage' RoughnessByLengthScale(AFMImage, AFMImagePSDAnalysis)
AFMImage |
an |
AFMImagePSDAnalysis |
n |
a data table of lenght scale (r) and roughness values (roughness)
roughness: roughnesses
r: length scales
filename: fullfilename slot of the AFMImage
M.Beauvais
## Not run: library(AFM) library(ggplot2) data("AFMImageOfNormallyDistributedHeights") oneAFMImage<-AFMImageOfNormallyDistributedHeights AFMImagePSDAnalysis<-AFMImagePSDAnalysis() data<-RoughnessByLengthScale(oneAFMImage, AFMImagePSDAnalysis) r<-roughness<-filename<-NULL p1 <- ggplot(data, aes(x=r, y=roughness, colour= basename(filename))) p1 <- p1 + geom_point() p1 <- p1 + geom_line() p1 <- p1 + ylab("roughness (nm)") p1 <- p1 + xlab("lengthscale (nm)") p1 ## End(Not run)
## Not run: library(AFM) library(ggplot2) data("AFMImageOfNormallyDistributedHeights") oneAFMImage<-AFMImageOfNormallyDistributedHeights AFMImagePSDAnalysis<-AFMImagePSDAnalysis() data<-RoughnessByLengthScale(oneAFMImage, AFMImagePSDAnalysis) r<-roughness<-filename<-NULL p1 <- ggplot(data, aes(x=r, y=roughness, colour= basename(filename))) p1 <- p1 + geom_point() p1 <- p1 + geom_line() p1 <- p1 + ylab("roughness (nm)") p1 <- p1 + xlab("lengthscale (nm)") p1 ## End(Not run)
Launch the AFM shiny graphical interface to access most of the fonctionalities of the AFM library
runAFMApp()
runAFMApp()
M.Beauvais
## Not run: install.packages("AFM") AFM::runAFMApp() ## End(Not run)
## Not run: install.packages("AFM") AFM::runAFMApp() ## End(Not run)
Random selection of heights to keep in an AFMImage
.
This function can be used to calculate quickly an approximated variogram of a large image.
sampleAFMImage(AFMImage, percentage)
sampleAFMImage(AFMImage, percentage)
AFMImage |
an |
percentage |
percentage of heights to keep |
sampleAFMImage
returns a sample of the AFMImage to boost calculation time of variogram
a sample of an AFMImage
M.Beauvais
## Not run: library(AFM) library(ggplot2) data(AFMImageOfAluminiumInterface) anAFMImageSample<-sampleAFMImage(AFMImageOfAluminiumInterface,15) variogramAnalysis<-AFMImageVariogramAnalysis(sampleFitPercentage=3.43) avario<-AFM::calculateOmnidirectionalVariogram(AFMImage= anAFMImageSample, AFMImageVariogramAnalysis= variogramAnalysis) dist<-gamma<-NULL p1 <- ggplot(avario, aes(x=dist, y=gamma)) p1 <- p1 + geom_point() p1 <- p1 + geom_line() p1 <- p1 + ylab("semivariance") p1 <- p1 + xlab("distance (nm)") p1 <- p1 + ggtitle("Approximation of variogram thanks to sampling") p1 ## End(Not run)
## Not run: library(AFM) library(ggplot2) data(AFMImageOfAluminiumInterface) anAFMImageSample<-sampleAFMImage(AFMImageOfAluminiumInterface,15) variogramAnalysis<-AFMImageVariogramAnalysis(sampleFitPercentage=3.43) avario<-AFM::calculateOmnidirectionalVariogram(AFMImage= anAFMImageSample, AFMImageVariogramAnalysis= variogramAnalysis) dist<-gamma<-NULL p1 <- ggplot(avario, aes(x=dist, y=gamma)) p1 <- p1 + geom_point() p1 <- p1 + geom_line() p1 <- p1 + ylab("semivariance") p1 <- p1 + xlab("distance (nm)") p1 <- p1 + ggtitle("Approximation of variogram thanks to sampling") p1 ## End(Not run)
The function saves the an AFMImage
as a rdata file. It uses the fullfilename param of the AFMImage
and add "AFMImage.rda" extension to save the rdata file on disk.
saveOnDisk(AFMImage, exportDirectory)
saveOnDisk(AFMImage, exportDirectory)
AFMImage |
an |
exportDirectory |
an optional argument to change the directory where the rdata file will be stored on disk |
saveOnDisk
save on disk an AFMImage
as rdata file
M.Beauvais
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) # save the rdata file of the AFMImage in the tempdir() directory; # select another directory to save it permanently on your hard drive saveOnDisk(AFMImageOfAluminiumInterface, tempdir()) ## End(Not run)
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) # save the rdata file of the AFMImage in the tempdir() directory; # select another directory to save it permanently on your hard drive saveOnDisk(AFMImageOfAluminiumInterface, tempdir()) ## End(Not run)
saveOnDiskIntersectionForRoughnessAgainstLengthscale
save an image of the roughness against lenghtscale calculations
saveOnDiskIntersectionForRoughnessAgainstLengthscale( AFMImageAnalyser, exportDirectory )
saveOnDiskIntersectionForRoughnessAgainstLengthscale( AFMImageAnalyser, exportDirectory )
AFMImageAnalyser |
an |
exportDirectory |
a directory on the file system |
M.Beauvais
save a Lattice (trellis) plot of an AFMImage
using the spplot
method of the sp package.
This function is used to evaluate visually the quality of the predicted surface when a variogram model is used.
saveSpplotFromAFMImage( AFMImage, fullfilename, expectedWidth, expectHeight, withoutLegend )
saveSpplotFromAFMImage( AFMImage, fullfilename, expectedWidth, expectHeight, withoutLegend )
AFMImage |
an |
fullfilename |
directory and filename to save to png |
expectedWidth |
(optional) expected width of the saved image. Default is 400px. |
expectHeight |
(optional) expected height of the saved image. Default is 300px. |
withoutLegend |
(optional) set at FALSE, the cuts legend will be included in the plot. Default is FALSE. |
saveSpplotFromAFMImage
save a a Lattice (trellis) plot of an AFMImage
on disk
M.Beauvais
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) saveSpplotFromAFMImage(AFMImageOfAluminiumInterface, paste(tempdir(), "myFileWithoutLegend.png", sep="/"), 800,800, TRUE) saveSpplotFromAFMImage(AFMImageOfAluminiumInterface, paste(tempdir(), "myFileWithLegend.png", sep="/"), 800,800, FALSE) ## End(Not run)
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) saveSpplotFromAFMImage(AFMImageOfAluminiumInterface, paste(tempdir(), "myFileWithoutLegend.png", sep="/"), 800,800, TRUE) saveSpplotFromAFMImage(AFMImageOfAluminiumInterface, paste(tempdir(), "myFileWithLegend.png", sep="/"), 800,800, FALSE) ## End(Not run)
shiftedPSDuv
returns the Power Spectral Density matrix in the frequency space from shifted FFT 2D
shiftedPSDuv(AFMImage)
shiftedPSDuv(AFMImage)
AFMImage |
an |
(1/NM^2) * abs(shiftedFFT2Ddata)^2) with N the number of lines of the sample and M the number of samples per line of the sample
M.Beauvais
## Not run: library(AFM) library(ggplot2) data(AFMImageOfRegularPeaks) AFMImage<-AFMImageOfRegularPeaks nMheightsData= matrix(AFMImage@data$h, nrow=AFMImage@samplesperline) shiftedPSDuv<-shiftedPSDuv(AFMImage) a=AFMImage@scansize b=AFMImage@scansize M=AFMImage@sampsline N=AFMImage@lines NM=N*M # pixels^2 MN = M*N A=a*b ab=a*b dx=a/M dy=b/N um = seq( (1-(M+1)/2)/(M*dx), (M-(M+1)/2)/(M*dx), by=1/(M*dx)) vn = seq( (1-(N+1)/2)/(N*dy), (N-(N+1)/2)/(N*dy), by=1/(N*dy)) x = rep(um, times = AFMImage@lines) y = rep(vn, each = AFMImage@sampsline) z = as.vector(shiftedPSDuv) data<-data.frame(x=x, y=y, z=z) p5 <- qplot(x, y, data=data, colour=log10(z)) p5 <- p5 + scale_colour_gradientn(colours = rainbow(7)) p5 <- p5 + ylab("v") p5 <- p5 + xlab("u") title<-paste("shifted PSD of", basename(AFMImage@fullfilename)) p5 <- p5 + ggtitle(title) # Hide all the horizontal gridlines p5 <- p5 + theme(panel.grid.minor.x=element_blank(), panel.grid.major.x=element_blank()) # Hide all the vertical gridlines p5 <- p5 + theme(panel.grid.minor.y=element_blank(), panel.grid.major.y=element_blank()) p5 <- p5 + theme(panel.background = element_rect(fill = 'white', colour = 'black')) p5 ## End(Not run)
## Not run: library(AFM) library(ggplot2) data(AFMImageOfRegularPeaks) AFMImage<-AFMImageOfRegularPeaks nMheightsData= matrix(AFMImage@data$h, nrow=AFMImage@samplesperline) shiftedPSDuv<-shiftedPSDuv(AFMImage) a=AFMImage@scansize b=AFMImage@scansize M=AFMImage@sampsline N=AFMImage@lines NM=N*M # pixels^2 MN = M*N A=a*b ab=a*b dx=a/M dy=b/N um = seq( (1-(M+1)/2)/(M*dx), (M-(M+1)/2)/(M*dx), by=1/(M*dx)) vn = seq( (1-(N+1)/2)/(N*dy), (N-(N+1)/2)/(N*dy), by=1/(N*dy)) x = rep(um, times = AFMImage@lines) y = rep(vn, each = AFMImage@sampsline) z = as.vector(shiftedPSDuv) data<-data.frame(x=x, y=y, z=z) p5 <- qplot(x, y, data=data, colour=log10(z)) p5 <- p5 + scale_colour_gradientn(colours = rainbow(7)) p5 <- p5 + ylab("v") p5 <- p5 + xlab("u") title<-paste("shifted PSD of", basename(AFMImage@fullfilename)) p5 <- p5 + ggtitle(title) # Hide all the horizontal gridlines p5 <- p5 + theme(panel.grid.minor.x=element_blank(), panel.grid.major.x=element_blank()) # Hide all the vertical gridlines p5 <- p5 + theme(panel.grid.minor.y=element_blank(), panel.grid.major.y=element_blank()) p5 <- p5 + theme(panel.background = element_rect(fill = 'white', colour = 'black')) p5 ## End(Not run)
shiftFFT2D
returns the FFT 2D matrix shifted to put zero frequencies in the middle.
shiftFFT2D(fft2data)
shiftFFT2D(fft2data)
fft2data |
the FFT 2D of the AFM image |
The shifted matrix
M.Beauvais
## Not run: library(AFM) library(fftwtools) data(AFMImageOfNormallyDistributedHeights) AFMImage<-AFMImageOfNormallyDistributedHeights nMheightsData= matrix(AFMImage@data$h, nrow=AFMImage@samplesperline) shiftedFFT2D<-shiftFFT2D(fftwtools::fftw2d(nMheightsData)) ## End(Not run)
## Not run: library(AFM) library(fftwtools) data(AFMImageOfNormallyDistributedHeights) AFMImage<-AFMImageOfNormallyDistributedHeights nMheightsData= matrix(AFMImage@data$h, nrow=AFMImage@samplesperline) shiftedFFT2D<-shiftFFT2D(fftwtools::fftw2d(nMheightsData)) ## End(Not run)
The simplification is taking a very simple gridded sample of the image. It can be useful to speed up display.
simplifyAFMImage(AFMImage, newSamplesperline, newLines)
simplifyAFMImage(AFMImage, newSamplesperline, newLines)
AFMImage |
an |
newSamplesperline |
the new number of samplesperline of the AFMImage |
newLines |
the new number of lines of the AFMImage |
simplifyAFMImage
returns a simplified AFMImage
a new simplified AFMImage
M.Beauvais
## Not run: data(AFMImageOfAluminiumInterface) anAFMImageExtract<-simplifyAFMImage(AFMImageOfAluminiumInterface,16,16) ## End(Not run)
## Not run: data(AFMImageOfAluminiumInterface) anAFMImageExtract<-simplifyAFMImage(AFMImageOfAluminiumInterface,16,16) ## End(Not run)
simplify the network keeping only the important edges
simplifyNetwork(..., allVertices, allEdges)
simplifyNetwork(..., allVertices, allEdges)
... |
cl: a cluster object from the parallel package |
allVertices |
a data.table of vertices |
allEdges |
a data.table of edges |
a data.table of edges
M.Beauvais
thin an Image in matrix format
thinImage(imageMatrix)
thinImage(imageMatrix)
imageMatrix |
a matrix of an AFM image |
M.Beauvais
totalRMSRoughness
returns the total RMS roughness calculated from the variance of heights
totalRMSRoughness(AFMImage)
totalRMSRoughness(AFMImage)
AFMImage |
an |
a numeric as the square root of the variance of heights
M.Beauvais
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) totalRMSRoughness<-totalRMSRoughness(AFMImageOfAluminiumInterface) print(totalRMSRoughness) ## End(Not run)
## Not run: library(AFM) data(AFMImageOfAluminiumInterface) totalRMSRoughness<-totalRMSRoughness(AFMImageOfAluminiumInterface) print(totalRMSRoughness) ## End(Not run)
transformAFMImageForNetworkAnalysis
update AFMImageNetworksAnalysis
making a binary AFMImage
transformAFMImageForNetworkAnalysis(AFMImageNetworksAnalysis, AFMImage) ## S4 method for signature 'AFMImageNetworksAnalysis' transformAFMImageForNetworkAnalysis(AFMImageNetworksAnalysis, AFMImage)
transformAFMImageForNetworkAnalysis(AFMImageNetworksAnalysis, AFMImage) ## S4 method for signature 'AFMImageNetworksAnalysis' transformAFMImageForNetworkAnalysis(AFMImageNetworksAnalysis, AFMImage)
AFMImageNetworksAnalysis |
n |
AFMImage |
an |
M.Beauvais
is a function used by a GUI such as shiny GUI
updateProgress(AFMImageVariogramAnalysis, value, detail, message)
updateProgress(AFMImageVariogramAnalysis, value, detail, message)
AFMImageVariogramAnalysis |
|
value |
shiny progress bar value |
detail |
shiny progress bar detail |
message |
shiny progress bar message |