Skip to content

RNifti

1.10.0Package record

Fast R and C++ Access to NIfTI Images

19packages dependsuggested by 9
55.7Kdownloads / year
45.0%test coverage
13/13flavors OK

Overview

About

Provides very fast read and write access to images stored in the NIfTI-1, NIfTI-2 and ANALYZE-7.5 formats, with seamless synchronisation of in-memory image objects between compiled C and interpreted R code. Also provides a simple image viewer, and a C/C++ API that can be used by other packages. Not to be confused with 'RNiftyReg', which performs image registration and applies spatial transformations.

Changes in 1.10.0

R interface

  • Methods for asNifti() are now discoverable by the package's C++ core, which significantly reduces the need to call the function explicitly, which in turn can save some data copying. The reference argument is no longer part of the generic's signature. Conversion of "nifti" and "MriImage" objects, from the oro.nifti and tractor.base packages, respectively, is now performed by pure-R methods rather than being hardcoded into the C++ layer, a change which ends up being performance-neutral (or even an improvement) due to fewer calls into the R API.
  • lyr() gains new label, alpha and dict arguments, for naming a layer explicitly (rather than relying on argument deparsing), setting layer opacity and mapping intensity values to arbitrary text, respectively. Its scale argument may now be a named vector, which is used as a discrete colour lookup table keyed by intensity value, rather than a continuous colour scale.
Show all changes in 1.10.0Hide the rest of the changes in 1.10.0
  • Assigning pixel dimensions with pixdim<- now produces an error if the replacement value's length doesn't match the image's dimensionality, rather than silently applying it incorrectly.
  • Setting the world-coordinate transformation of a niftiHeader object with qform<- or sform<- no longer has the side effect of overwriting its pixel dimensions, except for the sign of the first element (the "qfac").
  • writeNifti()'s version argument is now validated, and may be given as a string ("1" or "2") as well as numerically.
  • Assigning to imageAttributes() now produces a warning, rather than silently doing nothing, if the assignment would overwrite a core NIfTI attribute. It also now works correctly when the target object has no pre-existing attributes.
  • The mean() method for internal images now uses the same C++ back-end as the Summary group generic, thereby avoiding first converting the image to a full array.

API changes

  • A bug in the acquire()/release() reference-counting cycle in the NiftiImage C++ class has been fixed. Previously, changing the pointer wrapped by a NiftiImage object by copy-assignment could decrement the wrong reference counter, risking a premature deallocation. acquire() now takes an optional existing reference counter to take over, rather than relying on it having already been set as a side effect by the caller.
  • Converting a NIfTI-2 image containing more voxels than a NIfTI-1 image can represent now fails with an informative error, rather than silently overflowing.

Other changes

  • Reading corrupt or truncated image data now produces clearer, more informative errors.
  • A memory leak affecting the internal per-datatype handler on copy assignment of a NiftiImage, and undefined behaviour arising from use of an iterator after erasing the element it points to, have both been fixed.
  • C++ exceptions are now consistently raised using Rcpp::stop() rather than Rf_error(), ensuring correct stack unwinding.

From NEWS in the release

Install

Health

CRAN checks
13OK
Slowest check: 3.1 min · r-devel-windows-x86_64
Status changes
  • OK13 OK2026-09-08
  • ERROR12 OK, 1 ERROR2026-09-07
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK12 OK2026-04-25
Show 3 earlier changesHide 3 earlier changes
  • NOTE12 OK, 2 NOTE2026-04-22
  • ERROR11 OK, 2 NOTE, 1 ERROR2026-04-18
  • NOTE12 OK, 2 NOTE2026-03-10
Advisories

none known

Documentation

In release 1.10.0
READMEYes · 2,026 wordsVignettesNoNEWSYes · 33% structured · mentions 1.10.0Citation fileNoWebsitenot declared in DESCRIPTION
Help pages
19
Examples that run
91%10 run in a plain check · 1 never run
Exported functions with examples
59%
Documented parameters
91%
Return-value docs
88%
Help pages citing references
32%

Downloads

55.7K
CRAN downloads in the past year
Rank #1,813 · ~153/day · ~4.6K/mo
Daily download trend is not available in this view yet.
3.8K30 days
11.3K90 days
55.7K1 year
Compare downloads with other packages →
Also on903 r2u5 autocran11.3K conda_forge218 c2d4u

Repository

57Stars
15Forks
0Open issues
0Open PRs
8Releases
671Commits
3Commit identities
nifti-formatrmedical-imaging
671 commits · Last activity 2026-08-07 · 0% stars, 30d
Responsiveness
How these are sampled
PRs merged (all time)
33%
Median days to close, 50 most recently updated closed issues
4
Median days to close, 50 most recently updated closed PRs
2

Stars over time

2025-07-18 · 532026-09-20 · 57
PracticesBeta

6 development-tooling and community-health practices detected across 4 families in the upstream repository

Checks run against github.com/jonclayden/rnifti on 2026-10-21.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux and Windows

Docs source (1)
README.Rmd
Coverage (2)
Coverage reporting (Codecov).covrignore
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
7 external dependencies (excludes base and recommended)

Installing RNifti adds 1 package (1 with compiled code, 1.8 MB of source tarballs). Heaviest: Rcpp 1.8 MB.

Depends (0)
none
Imports (1)
LinkingTo (1)
Enhances (0)
none
Reverse dependencies
19direct
33indirect
Depends 1 · Imports 18 · LinkingTo 3
Suggested by 9
Show all 28 packagesHide all 28 packages
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

People & History

People (8)
Maintainer since 0.1.0 (2016), Author
Author · added in 0.2.2
Author · added in 0.2.2
Contributor · added in 0.2.2
Contributor · added in 0.7.0
Contributor · added in 0.2.2
Copyright holder · added in 0.2.2
Copyright holder · added in 0.2.2
Releases (39)

Pick two releases to compare their code metrics.

Show 34 earlier eventsHide 34 earlier events

Package metadata

First published
2016-09-01
Total releases
39 / 10 yrs
License
GPL-2 OSI
Download size
1.5 MB
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("RNifti")
Clayden, J., Adler, M., Cox, B., Fissell, K., Gailly, J., Hall, M., Jenkinson, M., & Reynolds, R. (2026). RNifti: Fast R and C++ Access to NIfTI Images (Version 1.10.0) [Computer software]. https://doi.org/10.32614/CRAN.package.RNifti

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for RNifti version 1.10.0 [Data set]. HJJB, LLC. Data release v2026-10-25. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy