View source: R/amiralandmarks-io.R
read.landmarks | R Documentation |
Generic functions to read/write landmarks in any supported format
read.landmarks(f, ...)
write.landmarks(
x,
file,
format = "amiralandmarks",
ext = NULL,
Force = FALSE,
MakeDir = TRUE,
...
)
f |
Path to a file (can also be a URL) |
... |
Additional arguments passed on to format specific functions |
x |
The landmarks object to write. Can also be a plain |
file |
The path to the output file. If this does not end in an extension
like |
format |
Character vector specifying output format. Defaults to
|
ext |
Optional character vector specifying a new or non-standard
extension to use for output file, including the period (e.g.
|
Force |
Whether to overwrite an existing file |
MakeDir |
Whether to create directory implied by |
Presently the supported formats are
Amira
CMTK
Fiji (see https://imagej.net/plugins/name-landmarks-and-register)
See examples section for how to produce a listing of all currently
available formats with fileformats
.
for read.landmarks
a matrix or list of additional class
landmarks, where the rownames specify the names of each landmark if
available.
For write.landmarks
the path to the written file, invisibly.
Only the amiralandmarks format supports the use of paired landmarks
fileformats
## Listing of supported fileformats for landmarks
fileformats(class = 'landmarks', rval = "info")
## round trip tests
m=matrix(rnorm(6), ncol=3)
rownames(m)=c("nose", "ear")
f=write.landmarks(m, file='knee', format='cmtk')
read.landmarks(f)
# write in amira format which does not support named landmarks
f2=write.landmarks(m, file='knee', format='amira')
read.landmarks(f2)
# clean up
unlink(c(f,f2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.