Package: neurotransform 0.2.0

neurotransform: Geometric Transforms for Neuroimaging Data

A self-contained, dependency-light library for geometric transforms in neuroimaging. Provides affine and nonlinear (warp) mappings between coordinate systems, plus volume-to-surface mapping primitives. Emphasizes correctness, elegance, and composability with a category-theoretic flavor.

Authors:Brad Buchsbaum [aut, cre]

neurotransform_0.2.0.tar.gz
neurotransform_0.2.0.zip(r-4.7-x86_64)neurotransform_0.2.0.zip(r-4.7-arm64)neurotransform_0.2.0.zip(r-4.6-x86_64)neurotransform_0.2.0.zip(r-4.6-arm64)neurotransform_0.2.0.zip(r-4.5-x86_64)
neurotransform_0.2.0.tgz(r-4.6-x86_64)neurotransform_0.2.0.tgz(r-4.6-arm64)neurotransform_0.2.0.tgz(r-4.5-x86_64)neurotransform_0.2.0.tgz(r-4.5-arm64)
neurotransform_0.2.0.tar.gz(r-4.7-arm64)neurotransform_0.2.0.tar.gz(r-4.7-x86_64)neurotransform_0.2.0.tar.gz(r-4.6-arm64)neurotransform_0.2.0.tar.gz(r-4.6-x86_64)
neurotransform_0.2.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
neurotransform/json (API)

# Install 'neurotransform' in R:
install.packages('neurotransform', repos = c('https://bbuchsbaum.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/bbuchsbaum/neurotransform/issues

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

openblascpp

4.00 score 7 scripts 106 exports 64 dependencies

Last updated from:933edddda4. Checks:15 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK201
linux-devel-x86_64OK265
source / vignettesOK351
linux-release-arm64OK211
linux-release-x86_64OK251
macos-release-arm64OK203
macos-release-x86_64OK535
macos-oldrel-arm64OK214
macos-oldrel-x86_64OK348
windows-devel-arm64OK353
windows-devel-x86_64OK356
windows-release-arm64OK355
windows-release-x86_64OK249
windows-oldrel-x86_64OK173
wasm-releaseOK178

Exports:adjointaffine_from_componentsAffine3DMorphismafni_aff12_to_rasafni_is_obliqueafni_read_aff12afni_read_aff12_arrayafni_write_aff12ants_h5_morphismapply_affineapply_resampling_planapply_surface_adjointapply_surface_resamplingas_morphism_pathbackproject_surface_to_volumebuild_affine_matrixcomposecompose_affinescompute_hashconvert_affine_conventiondecompose_affine_matrixdeformation_fielddetdetect_fnirt_def_typedetect_transform_typedice_coefficientextract_affinefsl_flirt_to_internal_affineget_linear_factoryget_loaderget_warp_loadergrid_coordsgrid_from_datagrid_ofgrid_spechas_adjointIdentityMorphisminvertinvert_affineis_affine_matrixis_affine_morphismis_invertibleis_linear_morphismis_valid_pathis_warp_morphismjaccard_indexjacobianjacobian_detjacobian_det_fieldlist_loaderslps_to_rasmake_resampling_planmesh_is_spheremesh_set_radiusmorphism_hashmorphism_kindoverlap_metricsras_to_lpsras_to_tkrasread_affine_matrix_txtread_imageread_linear_transformread_linear_transform_arrayread_transformread_x5register_loaderregister_warp_loaderresampleresample_toresample_volumereverse_surface_resampling_plansample_volume_on_surfacesampled_pointsshape_zoom_affineshowsolvesource_domainsource_ofsurface_meshsurface_resampling_plansurface_samplersurface_vertex_areasSurfToSurfMorphismtarget_domaintarget_oftkras_to_rastransformtransform_coordstransform_pathTransformFileErrorTransformIOErrorvalidate_pathvalidate_surface_meshVolToSurfMorphismvolume_samplerwarp_from_fieldWarp3DMorphismwrite_affine_matrix_txtwrite_imagewrite_linear_transformwrite_linear_transform_arraywrite_transformwrite_warp_fieldwrite_x5x5_domainx5_transform

Dependencies:assertthatbigassertrbigparallelrbigstatsrbitcachemclicodetoolscowplotcpp11dbscandeflistdigestdoParallelfarverfastmapffflockforeachfuturefuture.applygenericsggplot2globalsgluegtableisobanditeratorslabelinglatticelifecyclelistenvmagrittrMatrixmemoisemmapneuroim2parallellypatchworkpillarpkgconfigpspurrrR6RColorBrewerRcppRcppArmadilloRcppEigenRcppParallelRhpcBLASctlrlangrmioRNiftiRNiftyRegRSpectraS7scalesstringistringrtibbleutf8vctrsviridisLitewithr

Resampling surface data with explicit coverage
Distinguish missing values from zero | Resample integer labels by voting | Separate adjoint application from reverse resampling | Experimental adaptive area interpolation | Qualification boundaries

Last update: 2026-09-26
Started: 2026-09-26

Introduction to neurotransform
Overview | Design Philosophy | Core Concepts | What is a Morphism? | The Morphism Hierarchy | Quick Start | Creating Morphisms | Transforming Coordinates | Composing Transforms | Inverting Transforms | Working with Neuroimaging Tools | ANTs Transforms | FSL Transforms | AFNI Transforms | FreeSurfer Coordinates | Resampling Data | Volume Samplers | Grid Specifications | Resampling Plans | Jacobian Determinants | Volume-to-Surface Mapping | Coordinate Conventions | Affine Utilities | Building Affine Matrices | Decomposing Affine Matrices | Common Workflows | Workflow 1: Register Native to Template | Workflow 2: Transform ROI Coordinates | Workflow 3: Chain Multiple Transforms | Performance Tips | Summary | Further Reading

Last update: 2026-09-18
Started: 2026-04-12

Readme and manuals

Help Manual

Help pageTopics
Get adjoint (generalized inverse)adjoint adjoint,Affine3DMorphism-method adjoint,IdentityMorphism-method adjoint,Morphism-method adjoint,SurfToSurfMorphism-method adjoint,VolToSurfMorphism-method adjoint,Warp3DMorphism-method
Wrap an affine matrix built from components into an Affine3DMorphismaffine_from_components
Affine utilities (matrix-level and morphism helpers)affine_utils
Create a 3D affine morphismAffine3DMorphism
3D affine morphismAffine3DMorphism-class
Convert AFNI RAI/DICOM affine to RASafni_aff12_to_ras
Detect whether an affine is oblique (not cardinal axis-aligned)afni_is_oblique
Read AFNI .aff12.1D affine matrixafni_read_aff12
Read every affine row of an AFNI .aff12.1D fileafni_read_aff12_array
AFNI Warp and Affine Handlersafni_warp
Write AFNI .aff12.1D affine matricesafni_write_aff12
S4 Class Definitions for neurotransformall_class
Generic Function Definitionsall_generic
Load ANTs composite H5 as morphism or pathants_h5_morphism
Apply affine transformation to coordinatesapply_affine
Apply a resampling plan to a volumeapply_resampling_plan
Apply the Euclidean adjoint of a surface planapply_surface_adjoint
Apply a surface resampling plan to vertex dataapply_surface_resampling
Coerce list/paths to MorphismPathas_morphism_path
Backproject surface values into a volume (adjoint of VolToSurf sampling)backproject_surface_to_volume
Build a 4x4 affine matrix from componentsbuild_affine_matrix
Compose two morphismscompose compose,Morphism,Morphism-method compose,Morphism,MorphismPath-method compose,MorphismPath,Morphism-method compose,MorphismPath,MorphismPath-method
Compose two affine transformationscompose_affines
Compute a stable hash for objectscompute_hash
Convert affine conventions between "generic" (target→source world) and "fsl" (source→target vox)convert_affine_convention
Coordinate Convention Utilitiescoordinates
Apply affines -> warp -> affines to coordinates (target -> source)cpp_path_apply_affine_warp_affine
Apply arbitrary steps (affine/warp) to coordinates (target -> source)cpp_path_apply_steps
Decompose a 4x4 affine matrix into componentsdecompose_affine_matrix
Deformation fields and Jacobian mapsdeformation_field
Detect FNIRT deformation type (relative vs absolute)detect_fnirt_def_type
Detect transform type from a file pathdetect_transform_type
Dice coefficient for two imagesdice_coefficient
Extract affine matrix from dataextract_affine extract_affine,ANY-method extract_affine,array-method extract_affine,DenseNeuroVec-method extract_affine,DenseNeuroVol-method extract_affine,matrix-method
Convert FLIRT matrix to internal affinefsl_flirt_to_internal_affine
FSL Coordinate Convention Handlersfsl_ingest
Get linear transform IO backend factoryget_linear_factory
Retrieve a warp loader by nameget_loader get_warp_loader
Get world coordinates for a gridgrid_coords
Get grid specification from volume datagrid_from_data
Extract Grid from volume or grid-like inputgrid_of
Create a grid specificationgrid_spec
Grid: regular coordinate grid specificationGrid-class show,Grid-method
Check if morphism has an adjointhas_adjoint
Create an identity morphismIdentityMorphism
Identity morphismIdentityMorphism-class
Invert a morphisminvert invert,Affine3DMorphism-method invert,IdentityMorphism-method invert,Morphism-method invert,Warp3DMorphism-method
Invert an affine transformationinvert_affine
Check if an object is a numeric 4x4 affine matrixis_affine_matrix
Check if an object is an Affine3DMorphismis_affine_morphism
Check if morphism is exactly invertibleis_invertible
Check if morphism is linear (affine or identity)is_linear_morphism
Check if a morphism path is validis_valid_path
Check if morphism is a warp fieldis_warp_morphism
Jaccard index for two imagesjaccard_index
Jacobian Computationsjacobian jacobian,Affine3DMorphism,ANY-method jacobian,DeformationField,missing-method jacobian,IdentityMorphism,ANY-method jacobian,MorphismPath,ANY-method jacobian,SurfToSurfMorphism,ANY-method jacobian,VolToSurfMorphism,ANY-method jacobian,Warp3DMorphism,ANY-method
Compute Jacobian determinantsjacobian_det jacobian_det,Affine3DMorphism-method jacobian_det,IdentityMorphism-method jacobian_det,MorphismPath-method jacobian_det,Warp3DMorphism-method
Extract Jacobian determinant volume from a morphism on a gridjacobian_det_field
Jacobian field: collection of 3x3 Jacobian matricesdet,JacobianField-method JacobianField-class length,JacobianField-method show,JacobianField-method solve,JacobianField,missing-method [,JacobianField,numeric,ANY,ANY-method [,JacobianField,numeric-method
List all registered loaderslist_loaders
Convert LPS coordinates to RASlps_to_ras
FreeSurfer LTA IOlta_io
Build a resampling planmake_resampling_plan
Check whether a surface mesh is approximately sphericalmesh_is_sphere
Set mesh radius for spherical meshesmesh_set_radius
Morphism Constructors and Methodsmorphism
Compute hash for a morphismmorphism_hash
Get the kind of a morphismmorphism_kind
Virtual base class for morphismsMorphism-class show,Morphism-method
Morphism path (composed sequence)MorphismPath-class
Image overlap metricsoverlap_metrics
Convert RAS coordinates to LPSras_to_lps
Convert scanner RAS to FreeSurfer tkRASras_to_tkras
Read a 4x4 affine matrix from a text fileread_affine_matrix_txt
Simple image I/O using neuroim2read_image
Read an affine transform file into an Affine3DMorphismread_linear_transform
Read a series of linear transformsread_linear_transform_array
Read transform from file into a Morphismread_transform
Read X5 transform fileread_x5
Register a named warp loaderregister_loader register_warp_loader
Resample data through a morphismresample
High-level resampling helperresample_to
Resample volume to new geometryresample_volume
Resampling plans for repeated volume resamplingresampling_plan
Construct geometric resampling in the reverse directionreverse_surface_resampling_plan
Sample volume on surfacesample_volume_on_surface
Construct sampled pointssampled_points
Sampled points (irregular spatial reference)SampledPoints-class show,SampledPoints-method
Sampler Classes and Resamplingsampler
Sampler: data + interpolation encapsulationSampler-class show,Sampler-method
Build a centered voxel-to-world affine from shape and zoomsshape_zoom_affine
Get source domain of a morphismsource_domain source_domain,Morphism-method source_of source_of,Morphism-method source_of,MorphismPath-method
Construct a surface meshsurface_mesh
Surface Resampling Planssurface_resampling
Build a surface resampling plansurface_resampling_plan
Create a surface samplersurface_sampler
Bind vertex areas to a registered surface geometrysurface_vertex_areas
Surface mesh (vertices + faces)show,SurfaceMesh-method SurfaceMesh-class
Create a surface-to-surface morphismSurfToSurfMorphism
Surface-to-surface morphismSurfToSurfMorphism-class
Get target domain of a morphismtarget_domain target_domain,Morphism-method target_of target_of,Morphism-method target_of,MorphismPath-method
Convert FreeSurfer tkRAS to scanner RAStkras_to_ras
Transform coordinates through a morphism (pullback)transform transform,Affine3DMorphism-method transform,IdentityMorphism-method transform,MorphismPath-method transform,SurfToSurfMorphism-method transform,VolToSurfMorphism-method transform,Warp3DMorphism-method
Transform coordinates (compatibility alias)transform_coords transform_coords,Morphism-method transform_coords,MorphismPath-method
Transform IO Helperstransform_io
Transform Path Applicationtransform_path
Construct a transform file-format error conditionTransformFileError
Construct a transform IO error conditionTransformIOError
Validate a morphism pathvalidate_path
Validate a surface meshvalidate_surface_mesh
Create a volume-to-surface morphismVolToSurfMorphism
Volume-to-surface morphismVolToSurfMorphism-class
Create a volume samplervolume_sampler
Create an in-memory dense-field warp morphismwarp_from_field
Warp Field Loader Registrywarp_loader
Create a 3D warp field morphismWarp3DMorphism
3D warp field morphismWarp3DMorphism-class
Write a 4x4 affine matrix to a text filewrite_affine_matrix_txt
Write image using neuroim2write_image
Write an affine transform to diskwrite_linear_transform
Write a series of linear transformswrite_linear_transform_array
Write a transform to diskwrite_transform
Write a warp morphism as a NIfTI vector fieldwrite_warp_field
Write X5 transform filewrite_x5
Create an X5 domain descriptorx5_domain
X5 Transform IOx5_io
Create an X5 transform descriptorx5_transform