writetiff | R Documentation |
Writes TIFF from [0-1] Normalized Image.
writetiff(image, ..., what = "uint8")
image |
a matrix or array or representing the image: |
... |
other arguments to be passed to |
what |
bits mode used to store image. Default is |
it is aimed to simplify the use of writemulti
by requiring minimal input from user.
/!\ Note that image should range from 0 to 1.
/!\ Note that as.rgb
that will be automatically filled with TRUE
if image
is 3D array with 3rd dimension being of length 3. So, if an RGB output is not desired, you should provide a 4D array.
It invisibly returns full path of exported file or a raw vector when write_to = raw(0)
otherwise.
## Not run:
if(requireNamespace("IFCdata", quietly = TRUE)) {
## use a cif file
file_cif <- system.file("extdata", "example.cif", package = "IFCdata")
## extract image values from cif file as [0-1] RGB 3D array
img = ExtractImages_toMatrix(fileName = file_cif, mode = "rgb", objects = 3, selection = 3,
force_width = FALSE, size = c(0,0))
## create RGB tiff file
file_tif = writetiff(image = img[[1]][[1]], write_to = tempfile(fileext = ".tif"))
## inspect exported file
IFD = getIFD(file_tif)
sapply(IFD[[1]]$tags, FUN = function(x) x)
} else {
message(sprintf('Please run `install.packages("IFCdata", repos = "%s", type = "source")` %s',
'https://gitdemont.github.io/IFCdata/',
'to install extra files required to run this example.'))
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.