Reformat an image with a CMTK registration using the reformatx tool
cmtk.reformatx(
floating,
registrations,
output,
target,
mask = FALSE,
direction = NULL,
interpolation = c("linear", "nn", "cubic", "pv", "sinc-cosine", "sinc-hamming"),
dryrun = FALSE,
Verbose = TRUE,
MakeLock = TRUE,
OverWrite = c("no", "update", "yes"),
filesToIgnoreModTimes = NULL,
...
)
the path to the ouput image (whether or not it was re-created afresh)
or NA_character_
if no output was possible.
The floating image to be reformatted
One or more CMTK format registrations on disk
The path to the output image (defaults to
"<targetstem>_<floatingstem>.nrrd"
)
A character vector specifying an image file on disk, an
im3d
object (or an object that can be coerced to im3d) or a 6-or
9-vector defining a grid in the form Nx,Ny,Nz,dX,dY,dZ,[Ox,Oy,Oz].
Whether to treat target as a binary mask (only reformatting positive voxels)
Whether to transform image from sample space to reference
space (called forward by CMTK) or from reference to sample space
(called inverse by CMTK). Default (when NULL
is forward).
What interpolation scheme to use for output image (defaults to linear - see details)
Just print command
Whether to show cmtk status messages and be verbose about file
update checks. Sets command line --verbose
option.
Whether to use a lock file to allow simple parallelisation
(see makelock
)
Whether to OverWrite an existing output file. One of
c("no","update","yes"). When OverWrite='update'
RunCmdForNewerInput
is used to determine if the output is
older than any of the input files.
Input files whose modification time should not be checked when determining if new output is required.
additional arguments passed to CMTK reformatx
after
processing by cmtk.call
.
Note that if you are reformatting a mask then you will need to
change the interpolation to "nn", since interpolating between e.g. mask
levels 72 and 74 with 73 may have unintened consequences. Presently we have
no way of knowing whether an image should be treated as a mask, so the
interpolation
must be handled manually.
cmtk.bindir, cmtk.call, makelock,
RunCmdForNewerInput
if (FALSE) {
cmtk.reformatx('myimage.nrrd', target='template.nrrd',
registrations='template_myimage.list')
# get full listing of command line options
system(cmtk.call('reformatx', help=TRUE))
}
Run the code above in your browser using DataLab