cmtk.call: Utility function to create and run calls to CMTK commandline...

Description Usage Arguments Details Value See Also Examples

View source: R/cmtk.R

Description

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

Usage

1
2
3
4
cmtk.call(tool, PROCESSED.ARGS = NULL, ..., FINAL.ARGS = NULL,
  RETURN.TYPE = c("string", "list"))

cmtk.system2(cmtkcall, moreargs = NULL, ...)

Arguments

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 (cmtk.call, see details) or passed to system2 (cmtk.system2).

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 system2)

cmtkcall

A list containing processed arguments prepared by cmtk.call(RETURN.TYPE="list")

moreargs

Additional arguments to add to the processed call

Details

cmtk.call processes arguments in ... as follows:

Value

Either a string of the form "<tool> <PROCESSED.ARGS> <...> <FINAL.ARGS>" or a list containing elements

See the help of system2 for details.

See Also

cmtk.bindir

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## 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)

jefferis/nat documentation built on Oct. 25, 2018, 6:29 p.m.