MRG: refactor of time slice routines #308

merged 12 commits into from Apr 1, 2014


None yet

2 participants


I hadn't really thought through selecting the slice axis for time-slice
routine utilties or for the diagnostic screening utilities.

Refactor the nipy_tsdiffana and nipy_diagnose command line utilties to
use a common interface for selecting slice and time axes. Put command
logic in a commands module and test more. Generalize diagnostic
screening utilities to any time axis rather than assuming time is the
last axis (the pca module explicitly allows this). Deprecate guess at
slice axis for screening function (but continue to guess for Nifti-like
images from the command line).

matthew-brett added some commits Feb 6, 2014
@matthew-brett matthew-brett NF: error if time diff slice axis is time axis
Running time_slice_diff on an array allowed the slice and the time axes
to be the same.  Test that they aren't.
@matthew-brett matthew-brett NF: function giving time difference for images
New function that accepts an image as input and returns time series
difference analysis on the image.
@matthew-brett matthew-brett WIP: refactor tsdiffana script to select slice axis 27cf49c
@matthew-brett matthew-brett WIP: refactoring diagnostics commands into modules def0732
@matthew-brett matthew-brett RF: refuse to load / convert MINC for now
Nibabel can load MINC, but now we need an API to get the axis names for
MINC, otherwise, the axes can be anywhere, but are most likely to be in
the opposite order to the ones the NIfTI needs.  Raise an error until we
have worked out how to do this right.
@matthew-brett matthew-brett TST: skip test for non-analyze types for now
In fact it turns out we can't sensibly load the non-analyze types, so
skip this test.
@matthew-brett matthew-brett TST: develop tests for tsdiffana command function
Use command function to test the tsdiffana interface.
@matthew-brett matthew-brett TST: extend tests for nipy_tsdiffana script
Smoke test for time and slice axis command line options.
@matthew-brett matthew-brett NF: tsdiffana option to save results volumes
Add option for tsdiffana to be able to save the results volumes created
during the analysis.
@matthew-brett matthew-brett BF+TST: test+fix bugs for PCA on reordered images
The `screen` and `write_screen_res` functions were assuming time-last
ordering in a couple of places.  Test and fix.
@matthew-brett matthew-brett RF+TST: refactor nipy_diagnose into module, test
Put logic for nipy_diagnose into commands module.

Use time and slice axis testing function developed for tsdiffana.

Extend tests of diagnose outputs.
@matthew-brett matthew-brett RF: deprecate guessed slice axis for screens func
The command line utilities nipy_tsdiffana and nipy_diagnose guess the
slice axis for Analyze-like files (like Nifti) - so the `screens`
function doesn't need to do that, and it doesn't match the API for --
say -- `pca_image`.  So deprecate the slice axis guess in `screens` and

Any comments here?

bthirion commented Apr 1, 2014

LGTM. Nice coverage by tests. Works like a charm on my data.


Thanks for the review - merging then.

@matthew-brett matthew-brett merged commit 788674f into nipy:master Apr 1, 2014

1 check passed

default The Travis CI build passed
@matthew-brett matthew-brett deleted the matthew-brett:refactor-image-time-diff branch Apr 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment