cmtk.call | R Documentation |
cmtk.call
processes arguments into a form compatible with
CMTK command line tools.
cmtk.system2
actually calls a cmtk tool using a call list
produced by cmtk.call
cmtk.call(
tool,
PROCESSED.ARGS = NULL,
...,
FINAL.ARGS = NULL,
RETURN.TYPE = c("string", "list")
)
cmtk.system2(cmtkcall, moreargs = NULL, ...)
tool |
Name of the CMTK tool |
PROCESSED.ARGS |
Character vector of arguments that have already been processed by the callee. Placed immediately after cmtk tool. |
... |
Additional named arguments to be processed by ( |
FINAL.ARGS |
Character vector of arguments that have already been processed by the callee. Placed at the end of the call after optional arguments. |
RETURN.TYPE |
Sets return type to a character string or list (the latter
is suitable for use with |
cmtkcall |
A list containing processed arguments prepared by
|
moreargs |
Additional arguments to add to the processed call |
cmtk.call
processes arguments in ... as follows:
will be converted from arg.name
to
--arg-name
(which must be of length 1) will be passed on as
--arg-name
(which must be of length 1) will be passed on as
--arg-name arg
i.e. quoting is left up to callee.
will be collapsed with commas if of length greater
than 1 and then passed on unquoted e.g. target.offset=c(1,2,3)
will
result in --target-offset 1,2,3
Either a string of the form "<tool> <PROCESSED.ARGS>
<...> <FINAL.ARGS>"
or a list containing elements
command A character vector of length 1 indicating the full path to the CMTK tool, shell quoted for protection.
args A character vector of arguments of length 0 or greater.
See the help of system2
for details.
cmtk.bindir
## Not run:
cmtk.call("reformatx",'--outfile=out.nrrd', floating='floating.nrrd',
mask=TRUE, target.offset=c(1,2,3), FINAL.ARGS=c('target.nrrd','reg.list'))
# get help for a cmtk tool
system(cmtk.call('reformatx', help=TRUE))
## End(Not run)
## Not run:
cmtk.system2(cmtk.call('mat2dof', help=TRUE, RETURN.TYPE="list"))
# capture response into an R variable
helptext=cmtk.system2(cmtk.call('mat2dof', help=TRUE, RETURN.TYPE="list"),
stdout=TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.