Skip to main content

provenance for neuroimaging data

PyPI version Build Docs Coverage Code Quality

Research software impact DOI Twitter

Ever encountered a file of which you weren’t sure what analysis steps it had gone through? Ever wanted to know what types of data you have available for a subject in one overview? Automatically document an analysis pipeline?

Provenance is meta-data that tracks the ‘history’ of a file, and niprov is a python program to create, store and publish provenance for brain imaging files.

A list with all provenance attributes collected can be found here. Read more in the full online documentation (or pdf). For additional detailed information on image files, install nibabel,mne and/or pydicom.

Commandline Usage

Install niprov:

pip install niprov

Look for existing image files in your data directory:

provenance discover /my/data/directory

Run a transformation command and log it as provenance for the new file:

provenance record mcflirt -in t1flip_all_orig -out t1all_reg -refvol 0

Store provenance of known MEG files as an xml file:

provenance export --modality "MEG" --xml

Python API

import niprov
provenance = niprov.ProvenanceContext()

# Log an analysis step:
someAnalysisPackage.correctmotion(input='JD-fmri.nii', output='JD-fmri-3dmc.nii')
provenance.log('JD-fmri.nii', 'motion correction', ['JD-fmri-3dmc.nii'])

# Loop over images of John Smith and display a preview:
for image in provenance.get().bySubject('John Smith'):
    image.viewSnapshot()

# Make sure two files were acquired with the same parameters:
img1.compare(img2).assertEqualProtocol()

Web browser

By running the command provenance serve you can start a mini webserver in the background, and browse images in your webbrowser:

niprov-search niprov-details niprov-pipeline

Release files for niprov 0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for niprov 0.5
File Size Uploaded
niprov-0.5.tar.gz 239.6 kB Details

Release files / niprov-0.5.tar.gz

Download URL niprov-0.5.tar.gz
Size 239.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a0daa672b6564929865fedf2cb621dc34904446a7e5271d8b3736d4abf09d3ea
BLAKE2b-256 checksum
How to use checksums
50c44ac2c6daea9ce96b9bc9a6d50e227277831b33afebc65c6eb94dc5f65779
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.5 This release

1 release file

0.4.1

1 release file

0.4

1 release file

0.3

1 release file

0.2.1

1 release file

0.2

1 release file

0.1

1 release file

0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page