|
31 | 31 | #' \dontrun{ |
32 | 32 | #' library(nat) |
33 | 33 | #' library(nat.ggplot) |
34 | | -#' |
| 34 | +#' |
35 | 35 | #' # Plot the neurons |
36 | 36 | #' plot3d(banc.skels) |
37 | | -#' |
| 37 | +#' |
38 | 38 | #' # Use with ggplot2 |
39 | 39 | #' library(ggplot2) |
40 | 40 | #' ggplot() + geom_neuron(banc.skels, rotation_matrix = banc_view) |
|
76 | 76 | #' \dontrun{ |
77 | 77 | #' library(ggplot2) |
78 | 78 | #' library(nat.ggplot) |
79 | | -#' |
| 79 | +#' |
80 | 80 | #' # Plot synapses coloured by type |
81 | 81 | #' ggplot(banc.syns, aes(x = X, y = Y)) + |
82 | 82 | #' geom_point(aes(colour = factor(prepost)), alpha = 0.5) + |
|
124 | 124 | #' \dontrun{ |
125 | 125 | #' library(nat.ggplot) |
126 | 126 | #' library(ggplot2) |
127 | | -#' |
| 127 | +#' |
128 | 128 | #' # Plot split neurons showing axon/dendrite compartments |
129 | | -#' ggplot() + geom_neuron(bc.neurons.flow[[1]], rotation_matrix = banc_view) |
130 | | -#' |
| 129 | +#' ggplot() + geom_neuron(banc.neurons.flow[[1]], rotation_matrix = banc_view) |
| 130 | +#' |
131 | 131 | #' # Plot all split neurons |
132 | | -#' ggneuron(bc.neurons.flow, rotation_matrix = banc_view) |
| 132 | +#' ggneuron(banc.neurons.flow, rotation_matrix = banc_view) |
133 | 133 | #' } |
134 | | -"bc.neurons.flow" |
| 134 | +"banc.neurons.flow" |
135 | 135 |
|
136 | 136 | #' Low Resolution BANC Brain Neuropil Mesh |
137 | 137 | #' |
|
156 | 156 | #' \dontrun{ |
157 | 157 | #' library(nat.ggplot) |
158 | 158 | #' library(ggplot2) |
159 | | -#' |
| 159 | +#' |
160 | 160 | #' # Plot brain neuropil with default view |
161 | | -#' ggplot() + |
162 | | -#' geom_neuron(banc.brain_neuropil, |
163 | | -#' cols = c("grey75", "grey50"), |
| 161 | +#' ggplot() + |
| 162 | +#' geom_neuron(banc.brain_neuropil, |
| 163 | +#' cols = c("grey75", "grey50"), |
164 | 164 | #' alpha = 0.3) |
165 | | -#' |
| 165 | +#' |
166 | 166 | #' # Plot with frontal view |
167 | | -#' ggplot() + |
168 | | -#' geom_neuron(banc.brain_neuropil, |
| 167 | +#' ggplot() + |
| 168 | +#' geom_neuron(banc.brain_neuropil, |
169 | 169 | #' rotation_matrix = banc_view, |
170 | | -#' cols = c("grey75", "grey50"), |
| 170 | +#' cols = c("grey75", "grey50"), |
171 | 171 | #' alpha = 0.3) |
172 | 172 | #' } |
173 | 173 | "banc.brain_neuropil" |
|
176 | 176 | #' |
177 | 177 | #' @description |
178 | 178 | #' A list of simplified mesh3d objects representing the 3D surface reconstructions |
179 | | -#' of 5 LHPD2a1 neurons from the BANC connectome dataset. These meshes have been |
180 | | -#' decimated to approximately 20% of their original face count for efficient |
181 | | -#' visualisation whilst preserving morphological features. |
| 179 | +#' of 4 LHPD2a1 neurons from the BANC connectome dataset. |
182 | 180 | #' |
183 | 181 | #' @format A list of 5 mesh3d objects, each containing vertices and faces defining |
184 | 182 | #' the 3D surface of a neuron. |
|
204 | 202 | #' \dontrun{ |
205 | 203 | #' library(nat.ggplot) |
206 | 204 | #' library(ggplot2) |
207 | | -#' |
| 205 | +#' |
208 | 206 | #' # Plot first neuron mesh |
209 | | -#' ggplot() + |
210 | | -#' geom_neuron(banc.meshes[[1]], |
| 207 | +#' ggplot() + |
| 208 | +#' geom_neuron(banc.meshes[[1]], |
211 | 209 | #' rotation_matrix = banc_view, |
212 | 210 | #' cols = c("purple", "magenta")) |
213 | | -#' |
| 211 | +#' |
214 | 212 | #' # Plot all neuron meshes |
215 | | -#' ggneuron(banc.meshes, |
| 213 | +#' ggneuron(banc.meshes, |
216 | 214 | #' rotation_matrix = banc_view, |
217 | 215 | #' cols = c("purple", "magenta")) |
218 | 216 | #' } |
|
223 | 221 | #' @description |
224 | 222 | #' A 4x4 rotation matrix for displaying BANC connectome data in a frontal view. |
225 | 223 | #' This matrix can be applied to any 3D neuroanatomy data to rotate it into a |
226 | | -#' standard frontal viewing orientation. |
| 224 | +#' standard frontal viewing orientation. Provded as an example for the user. |
227 | 225 | #' |
228 | 226 | #' @format A 4x4 numeric matrix representing a 3D rotation transformation. |
229 | 227 | #' |
|
239 | 237 | #' library(nat.ggplot) |
240 | 238 | #' library(nat) |
241 | 239 | #' library(ggplot2) |
242 | | -#' |
| 240 | +#' |
243 | 241 | #' # Use the frontal view for plotting |
244 | | -#' ggplot() + |
| 242 | +#' ggplot() + |
245 | 243 | #' geom_neuron(banc.skels, rotation_matrix = banc_view) |
246 | | -#' |
| 244 | +#' |
247 | 245 | #' # Create a custom view interactively |
248 | 246 | #' plot3d(banc.brain_neuropil) |
249 | 247 | #' # Rotate to desired angle with mouse |
250 | 248 | #' my_view <- rgl_view()$userMatrix |
251 | 249 | #' # Use custom view |
252 | | -#' ggplot() + |
| 250 | +#' ggplot() + |
253 | 251 | #' geom_neuron(banc.brain_neuropil, rotation_matrix = my_view) |
254 | 252 | #' } |
255 | 253 | "banc_view" |
0 commit comments