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 |
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.call processes arguments in ... as follows:
argument names will be converted from arg.name to
--arg-name
logical vectors (which must be of length 1) will be passed on as
--arg-name
character vectors (which must be of length 1) will be passed on as
--arg-name arg i.e. quoting is left up to callee.
numeric vectors 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
# 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)) # }# 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) # }