Skip to content

Commit 2b8342e

Browse files
authored
Merge pull request #520 from natverse/fix/r-4.5.1
Fixes for CRAN + R-4.5.1
2 parents 45429cc + e25f386 commit 2b8342e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+225
-185
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
needs: check
4949

5050
- name: Build CMTK
51-
if: ${{matrix.config.os != 'windows-latest'}}
51+
if: ${{matrix.config.os == 'macos-latest'}}
5252
run: sh ./build-cmtk.sh
5353
env:
5454
CC: clang

NAMESPACE

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,6 @@ importFrom(igraph,"V<-")
402402
importFrom(igraph,E)
403403
importFrom(igraph,V)
404404
importFrom(igraph,add_edges)
405-
importFrom(igraph,as.directed)
406-
importFrom(igraph,as.undirected)
407405
importFrom(igraph,as_edgelist)
408406
importFrom(igraph,bfs)
409407
importFrom(igraph,decompose)

R/alphashape3d.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#' \code{triang} entry in \bold{Value} section of
1616
#' \code{\link[alphashape3d]{ashape3d}} docs for details.)
1717
#' @return a \code{\link[rgl]{mesh3d}} object which can be plotted and
18-
#' manipulated using \code{\link{rgl}} and \code{nat} packages.
18+
#' manipulated using \code{rgl} and \code{nat} packages.
1919
#' @export
2020
#'
2121
#' @name as.mesh3d

R/cmtk-reformat.R

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ cmtk.targetvolume.default <- function(target, ...) {
8787
}
8888

8989
#' Reformat an image with a CMTK registration using the reformatx tool
90-
#'
90+
#'
9191
#' @details Note that if you are reformatting a mask then you will need to
9292
#' change the interpolation to "nn", since interpolating between e.g. mask
9393
#' levels 72 and 74 with 73 may have unintended consequences. Presently we
@@ -97,37 +97,38 @@ cmtk.targetvolume.default <- function(target, ...) {
9797
#' @param registrations One or more CMTK format registrations on disk
9898
#' @param output The path to the output image (defaults to
9999
#' \code{"<targetstem>_<floatingstem>.nrrd"})
100-
#' @param mask Whether to treat target as a binary mask (only reformatting
100+
#' @param mask Whether to treat target as a binary mask (only reformatting
101101
#' positive voxels)
102-
#' @param interpolation What interpolation scheme to use for output image
102+
#' @param interpolation What interpolation scheme to use for output image
103103
#' (defaults to linear - see details)
104104
#' @param dryrun Just print command
105105
#' @param Verbose Whether to show cmtk status messages and be verbose about file
106106
#' update checks. Sets command line \code{--verbose} option.
107-
#' @param MakeLock Whether to use a lock file to allow simple parallelisation
108-
#' (see \code{makelock})
109-
#' @param OverWrite Whether to OverWrite an existing output file. One of
110-
#' c("no","update","yes"). When OverWrite='update'
111-
#' \code{\link{RunCmdForNewerInput}} is used to determine if the output is
112-
#' older than any of the input files.
113-
#' @param filesToIgnoreModTimes Input files whose modification time should not
107+
#' @param MakeLock Whether to use a lock file to allow simple parallelisation
108+
#' (see \code{\link[nat.utils]{makelock}})
109+
#' @param OverWrite Whether to OverWrite an existing output file. One of
110+
#' c("no","update","yes"). When OverWrite='update'
111+
#' \code{\link[nat.utils]{RunCmdForNewerInput}} is used to determine if the
112+
#' output is older than any of the input files.
113+
#' @param filesToIgnoreModTimes Input files whose modification time should not
114114
#' be checked when determining if new output is required.
115-
#' @param ... additional arguments passed to CMTK \code{reformatx} after
115+
#' @param ... additional arguments passed to CMTK \code{reformatx} after
116116
#' processing by \code{\link{cmtk.call}}.
117117
#' @inheritParams cmtk.targetvolume
118118
#' @inheritParams xformimage.cmtkreg
119119
#' @importFrom nat.utils makelock removelock RunCmdForNewerInput
120-
#' @seealso \code{\link{cmtk.bindir}, \link{cmtk.call}, \link{makelock},
121-
#' \link{RunCmdForNewerInput}}
120+
#' @seealso \code{\link{cmtk.bindir}}, \code{\link{cmtk.call}},
121+
#' \code{\link[nat.utils]{makelock}},
122+
#' \code{\link[nat.utils]{RunCmdForNewerInput}}
122123
#' @export
123-
#' @return the path to the output image (whether or not it was re-created afresh)
124-
#' or \code{NA_character_} if no output was possible.
124+
#' @return the path to the output image (whether or not it was re-created
125+
#' afresh) or \code{NA_character_} if no output was possible.
125126
#' @examples
126127
#' \dontrun{
127128
#' cmtk.reformatx('myimage.nrrd', target='template.nrrd',
128129
#' registrations='template_myimage.list')
129-
#'
130-
#' # get full listing of command line options
130+
#'
131+
#' # get full listing of command line options
131132
#' system(cmtk.call('reformatx', help=TRUE))
132133
#' }
133134
cmtk.reformatx<-function(floating, registrations, output, target, mask=FALSE,

R/graph-nodes.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
#' friends. It is conceived of as slightly lower level and end users would
55
#' normally use the \code{rootpoints} methods.
66
#'
7-
#' \code{graph.nodes} should work for any \code{\link{igraph}} object
7+
#' \code{graph.nodes} should work for any \code{\link[igraph]{igraph}} object
88
#' (including \code{\link{ngraph}} objects, which inherit from \code{igraph}).
99
#' However the graph must be directed in order to return a root point
10-
#' @param x An \code{\link{ngraph}} or raw \code{\link{igraph}} object
10+
#' @param x An \code{\link{ngraph}} or raw \code{\link[igraph]{igraph}} object
1111
#' @param type one of root, end (which includes root) or branch
1212
#' @param original.ids Use named attribute to return original vertex ids (when
1313
#' available). Set to FALSE when this is not desired.

R/im3d.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ boundingbox.character<-function(x, ...) {
419419
#' \code{\link{xyzmatrix}} method is defined including \code{matrix} or
420420
#' \code{data.frame} objects describing 3D points as well as specialised
421421
#' classes such as \code{\link{neuron}}, \code{\link{neuronlist}}, \code{rgl}
422-
#' \code{\link{mesh3d}} objects.
422+
#' \code{\link[rgl]{mesh3d}} objects.
423423
#'
424424
#' @export
425425
#' @rdname boundingbox

R/interactive.R

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,26 @@ correct_root <- function(someneuronlist, brain = NULL){
100100
#' @description Generate a mesh3d model based on points contained in a
101101
#' neuronlist or neuron object, or another object that consists of 3D points.
102102
#'
103-
#' @param x a neuronlist or neuron object, or another object that consists of 3D points
103+
#' @param x a neuronlist or neuron object, or another object that consists of 3D
104+
#' points
104105
#' @param substrate whether to make the model based on the 3D location of
105-
#' connectors, neuron cable or both. Connectors are pre-synapse locations,
106-
#' e.g. the pre-synapses of a \code{catmaidneuron} from the R package \code{catmaid})
106+
#' connectors, neuron cable or both. Connectors are pre-synapse locations,
107+
#' e.g. the pre-synapses of a \code{catmaidneuron} from the R package
108+
#' \code{catmaid})
107109
#' @param alpha a single value or vector of values for alpha, fed to
108110
#' \code{alphashape3d::ashape3d}. Selection is subsequently interactive.
109-
#' @param auto.selection logical, whether or not to try and remove points based on interactively
110-
#' choosing simple values for clustering.
111-
#' @details Interactive function that allows a users to select points in 3D space from neuronlist/neuron objects,
112-
#' or another object that is coercible in 3D points using \code{\link{xyzmatrix}}. Points can first be automatically chosen, by
113-
#' selecting an integer number of nearest neighbours to find for each point using \code{nabor::\link{knn}}, and then a
114-
#' maximum distance at which nodes can be part of a cluster. Next, \code{\link{select_points}} is used to manually pick desired 3D
115-
#' points. Lastly, \code{alphashape3d::ashape3d} is used to create an alphashape around these points. The user can trial different values for
116-
#' alpha until they get their desired result.
111+
#' @param auto.selection logical, whether or not to try and remove points based
112+
#' on interactively choosing simple values for clustering.
113+
#' @details Interactive function that allows a users to select points in 3D
114+
#' space from neuronlist/neuron objects, or another object that is coercible
115+
#' in 3D points using \code{\link{xyzmatrix}}. Points can first be
116+
#' automatically chosen, by selecting an integer number of nearest neighbours
117+
#' to find for each point using \code{nabor::\link[nabor]{knn}}, and then a
118+
#' maximum distance at which nodes can be part of a cluster. Next,
119+
#' \code{\link{select_points}} is used to manually pick desired 3D points.
120+
#' Lastly, \code{alphashape3d::ashape3d} is used to create an alphashape
121+
#' around these points. The user can trial different values for alpha until
122+
#' they get their desired result.
117123
#' @examples
118124
#' \dontrun{
119125
#' # Make a model based off of fly olfactory projection neuron arbours

R/nat-package.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#'
2525
#' \code{neuron} objects containing connected trees can be converted to
2626
#' \code{\link{ngraph}} objects, a lightweight wrapper around the
27-
#' \code{\link{igraph}} library's \code{\link[igraph]{graph}} class that
27+
#' \code{\link[igraph]{igraph}} library's \code{\link[igraph]{graph}} class that
2828
#' preserves 3D coordinate information. This allows neurons to be manipulated
2929
#' based on their graph structure, e.g. by finding all nodes upstream (closer
3030
#' to the root) or downstream of a given node. The \code{\link{as.neuron}}
@@ -47,7 +47,7 @@
4747
#' \code{\link{plot3d.neuronlist}} and \code{\link{subset.neuronlist}}).
4848
#' Interactive 3D selection of neurons in a neuronlist is also possible using
4949
#' \code{\link{find.neuron}} (which makes use of \code{rgl}'s
50-
#' \code{\link{select3d}} function.
50+
#' \code{\link[rgl]{select3d}} function.
5151
#'
5252
#' \code{neuronlist} objects also provide additional functionality to
5353
#' streamline arithmetic (e.g. scaling all the points in all neurons see
@@ -165,7 +165,7 @@
165165
#' @seealso \code{\link{neuron}}, \code{\link{dotprops}},
166166
#' \code{\link{neuronlist}}, \code{\link{nlapply}}, \code{\link[nat]{plot3d}},
167167
#' \code{\link{xform}}, \code{\link{im3d}}, \code{\link{read.hxsurf}},
168-
#' \code{\link{rgl}} which is used for visualisation,
168+
#' \code{\link[rgl]{rgl}} which is used for visualisation,
169169
#' \code{\link{fileformats}}, \code{\link{read.neurons}}, \code{\link{cmtk}}.
170170
#' @keywords package
171171
#' @import rgl graphics grDevices utils

R/ndigest.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
#' machine on which the digest is being computed.
88
#' @param x Object for which a normalised digest will be computed.
99
#' @param ... Additional arguments passed to methods and then on to
10-
#' \code{\link{digest}}
10+
#' \code{\link[digest]{digest}}
1111
#' @return A character string containing the digest of the supplied object
12-
#' computed by \code{\link{digest}}.
12+
#' computed by \code{\link[digest]{digest}}.
1313
#' @export
1414
#' @importFrom digest digest
15-
#' @seealso \code{\link{digest}}
15+
#' @seealso \code{\link[digest]{digest}}
1616
ndigest<-function(x, ...) UseMethod('ndigest')
1717

1818
#' @details \code{ndigest.neuronlistfh} only considers the \code{keyfilemap} and

R/neuron-io-amira.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# read neurons in the format produced by Amira skeletonize plugin
2-
#' @importFrom igraph as.undirected
32
read.neuron.hxskel<-function(file, ...){
43
ndata=read.amiramesh(file)
54
required_fields=c("Coordinates", "NeighbourCount", "Radii", "NeighbourList")
@@ -40,7 +39,7 @@ read.neuron.hxskel<-function(file, ...){
4039
doubleg=ngraph(el, d$PointNo, directed=TRUE)
4140
# TODO see if we can make appropriate directed graph rather than converting
4241
# to undirected.
43-
ug=as.undirected(doubleg, mode='collapse')
42+
ug=as_undirected_nat(doubleg, mode='collapse')
4443
if(!inherits(ug,'ngraph')) class(ug)=c("ngraph",class(ug))
4544
n=as.neuron(ug, vertexData=d, origin=Origin, InputFileName=file, ... )
4645
n

0 commit comments

Comments
 (0)