From a6ab2324d0d3ef6eed0bc484302d120385e7df3c Mon Sep 17 00:00:00 2001 From: Damon Pham Date: Wed, 22 Jul 2020 19:07:25 -0400 Subject: [PATCH 1/6] starting to work on cifti_write --- R/read_gifti.R | 5 +++-- R/write_gifti.R | 0 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 R/write_gifti.R diff --git a/R/read_gifti.R b/R/read_gifti.R index cc07d83..07cf457 100644 --- a/R/read_gifti.R +++ b/R/read_gifti.R @@ -161,7 +161,7 @@ readgii = function(file){ namer = convert_intent(intent) names(L)[ind] = namer - + stopifnot(length(dat) == n) mat_dims = info[ind, dims] @@ -177,7 +177,8 @@ readgii = function(file){ } L = list(data = L, - meta = meta, + file_meta = meta, + data_meta = MD, version = ver, transformations = trans, parsed_transformations = parsed_trans, diff --git a/R/write_gifti.R b/R/write_gifti.R new file mode 100644 index 0000000..e69de29 From 936fb49abb62db29002322a8aafaa49cdecdce89 Mon Sep 17 00:00:00 2001 From: Damon Pham Date: Sat, 1 Aug 2020 07:24:26 -0700 Subject: [PATCH 2/6] Draft write_gifti_from_template --- DESCRIPTION | 2 +- NAMESPACE | 2 + R/read_gifti.R | 3 +- R/write_gifti_from_template.R | 91 ++++++++++++++++++++++++++++++++ man/convert_binary_datatype.Rd | 6 ++- man/create_data_matrix.Rd | 7 ++- man/data_decoder.Rd | 10 ++-- man/data_encoder.Rd | 9 ++-- man/download_gifti_data.Rd | 7 ++- man/gifti_map_value.Rd | 9 +++- man/write_gifti_from_template.Rd | 21 ++++++++ 11 files changed, 151 insertions(+), 16 deletions(-) create mode 100644 R/write_gifti_from_template.R create mode 100644 man/write_gifti_from_template.Rd diff --git a/DESCRIPTION b/DESCRIPTION index a22af82..1757678 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -26,5 +26,5 @@ Suggests: BugReports: https://github.com/muschellij2/gifti/issues Encoding: UTF-8 LazyData: true -RoxygenNote: 6.1.1 +RoxygenNote: 7.1.1 VignetteBuilder: knitr diff --git a/NAMESPACE b/NAMESPACE index 8694150..7cb037f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -18,6 +18,8 @@ export(readGIfTI) export(read_gifti) export(readgii) export(surf_triangles) +export(write_gifti_from_template) +import(xml2) importFrom(R.utils,gunzip) importFrom(R.utils,gzip) importFrom(base64enc,base64decode) diff --git a/R/read_gifti.R b/R/read_gifti.R index cc07d83..e21a569 100644 --- a/R/read_gifti.R +++ b/R/read_gifti.R @@ -177,7 +177,8 @@ readgii = function(file){ } L = list(data = L, - meta = meta, + file_meta = meta, + data_meta = MD, version = ver, transformations = trans, parsed_transformations = parsed_trans, diff --git a/R/write_gifti_from_template.R b/R/write_gifti_from_template.R new file mode 100644 index 0000000..342bdeb --- /dev/null +++ b/R/write_gifti_from_template.R @@ -0,0 +1,91 @@ +#' @title Write GIFTI from Template +#' @description Writes a GIFTI file identical to an existing file, except with +#' certain values replaced. +#' +#' @param template_file Path to the template GIFTI file +#' @param out_file Where to write the new GIFTI file +#' @param new_data List of new data values. The length of \code{new_data} +#' should match the number of "DataArray"s in the template GIFTI file. Default +#' \code{NULL} will leave the data unchanged. +#' +#' @import xml2 +#' @export +write_gifti_from_template = function(template_file, out_file, new_data=NULL){ + stopifnot(file.exists(template_file)) + if (!is.null(new_data)) { stopifnot(is.list(new_data)) } + + gii = read_xml(template_file) + gii = as_list(gii) + stopifnot(identical(names(gii), "GIFTI")) + + DataArray_mask = names(gii$GIFTI) == "DataArray" + n_DataArray = sum(DataArray_mask) # xml_attr(gii_xml, "NumberOfDataArrays") + if (!is.null(new_data)) { + stopifnot(is.list(new_data)) + } else { + new_data = vector("list", n_DataArray) + } + + for (ii in 1:length(new_data)) { + # Read the attributes (including dimensions) and data. + old_data = gii$GIFTI[[which(DataArray_mask)[ii]]] + att = attributes(old_data) + dims = att[paste0("Dim", 0:(as.numeric(att$Dimensionality)-1))] + + # Check that the data are compatible. + # [TO-DO]: check data type e.g. integer.s + # If no new data was provided, use the existing data. + if (!is.null(new_data[[ii]])) { + stopifnot(all.equal(dim(new_data[[ii]]), dims)) + } else { + new_data[[ii]] = data_decoder( + old_data$Data[[1]], + encoding=att$Encoding, + datatype=att$DataType, + endian=att$Endian + ) + } + + # Encode new data. + gii$GIFTI[[which(DataArray_mask)[ii]]]$Data[[1]] = data_encoder( + new_data[[ii]], + encoding=att$Encoding, + datatype=att$DataType, + endian=att$Endian + ) + } + + #gii = add_CDATA_to_gifti(gii) + write_xml(as_xml_document(gii), out_file, options = c("format", "as_xml")) + + invisible() +} + +# add_CDATA_to_gifti = function(gii) { +# stop("Does not work.") + +# make_CDATA = function(x){ paste0("") } +# add_CDATA_to_MetaData = function(MetaData) { +# for(ii in 1:length(MetaData)){ +# MetaData[[ii]]$Name = make_CDATA(MetaData[[ii]]$Name) +# MetaData[[ii]]$Value = make_CDATA(MetaData[[ii]]$Value) +# } +# MetaData +# } + +# # File metadata. +# gii$GIFTI$MetaData = add_CDATA_to_MetaData(gii$GIFTI$MetaData) + +# # Metadata of each DataArray. +# DataArray_mask = names(gii$GIFTI) == "DataArray" +# n_DataArray = sum(DataArray_mask) +# for(jj in 1:length(n_DataArray)){ +# for(ii in 1:length(gii$GIFTI[[which(DataArray_mask)[jj]]]$MetaData)){ +# gii$GIFTI[[which(DataArray_mask)[jj]]]$MetaData = add_CDATA_to_MetaData( +# gii$GIFTI[[which(DataArray_mask)[jj]]]$MetaData +# ) +# } +# } + +# gii +# } \ No newline at end of file diff --git a/man/convert_binary_datatype.Rd b/man/convert_binary_datatype.Rd index fdc5a72..cce182d 100644 --- a/man/convert_binary_datatype.Rd +++ b/man/convert_binary_datatype.Rd @@ -4,8 +4,10 @@ \alias{convert_binary_datatype} \title{Convert Binary Data Type} \usage{ -convert_binary_datatype(datatype = c("NIFTI_TYPE_UINT8", - "NIFTI_TYPE_INT32", "NIFTI_TYPE_UINT32", "NIFTI_TYPE_FLOAT32")) +convert_binary_datatype( + datatype = c("NIFTI_TYPE_UINT8", "NIFTI_TYPE_INT32", "NIFTI_TYPE_UINT32", + "NIFTI_TYPE_FLOAT32") +) } \arguments{ \item{datatype}{data type from GIFTI image} diff --git a/man/create_data_matrix.Rd b/man/create_data_matrix.Rd index 6130bf4..1539228 100644 --- a/man/create_data_matrix.Rd +++ b/man/create_data_matrix.Rd @@ -4,8 +4,11 @@ \alias{create_data_matrix} \title{Create Data Matrix with ordering respected} \usage{ -create_data_matrix(data, dims, ordering = c("RowMajorOrder", - "ColumnMajorOrder")) +create_data_matrix( + data, + dims, + ordering = c("RowMajorOrder", "ColumnMajorOrder") +) } \arguments{ \item{data}{Data output from \code{\link{data_decoder}}} diff --git a/man/data_decoder.Rd b/man/data_decoder.Rd index 162bf9b..bdb202e 100644 --- a/man/data_decoder.Rd +++ b/man/data_decoder.Rd @@ -4,10 +4,14 @@ \alias{data_decoder} \title{Array Data Decoder} \usage{ -data_decoder(values, encoding = c("ASCII", "Base64Binary", - "GZipBase64Binary", "ExternalFileBinary"), datatype = NULL, +data_decoder( + values, + encoding = c("ASCII", "Base64Binary", "GZipBase64Binary", "ExternalFileBinary"), + datatype = NULL, endian = c("little", "big", "LittleEndian", "BigEndian"), - ext_filename = NULL, n = NULL) + ext_filename = NULL, + n = NULL +) } \arguments{ \item{values}{text from XML of GIFTI image} diff --git a/man/data_encoder.Rd b/man/data_encoder.Rd index c7a9a72..dec9c17 100644 --- a/man/data_encoder.Rd +++ b/man/data_encoder.Rd @@ -4,9 +4,12 @@ \alias{data_encoder} \title{Array Data Encoder} \usage{ -data_encoder(values, encoding = c("ASCII", "Base64Binary", - "GZipBase64Binary"), datatype = NULL, endian = c("little", "big", - "LittleEndian", "BigEndian")) +data_encoder( + values, + encoding = c("ASCII", "Base64Binary", "GZipBase64Binary"), + datatype = NULL, + endian = c("little", "big", "LittleEndian", "BigEndian") +) } \arguments{ \item{values}{values to be encoded} diff --git a/man/download_gifti_data.Rd b/man/download_gifti_data.Rd index 6b0b4f5..80c87e5 100644 --- a/man/download_gifti_data.Rd +++ b/man/download_gifti_data.Rd @@ -4,8 +4,11 @@ \alias{download_gifti_data} \title{Download GIFTI Test Data} \usage{ -download_gifti_data(outdir = system.file(package = "gifti"), - overwrite = FALSE, ...) +download_gifti_data( + outdir = system.file(package = "gifti"), + overwrite = FALSE, + ... +) } \arguments{ \item{outdir}{Output directory for test file directory} diff --git a/man/gifti_map_value.Rd b/man/gifti_map_value.Rd index 0e6539e..3672340 100644 --- a/man/gifti_map_value.Rd +++ b/man/gifti_map_value.Rd @@ -4,8 +4,13 @@ \alias{gifti_map_value} \title{Map Values to Triangles from GIFTI} \usage{ -gifti_map_value(pointset, triangle, values, - indices = seq(nrow(pointset)), add_one = TRUE) +gifti_map_value( + pointset, + triangle, + values, + indices = seq(nrow(pointset)), + add_one = TRUE +) } \arguments{ \item{pointset}{pointset from GIFTI} diff --git a/man/write_gifti_from_template.Rd b/man/write_gifti_from_template.Rd new file mode 100644 index 0000000..363e43a --- /dev/null +++ b/man/write_gifti_from_template.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/write_gifti_from_template.R +\name{write_gifti_from_template} +\alias{write_gifti_from_template} +\title{Write GIFTI from Template} +\usage{ +write_gifti_from_template(template_file, out_file, new_data = NULL) +} +\arguments{ +\item{template_file}{Path to the template GIFTI file} + +\item{out_file}{Where to write the new GIFTI file} + +\item{new_data}{List of new data values. The length of \code{new_data} +should match the number of "DataArray"s in the template GIFTI file. Default +\code{NULL} will leave the data unchanged.} +} +\description{ +Writes a GIFTI file identical to an existing file, except with + certain values replaced. +} From 7ce606489cf9d4da5bc5eeecb1c6d3b87203b462 Mon Sep 17 00:00:00 2001 From: Damon Pham Date: Tue, 4 Aug 2020 02:38:31 -0700 Subject: [PATCH 3/6] Add label names to "gifti" object as the row names of the matrix. Draft write_gifti --- NAMESPACE | 1 + R/read_gifti.R | 6 +-- R/write_gifti.R | 92 +++++++++++++++++++++++++++++++++++ R/write_gifti_from_template.R | 7 ++- man/write_gifti.Rd | 16 ++++++ 5 files changed, 117 insertions(+), 5 deletions(-) create mode 100644 R/write_gifti.R create mode 100644 man/write_gifti.Rd diff --git a/NAMESPACE b/NAMESPACE index 7cb037f..4f8bb6b 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -18,6 +18,7 @@ export(readGIfTI) export(read_gifti) export(readgii) export(surf_triangles) +export(write_gifti) export(write_gifti_from_template) import(xml2) importFrom(R.utils,gunzip) diff --git a/R/read_gifti.R b/R/read_gifti.R index e21a569..40b9213 100644 --- a/R/read_gifti.R +++ b/R/read_gifti.R @@ -66,9 +66,9 @@ readgii = function(file){ meta = f("./Value") names(meta) = meta_names - lab_tab = xml_find_all(doc, "./LabelTable") - lab_tab = xml_attrs(xml_children(xml_find_all(doc, "./LabelTable"))) - lab_tab = do.call("rbind", lab_tab) + lab_tab_pre = xml_children(xml_find_all(doc, "./LabelTable")) + lab_tab = do.call("rbind", xml_attrs(lab_tab_pre)) + if (!is.null(lab_tab)) {rownames(lab_tab) = xml_text(lab_tab_pre)} darray = xml_find_all(doc, "./DataArray") # darray = as_list(darray) diff --git a/R/write_gifti.R b/R/write_gifti.R new file mode 100644 index 0000000..7ce480c --- /dev/null +++ b/R/write_gifti.R @@ -0,0 +1,92 @@ +#' @title Write .gii xml from "gifti" object +#' @description Writes a "gifti" object to a GIFTI file (ends in *.gii). +#' +#' @param gii The "gifti" object +#' @param out_file Where to write the new GIFTI file +#' +#' @import xml2 +#' @export +write_gifti <- function(gii, out_file){ + stopifnot(is.gifti(gii)) + + # GIFTI ROOT + root <- xml_add_child(xml_new_document(), + "GIFTI", + Version=gii$version, + `xmlns:xsi`="http://www.w3.org/2001/XMLSchema-instance", + noNamespaceSchemaLocation="http://brainvis.wustl.edu/caret6/xml_schemas/GIFTI_Caret.xsd", + NumberOfDataArrays=length(gii$data) + ) + + # Can't get this to work. + # So, I add the doctype declaration at the end via gsub + #xml_add_child(root, as.character(xml_dtd("GIFTI" ,"SYSTEM", "\"http://www.nitrc.org/frs/download.php/1594/gifti.dtd\">"))) + + # META DATA + file_meta <- xml_add_child(root, "MetaData") + for (ii in 1:length(gii$file_meta)) { + MD_ii <- xml_add_child(file_meta, "MD") + N_ii <- xml_add_child(MD_ii, "Name") + xml_add_child(N_ii, xml_cdata(attributes(gii$file_meta)$names[ii])) + V_ii <- xml_add_child(MD_ii, "Value") + xml_add_child(V_ii, xml_cdata(as.character(gii$file_meta)[ii])) + } + + # LABEL TABLE + labels <- xml_add_child(root, "LabelTable") + if (!is.null(gii$label)) { + for (ii in 1:nrow(gii$label)) { + label_ii <- xml_add_child( + labels, "Label", + Key=gii$label[ii,which(colnames(gii$label)=="Key")], + Red=gii$label[ii,which(colnames(gii$label)=="Red")], + Green=gii$label[ii,which(colnames(gii$label)=="Green")], + Blue=gii$label[ii,which(colnames(gii$label)=="Blue")], + Alpha=gii$label[ii,which(colnames(gii$label)=="Alpha")] + ) + xml_add_child(label_ii, xml_cdata(rownames(gii$label)[ii])) + } + } + + # DATA ARRAY + for (ii in 1:length(gii$data)) { + D_ii <- xml_add_child(root, "DataArray") + + # DataArray Attributes + for (jj in 1:ncol(gii$data_info)) { + atr_jj <- colnames(gii$data_info)[jj] + if (atr_jj %in% c("n", "name")) {next} + xml_attr(D_ii, atr_jj) <- gii$data_info[ii, atr_jj] + } + + # DataArray MetaData + D_ii_meta <- xml_add_child(D_ii, "MetaData") + for (jj in 1:nrow(gii$data_meta[[ii]])) { + MD_jj <- xml_add_child(D_ii_meta, "MD") + N_jj <- xml_add_child(MD_jj, "Name") + xml_add_child(N_jj, xml_cdata(gii$data_meta[[ii]][jj,1])) + V_jj <- xml_add_child(MD_jj, "Value") + xml_add_child(V_jj, xml_cdata(gii$data_meta[[ii]][jj,2])) + } + + # DataArray Transformations + for (jj in 1:length(gii$transformations[[ii]])) { + CSTM <- gii$transformations[[ii]][[jj]] + if (is.null(CSTM)) {next} + T_jj <- xml_add_child(D_ii, "CoordinateSystemTransformMatrix", CSTM) + } + + # DataArray Data + D_ii_data <- xml_add_child( + D_ii, + "Data", + data_encoder(gii$data[[ii]], gii$data_info$Encoding, gii$data_info$Endian) + ) + } + + # Add doctag and write it. + to_write <- as.character(root) + to_write <- gsub(" + ", "", "]]>", as.character(gii), fixed=TRUE), fixed=TRUE) + gii = gsub("", "", "]]>", as.character(gii), fixed=TRUE), fixed=TRUE) + writeLines(gii, out_file) + #write_xml(as_xml_document(gii), out_file, options = c("format", "as_xml")) invisible() } diff --git a/man/write_gifti.Rd b/man/write_gifti.Rd new file mode 100644 index 0000000..6079d30 --- /dev/null +++ b/man/write_gifti.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/write_gifti.R +\name{write_gifti} +\alias{write_gifti} +\title{Write .gii xml from "gifti" object} +\usage{ +write_gifti(gii, out_file) +} +\arguments{ +\item{gii}{The "gifti" object} + +\item{out_file}{Where to write the new GIFTI file} +} +\description{ +Writes a "gifti" object to a GIFTI file (ends in *.gii). +} From 365f29272e6a34f5d2f46e761900280ff6d56731 Mon Sep 17 00:00:00 2001 From: Damon Pham Date: Wed, 5 Aug 2020 06:01:04 -0700 Subject: [PATCH 4/6] patches to write_gifti, but still a problem with integer data encoding --- R/write_gifti.R | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/R/write_gifti.R b/R/write_gifti.R index 7ce480c..d2b056f 100644 --- a/R/write_gifti.R +++ b/R/write_gifti.R @@ -73,14 +73,29 @@ write_gifti <- function(gii, out_file){ for (jj in 1:length(gii$transformations[[ii]])) { CSTM <- gii$transformations[[ii]][[jj]] if (is.null(CSTM)) {next} - T_jj <- xml_add_child(D_ii, "CoordinateSystemTransformMatrix", CSTM) + T_jj <- xml_add_child(D_ii, "CoordinateSystemTransformMatrix") + xml_replace(T_jj, CSTM) } # DataArray Data + # [TO DO]: external files? + # [TO DO]: resolve below case + if (gii$data_info$Encoding[ii] != "ASCII" && gii$data_info$DataType == "NIFTI_TYPE_INT32") { + stop("Not working right now: NIFTI_TYPE_INT32 and non-ASCII encoding.") + } + dat <- gii$data[[ii]] + if ((length(dim(dat)) > 1) && gii$data_info$ArrayIndexingOrder=="RowMajorOrder") { + dat <- aperm(dat, length(dim(dat)):1) + } D_ii_data <- xml_add_child( D_ii, "Data", - data_encoder(gii$data[[ii]], gii$data_info$Encoding, gii$data_info$Endian) + data_encoder( + as.numeric(dat), + encoding = gii$data_info$Encoding[ii], + datatype = gii$data_info$DataType[ii], + endian = gii$data_info$Endian[ii] + ) ) } From 8714c9721a6e05f262558a77c964b03dd3432675 Mon Sep 17 00:00:00 2001 From: Damon Pham Date: Thu, 20 Aug 2020 17:57:10 -0700 Subject: [PATCH 5/6] Delete write_gifti_from_template.R --- R/write_gifti_from_template.R | 94 ----------------------------------- 1 file changed, 94 deletions(-) delete mode 100644 R/write_gifti_from_template.R diff --git a/R/write_gifti_from_template.R b/R/write_gifti_from_template.R deleted file mode 100644 index 962962d..0000000 --- a/R/write_gifti_from_template.R +++ /dev/null @@ -1,94 +0,0 @@ -#' @title Write GIFTI from Template -#' @description Writes a GIFTI file identical to an existing file, except with -#' certain values replaced. -#' -#' @param template_file Path to the template GIFTI file -#' @param out_file Where to write the new GIFTI file -#' @param new_data List of new data values. The length of \code{new_data} -#' should match the number of "DataArray"s in the template GIFTI file. Default -#' \code{NULL} will leave the data unchanged. -#' -#' @import xml2 -#' @export -write_gifti_from_template = function(template_file, out_file, new_data=NULL){ - stopifnot(file.exists(template_file)) - if (!is.null(new_data)) { stopifnot(is.list(new_data)) } - - gii = read_xml(template_file) - gii = as_list(gii) - stopifnot(identical(names(gii), "GIFTI")) - - DataArray_mask = names(gii$GIFTI) == "DataArray" - n_DataArray = sum(DataArray_mask) # xml_attr(gii_xml, "NumberOfDataArrays") - if (!is.null(new_data)) { - stopifnot(is.list(new_data)) - } else { - new_data = vector("list", n_DataArray) - } - - for (ii in 1:length(new_data)) { - # Read the attributes (including dimensions) and data. - old_data = gii$GIFTI[[which(DataArray_mask)[ii]]] - att = attributes(old_data) - dims = att[paste0("Dim", 0:(as.numeric(att$Dimensionality)-1))] - - # Check that the data are compatible. - # [TO-DO]: check data type e.g. integer.s - # If no new data was provided, use the existing data. - if (!is.null(new_data[[ii]])) { - stopifnot(all.equal(dim(new_data[[ii]]), dims)) - } else { - new_data[[ii]] = data_decoder( - old_data$Data[[1]], - encoding=att$Encoding, - datatype=att$DataType, - endian=att$Endian - ) - } - - # Encode new data. - gii$GIFTI[[which(DataArray_mask)[ii]]]$Data[[1]] = data_encoder( - new_data[[ii]], - encoding=att$Encoding, - datatype=att$DataType, - endian=att$Endian - ) - } - - gii = as.character(as_xml_document(gii)) - gii = gsub("", "", "]]>", as.character(gii), fixed=TRUE), fixed=TRUE) - gii = gsub("", "", "]]>", as.character(gii), fixed=TRUE), fixed=TRUE) - writeLines(gii, out_file) - #write_xml(as_xml_document(gii), out_file, options = c("format", "as_xml")) - - invisible() -} - -# add_CDATA_to_gifti = function(gii) { -# stop("Does not work.") - -# make_CDATA = function(x){ paste0("") } -# add_CDATA_to_MetaData = function(MetaData) { -# for(ii in 1:length(MetaData)){ -# MetaData[[ii]]$Name = make_CDATA(MetaData[[ii]]$Name) -# MetaData[[ii]]$Value = make_CDATA(MetaData[[ii]]$Value) -# } -# MetaData -# } - -# # File metadata. -# gii$GIFTI$MetaData = add_CDATA_to_MetaData(gii$GIFTI$MetaData) - -# # Metadata of each DataArray. -# DataArray_mask = names(gii$GIFTI) == "DataArray" -# n_DataArray = sum(DataArray_mask) -# for(jj in 1:length(n_DataArray)){ -# for(ii in 1:length(gii$GIFTI[[which(DataArray_mask)[jj]]]$MetaData)){ -# gii$GIFTI[[which(DataArray_mask)[jj]]]$MetaData = add_CDATA_to_MetaData( -# gii$GIFTI[[which(DataArray_mask)[jj]]]$MetaData -# ) -# } -# } - -# gii -# } \ No newline at end of file From 2925b380e082d989ed7fb0eed42a7aa8617181ce Mon Sep 17 00:00:00 2001 From: Damon Pham Date: Thu, 20 Aug 2020 18:01:18 -0700 Subject: [PATCH 6/6] remove write_gifti_from_template --- NAMESPACE | 1 - man/write_gifti_from_template.Rd | 21 --------------------- 2 files changed, 22 deletions(-) delete mode 100644 man/write_gifti_from_template.Rd diff --git a/NAMESPACE b/NAMESPACE index 4f8bb6b..dc03fb4 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -19,7 +19,6 @@ export(read_gifti) export(readgii) export(surf_triangles) export(write_gifti) -export(write_gifti_from_template) import(xml2) importFrom(R.utils,gunzip) importFrom(R.utils,gzip) diff --git a/man/write_gifti_from_template.Rd b/man/write_gifti_from_template.Rd deleted file mode 100644 index 363e43a..0000000 --- a/man/write_gifti_from_template.Rd +++ /dev/null @@ -1,21 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/write_gifti_from_template.R -\name{write_gifti_from_template} -\alias{write_gifti_from_template} -\title{Write GIFTI from Template} -\usage{ -write_gifti_from_template(template_file, out_file, new_data = NULL) -} -\arguments{ -\item{template_file}{Path to the template GIFTI file} - -\item{out_file}{Where to write the new GIFTI file} - -\item{new_data}{List of new data values. The length of \code{new_data} -should match the number of "DataArray"s in the template GIFTI file. Default -\code{NULL} will leave the data unchanged.} -} -\description{ -Writes a GIFTI file identical to an existing file, except with - certain values replaced. -}