Copy of oro.nifti's orthographic function
with some tweaks such as adding L/R designations for left and right
ortho2(
x,
y = NULL,
xyz = NULL,
w = 1,
col = gray(0:64/64),
col.y = oro.nifti::hotmetal(),
zlim = NULL,
zlim.y = NULL,
NA.x = FALSE,
NA.y = TRUE,
crosshairs = TRUE,
col.crosshairs = "red",
xlab = "",
ylab = "",
axes = FALSE,
oma = c(0, 0, 0, ifelse(ycolorbar, 5, 0)),
mar = rep(0, 4),
bg = "black",
text = NULL,
text.color = "white",
text.cex = 2,
text.x = 32,
text.y = 32,
add.orient = FALSE,
mfrow = c(2, 2),
ybreaks = NULL,
breaks = NULL,
addlegend = FALSE,
leg.x = 32,
leg.y = 32,
legend,
leg.col,
leg.title = NULL,
leg.cex,
window = NULL,
ycolorbar = FALSE,
clabels = TRUE,
add = TRUE,
pdim = NULL,
useRaster = is.null(y),
mask = NULL,
...
)is an object of class nifti or similar.
is an object of class nifti or similar for the overlay.
is the coordinate for the center of the crosshairs.
is the time point to be displayed (4D arrays only).
is grayscale (by default).
is hotmetal (by default).
is the minimum and maximum `z' values passed into image.
is the minimum and maximum `z' values passed into image for the overlay.
Set any values of 0 in x to NA
Set any values of 0 in y to NA
is a logical value for the presence of crosshairs in all three orthogonal planes (default = TRUE).
is the color of the crosshairs (default = red).
is set to "" since all margins are set to zero.
is set to "" since all margins are set to zero.
is set to FALSE since all margins are set to zero.
is the size of the outer margins in the par function.
is the number of lines of margin in the par function.
is the background color in the par function.
allows the user to specify text to appear in the fourth (unused) pane.
is the color of the user-specified text (default = “white").
is the size of the user-specified text (default = 2).
x coordinate for text
y coordinate for text
(logical) Add left/right, A/P, etc. orientation
(numeric) layout of the 3 slices
(numeric) breaks for y to passed to
image
(numeric) breaks for x to passed to
image
(logical) add legend?
(numeric) x coordinate for legend
(numeric) y coordinate for legend
(character) legend text
(character) Colors for legend
(character) title for legend
(numeric) cex for legend
(vector) Length-2 vector to limit image to certain range
(logical) Should a colorbar for y be plotted
Label for colorbar (see colorbar)
Should the y-plot be added or its own plot? Used
in double_ortho
Pixel dimensions if passing in arrays. Will be overridden if
x is a nifti object
logical; if TRUE a bitmap raster is used to
plot the image instead of polygons. Passed to
image.
If a mask is passed, drop_empty_dim is applied
to both x and y
other arguments to the image function may be provided here.
set.seed(10)
x = oro.nifti::nifti(array(rnorm(1000), dim = rep(10, 3)))
ortho2(x)
y = x > 2
mask = x > 2.5
ortho2(x, y)
ortho2(x, y, mask = mask, add.orient = TRUE)
ortho2(x, y, mask = mask, add.orient = TRUE, add = FALSE)
nim = RNifti::asNifti(x, internal = FALSE)
ortho2(nim, y, mask = mask)
neurobase::ortho2(nim, x, mask = mask,
ybreaks = seq(min(x), max(x), length.out = 65), ycolorbar = TRUE)
ortho2(nim, y, mask = mask, add = FALSE)
arr_x = as.array(x)
arr_y = as.array(y)
ortho2( arr_x)
ortho2( arr_x, arr_y, useRaster = FALSE)
set.seed(10)
x = oro.nifti::nifti(array(rnorm(10000), dim = rep(10, 4)))
y = x > 2
mask = x > 2.5
ortho2(x, y)
set.seed(10)
x = oro.nifti::nifti(array(rnorm(100), dim = rep(10, 2)))
y = x > 2
mask = x > 2.5
ortho2(x, y)