AddOrReplaceNrrdHeaderField: Add or replace lines in the header of a nrrd file

Description Usage Arguments Details Value See Also Examples

Description

Add or replace lines in the header of a nrrd file

Usage

1
2
AddOrReplaceNrrdHeaderField(infile, outfile, newfields, Force = FALSE,
  Detached = FALSE, action = c("addreplace", "addonly", "replaceonly"))

Arguments

infile

Path to input file

outfile

Path to output file

newfields

Named character vector of fields to replace (see details)

Force

Overwrite existing file (default FALSE)

Detached

Write a detached header insted of a nrrd (default FALSE)

action

addreplace (Default) addonly or replaceonly

Details

Input is a named vector of new fields. Use unnamed fields for comments. Quote field names with spaces (conventionally with back ticks). Note that this function will error out for invalid field names. See http://teem.sourceforge.net/nrrd/format.html for nrrd field details

Note that newfields should specify the complete replacement line as a string (not the individual values for fields containing multiple elements) without the leading field name (see examples).

Value

TRUE or FALSE depending on success

See Also

read.nrrd.header

Examples

1
2
3
4
5
## Not run: 
AddOrReplaceNrrdHeaderField(lhmaskfile,outfile=file.path(tmpdir,"LHMask.nrrd"),
  c("# My interesting comment",`space origin`="(2,2,2)"),Force=TRUE)

## End(Not run)

jefferis/runu documentation built on May 14, 2019, 2:43 p.m.