-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
58 lines (41 loc) · 1.45 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
title: "neuroim2"
output:
md_document:
variant: markdown_github
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
<!-- badges: start -->
[![R-CMD-check](https://github.com/bbuchsbaum/neuroim2/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/bbuchsbaum/neuroim2/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
The `neuroim2` package is currently in development. The goal of the project is to to provide basic functionality for working with neuroimaging data in R. `neuroim2` It is an effort to modify and upgrade the `neuroim` package (https://github.com/bbuchsbaum/neuroim).
## Installation
You can install the development version of `neuroim2` (v. `0.1.0`) from Github with:
```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("bbuchsbaum/neuroim2")
```
## Usage
To read in a volumetric NIFTI formatted image, use the `read_vol` function:
```{r}
library(neuroim2)
fname <- system.file("extdata", "global_mask.nii", package="neuroim2")
vol <- read_vol(fname)
```
Now, `vol` can be treated as a three-dimensional array:
```{r}
v1 <- vol[1,1,1]
vol2 <- vol + vol
vol3 <- vol2 - vol
all(vol == vol3)
```
We can create a 4D image, by concatenating several 3D volumes:
```{r}
vec <- concat(vol, vol, vol2)
series1 <- vec[1,1,1,]
length(series1)
```
## Vignettes
See examples of use of `neuroim2` in the [vignettes](https://bbuchsbaum.github.io/neuroim2/articles/index.html).