From d0d5fb64f1bc29c5914028da2193a80c9fff0b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Sch=C3=A4fer?= Date: Fri, 11 Feb 2022 14:33:31 +0100 Subject: [PATCH] bump version, replace donttest with dontrun in examples --- CHANGES | 3 ++- DESCRIPTION | 2 +- R/write_fs_annot.R | 4 ++-- R/write_fs_label.R | 2 +- R/write_fs_surface.R | 22 +++++++++++----------- man/write.fs.annot.Rd | 2 +- man/write.fs.annot.gii.Rd | 2 +- man/write.fs.label.Rd | 2 +- man/write.fs.surface.Rd | 2 +- man/write.fs.surface.asc.Rd | 2 +- man/write.fs.surface.byu.Rd | 2 +- man/write.fs.surface.gii.Rd | 2 +- man/write.fs.surface.mz3.Rd | 2 +- man/write.fs.surface.obj.Rd | 2 +- man/write.fs.surface.off.Rd | 2 +- man/write.fs.surface.off.ply2.Rd | 2 +- man/write.fs.surface.ply.Rd | 2 +- man/write.fs.surface.ply2.Rd | 2 +- man/write.fs.surface.vtk.Rd | 2 +- 19 files changed, 31 insertions(+), 30 deletions(-) diff --git a/CHANGES b/CHANGES index 1520ece..fc7fbb3 100644 --- a/CHANGES +++ b/CHANGES @@ -2,10 +2,11 @@ freesurferformats Changes ========================= -Version 0.1.16.dev (WIP) +Version 0.1.17 ------------------------- - Introduce 'default_label_name' parameter to read.fs.annot, better doc string for the same function. - Add function fs.surface.to.tmesh3d to transform an fs.surface mesh datastructure into an RGL tmesh datastructure. This method does not require rgl. +- Replace all 'donttest' in examples with 'dontrun' so CRAN does not run them. diff --git a/DESCRIPTION b/DESCRIPTION index 6f8dbcd..00e1244 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: freesurferformats Type: Package Title: Read and Write 'FreeSurfer' Neuroimaging File Formats -Version: 0.1.16.1 +Version: 0.1.17 Authors@R: person("Tim", "Schäfer", role = c("aut", "cre"), email = "ts+code@rcmd.org", comment = c(ORCID = "0000-0002-3683-8070")) Maintainer: Tim Schäfer Description: Provides functions to read and write neuroimaging data in various file formats, with a focus on 'FreeSurfer' formats. This includes, but is not limited to, the following file formats: 1) MGH/MGZ format files, which can contain multi-dimensional images or other data. Typically they contain time-series of three-dimensional brain scans acquired by magnetic resonance imaging (MRI). They can also contain vertex-wise measures of surface morphometry data. The MGH format is named after the Massachusetts General Hospital, and the MGZ format is a compressed version of the same format. 2) 'FreeSurfer' morphometry data files in binary 'curv' format. These contain vertex-wise surface measures, i.e., one scalar value for each vertex of a brain surface mesh. These are typically values like the cortical thickness or brain surface area at each vertex. 3) Annotation file format. This contains a brain surface parcellation derived from a cortical atlas. 4) Surface file format. Contains a brain surface mesh, given by a list of vertices and a list of faces. diff --git a/R/write_fs_annot.R b/R/write_fs_annot.R index 7963a51..9c1688e 100644 --- a/R/write_fs_annot.R +++ b/R/write_fs_annot.R @@ -53,7 +53,7 @@ write.fs.colortable <- function(filepath, colortable) { #' @param fs.annot instance of class `fs.annot`. If passed, this takes precedence over all other parameters and they should all be NULL (with the exception of `filepath`). #' #' @examples -#' \donttest{ +#' \dontrun{ #' # Load annotation #' annot_file = system.file("extdata", "lh.aparc.annot.gz", #' package = "freesurferformats", @@ -187,7 +187,7 @@ write.fs.annot <- function(filepath, num_vertices=NULL, colortable=NULL, labels_ #' @param annot fs.annot instance, an annotation. #' #' @examples -#' \donttest{ +#' \dontrun{ #' # Load annotation #' annot_file = system.file("extdata", "lh.aparc.annot.gz", #' package = "freesurferformats", diff --git a/R/write_fs_label.R b/R/write_fs_label.R index fe1ebd2..07e35ed 100644 --- a/R/write_fs_label.R +++ b/R/write_fs_label.R @@ -18,7 +18,7 @@ #' @family label functions #' #' @examples -#' \donttest{ +#' \dontrun{ #' # Write a simple label containing only vertex indices: #' label_vertices = c(1,2,3,4,5,1000,2000,2323,34,34545,42); #' write.fs.label(tempfile(fileext=".label"), label_vertices); diff --git a/R/write_fs_surface.R b/R/write_fs_surface.R index 34cdb48..342ba47 100644 --- a/R/write_fs_surface.R +++ b/R/write_fs_surface.R @@ -18,7 +18,7 @@ #' #' #' @examples -#' \donttest{ +#' \dontrun{ #' # Read a surface from a file: #' surface_file = system.file("extdata", "lh.tinysurface", #' package = "freesurferformats", mustWork = TRUE); @@ -142,7 +142,7 @@ check.verts.faces <- function(vertex_coords, faces) { #' @family mesh functions #' #' @examples -#' \donttest{ +#' \dontrun{ #' # Read a surface from a file: #' surface_file = system.file("extdata", "lh.tinysurface", #' package = "freesurferformats", mustWork = TRUE); @@ -194,7 +194,7 @@ write.fs.surface.asc <- function(filepath, vertex_coords, faces) { #' @family mesh functions #' #' @examples -#' \donttest{ +#' \dontrun{ #' # Read a surface from a file: #' surface_file = system.file("extdata", "lh.tinysurface", #' package = "freesurferformats", mustWork = TRUE); @@ -255,7 +255,7 @@ write.fs.surface.vtk <- function(filepath, vertex_coords, faces) { #' @note Do not confuse the Wavefront object file format (.obj) with the OFF format (.off), they are not identical. #' #' @examples -#' \donttest{ +#' \dontrun{ #' # Read a surface from a file: #' surface_file = system.file("extdata", "lh.tinysurface", #' package = "freesurferformats", mustWork = TRUE); @@ -323,7 +323,7 @@ write.fs.surface.obj <- function(filepath, vertex_coords, faces, vertex_colors=N #' @family mesh export functions #' #' @examples -#' \donttest{ +#' \dontrun{ #' # Read a surface from a file: #' surface_file = system.file("extdata", "lh.tinysurface", #' package = "freesurferformats", mustWork = TRUE); @@ -358,7 +358,7 @@ write.fs.surface.off <- function(filepath, vertex_coords, faces) { #' @family mesh export functions #' #' @examples -#' \donttest{ +#' \dontrun{ #' # Read a surface from a file: #' surface_file = system.file("extdata", "lh.tinysurface", #' package = "freesurferformats", mustWork = TRUE); @@ -416,7 +416,7 @@ write.fs.surface.off.ply2 <- function(filepath, vertex_coords, faces, format) { #' @family mesh export functions #' #' @examples -#' \donttest{ +#' \dontrun{ #' # Read a surface from a file: #' surface_file = system.file("extdata", "lh.tinysurface", #' package = "freesurferformats", mustWork = TRUE); @@ -451,7 +451,7 @@ write.fs.surface.ply2 <- function(filepath, vertex_coords, faces) { #' @family mesh export functions #' #' @examples -#' \donttest{ +#' \dontrun{ #' # Read a surface from a file: #' surface_file = system.file("extdata", "lh.tinysurface", #' package = "freesurferformats", mustWork = TRUE); @@ -550,7 +550,7 @@ ply.header.lines <- function(num_verts, num_faces, use_vertex_colors) { #' @family gifti writers #' #' @examples -#' \donttest{ +#' \dontrun{ #' # Read a surface from a file: #' surface_file = system.file("extdata", "lh.tinysurface", #' package = "freesurferformats", mustWork = TRUE); @@ -584,7 +584,7 @@ write.fs.surface.gii <- function(filepath, vertex_coords, faces) { #' @family mesh functions #' #' @examples -#' \donttest{ +#' \dontrun{ #' # Read a surface from a file: #' surface_file = system.file("extdata", "lh.tinysurface", #' package = "freesurferformats", mustWork = TRUE); @@ -695,7 +695,7 @@ fixed.format.lines <- function(vdata, format_string, max_entries_per_line=NULL) #' @family mesh functions #' #' @examples -#' \donttest{ +#' \dontrun{ #' # Read a surface from a file: #' surface_file = system.file("extdata", "lh.tinysurface", #' package = "freesurferformats", mustWork = TRUE); diff --git a/man/write.fs.annot.Rd b/man/write.fs.annot.Rd index b0a5b5a..f259439 100644 --- a/man/write.fs.annot.Rd +++ b/man/write.fs.annot.Rd @@ -30,7 +30,7 @@ write.fs.annot( Write an annotation to a FreeSurfer binary format annotation file in the new format (v2). An annotation (or brain parcellation) assigns each vertex to a label (or region). One of the regions is often called 'unknown' or similar and all vertices which are not relevant for the parcellation are assigned this label. } \examples{ -\donttest{ +\dontrun{ # Load annotation annot_file = system.file("extdata", "lh.aparc.annot.gz", package = "freesurferformats", diff --git a/man/write.fs.annot.gii.Rd b/man/write.fs.annot.gii.Rd index 43e4de4..5af6079 100644 --- a/man/write.fs.annot.gii.Rd +++ b/man/write.fs.annot.gii.Rd @@ -18,7 +18,7 @@ Write an annotation to a GIFTI XML file. This function does not write a GIFTI file that is valid according to the specification: it stores extra color data in the Label nodes, and there is more than one Label in the LabelTable node. } \examples{ -\donttest{ +\dontrun{ # Load annotation annot_file = system.file("extdata", "lh.aparc.annot.gz", package = "freesurferformats", diff --git a/man/write.fs.label.Rd b/man/write.fs.label.Rd index 5df4e5b..9bc22f8 100644 --- a/man/write.fs.label.Rd +++ b/man/write.fs.label.Rd @@ -31,7 +31,7 @@ Write vertex coordinates and vertex indices defining faces to a file in FreeSurf For a subject (MRI image pre-processed with FreeSurfer) named 'bert', an example file would be 'bert/label/lh.cortex'. } \examples{ -\donttest{ +\dontrun{ # Write a simple label containing only vertex indices: label_vertices = c(1,2,3,4,5,1000,2000,2323,34,34545,42); write.fs.label(tempfile(fileext=".label"), label_vertices); diff --git a/man/write.fs.surface.Rd b/man/write.fs.surface.Rd index fe088e4..99fd4e1 100644 --- a/man/write.fs.surface.Rd +++ b/man/write.fs.surface.Rd @@ -23,7 +23,7 @@ Write vertex coordinates and vertex indices defining faces to a file in FreeSurf For a subject (MRI image pre-processed with FreeSurfer) named 'bert', an example file would be 'bert/surf/lh.white'. This function writes the triangle version of the surface file format. } \examples{ -\donttest{ +\dontrun{ # Read a surface from a file: surface_file = system.file("extdata", "lh.tinysurface", package = "freesurferformats", mustWork = TRUE); diff --git a/man/write.fs.surface.asc.Rd b/man/write.fs.surface.asc.Rd index f033cef..21c0ddd 100644 --- a/man/write.fs.surface.asc.Rd +++ b/man/write.fs.surface.asc.Rd @@ -21,7 +21,7 @@ Write vertex coordinates and vertex indices defining faces to a file in FreeSurf For a subject (MRI image pre-processed with FreeSurfer) named 'bert', an example file would be 'bert/surf/lh.white.asc'. } \examples{ -\donttest{ +\dontrun{ # Read a surface from a file: surface_file = system.file("extdata", "lh.tinysurface", package = "freesurferformats", mustWork = TRUE); diff --git a/man/write.fs.surface.byu.Rd b/man/write.fs.surface.byu.Rd index 6f19069..005c7de 100644 --- a/man/write.fs.surface.byu.Rd +++ b/man/write.fs.surface.byu.Rd @@ -23,7 +23,7 @@ Write mesh to file in BYU ASCII format. This is a fixed field length ASCII format. Keep in mind that the BYU format expects the coordinates to be in the cube -1 to +1 on all three axes. } \examples{ -\donttest{ +\dontrun{ # Read a surface from a file: surface_file = system.file("extdata", "lh.tinysurface", package = "freesurferformats", mustWork = TRUE); diff --git a/man/write.fs.surface.gii.Rd b/man/write.fs.surface.gii.Rd index 0128527..8a71607 100644 --- a/man/write.fs.surface.gii.Rd +++ b/man/write.fs.surface.gii.Rd @@ -20,7 +20,7 @@ string the format that was written. One of "tris" or "quads". Currently only tri Write vertex coordinates and vertex indices defining faces to a file in GIFTI surface format. For a subject (MRI image pre-processed with FreeSurfer) named 'bert', an example file would be 'bert/surf/lh.white.asc'. } \examples{ -\donttest{ +\dontrun{ # Read a surface from a file: surface_file = system.file("extdata", "lh.tinysurface", package = "freesurferformats", mustWork = TRUE); diff --git a/man/write.fs.surface.mz3.Rd b/man/write.fs.surface.mz3.Rd index bc8ce68..1f9152f 100644 --- a/man/write.fs.surface.mz3.Rd +++ b/man/write.fs.surface.mz3.Rd @@ -25,7 +25,7 @@ Write mesh to file in mz3 binary format. This format is used by the surf-ice renderer. The format spec is at https://github.com/neurolabusc/surf-ice/tree/master/mz3. } \examples{ -\donttest{ +\dontrun{ # Read a surface from a file: surface_file = system.file("extdata", "lh.tinysurface", package = "freesurferformats", mustWork = TRUE); diff --git a/man/write.fs.surface.obj.Rd b/man/write.fs.surface.obj.Rd index 321c57e..5f73072 100644 --- a/man/write.fs.surface.obj.Rd +++ b/man/write.fs.surface.obj.Rd @@ -25,7 +25,7 @@ The wavefront object format is a simply ASCII format for storing meshes. Do not confuse the Wavefront object file format (.obj) with the OFF format (.off), they are not identical. } \examples{ -\donttest{ +\dontrun{ # Read a surface from a file: surface_file = system.file("extdata", "lh.tinysurface", package = "freesurferformats", mustWork = TRUE); diff --git a/man/write.fs.surface.off.Rd b/man/write.fs.surface.off.Rd index 6650260..b57508a 100644 --- a/man/write.fs.surface.off.Rd +++ b/man/write.fs.surface.off.Rd @@ -23,7 +23,7 @@ The Object File Format is a simply ASCII format for storing meshes. Do not confuse the OFF format (.off) with the Wavefront object file format (.obj), they are not identical. } \examples{ -\donttest{ +\dontrun{ # Read a surface from a file: surface_file = system.file("extdata", "lh.tinysurface", package = "freesurferformats", mustWork = TRUE); diff --git a/man/write.fs.surface.off.ply2.Rd b/man/write.fs.surface.off.ply2.Rd index 22e6018..ac9a889 100644 --- a/man/write.fs.surface.off.ply2.Rd +++ b/man/write.fs.surface.off.ply2.Rd @@ -25,7 +25,7 @@ The two formats are very similar, they only differ in the header lines. This fun Do not confuse the OFF format (.off) with the Wavefront object file format (.obj), they are not identical. } \examples{ -\donttest{ +\dontrun{ # Read a surface from a file: surface_file = system.file("extdata", "lh.tinysurface", package = "freesurferformats", mustWork = TRUE); diff --git a/man/write.fs.surface.ply.Rd b/man/write.fs.surface.ply.Rd index 6bb834d..bb1dfa9 100644 --- a/man/write.fs.surface.ply.Rd +++ b/man/write.fs.surface.ply.Rd @@ -22,7 +22,7 @@ string the format that was written. One of "tris" or "quads". Currently only tri The PLY format is a versatile ASCII format for storing meshes. Also known as Polygon File Format or Stanford Triangle Format. } \examples{ -\donttest{ +\dontrun{ # Read a surface from a file: surface_file = system.file("extdata", "lh.tinysurface", package = "freesurferformats", mustWork = TRUE); diff --git a/man/write.fs.surface.ply2.Rd b/man/write.fs.surface.ply2.Rd index 5e2a6b6..e6f151e 100644 --- a/man/write.fs.surface.ply2.Rd +++ b/man/write.fs.surface.ply2.Rd @@ -20,7 +20,7 @@ string the format that was written. One of "tris" or "quads". Currently only tri The PLY2 file format is a simply ASCII format for storing meshes. It is very similar to OFF and by far not as flexible as PLY. } \examples{ -\donttest{ +\dontrun{ # Read a surface from a file: surface_file = system.file("extdata", "lh.tinysurface", package = "freesurferformats", mustWork = TRUE); diff --git a/man/write.fs.surface.vtk.Rd b/man/write.fs.surface.vtk.Rd index 1da0cde..158caf0 100644 --- a/man/write.fs.surface.vtk.Rd +++ b/man/write.fs.surface.vtk.Rd @@ -20,7 +20,7 @@ string the format that was written. One of "tris" or "quads". Currently only tri Write mesh to file in VTK ASCII format } \examples{ -\donttest{ +\dontrun{ # Read a surface from a file: surface_file = system.file("extdata", "lh.tinysurface", package = "freesurferformats", mustWork = TRUE);