---
name: "nipy_tsdiffana"
section: "1"
platform: "linux"
package: "python-nipy"
version: "0.4.2-2"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/nipy_tsdiffana"
---

# nipy\_tsdiffana(1)

Analyze, plot time series difference metrics

## NAME

nipy\_tsdiffana - Analyze, plot time series difference metrics

## DESCRIPTION

usage: nipy\_tsdiffana \[-h\] \[--out-file OUT\_FILE\] \[--write-results\]

- \[--out-path OUT\_PATH\]

  \[--out-fname-label OUT\_FNAME\_LABEL\] \[--time-axis TIME\_AXIS\] \[--slice-axis SLICE\_AXIS\] filename

-

  Analyze, plot time series difference metrics

### positional arguments:

- filename

  4D image filename

### optional arguments:

- **-h**, **--help**

  show this help message and exit

- **--out-file** OUT\_FILE

  graphics file to write to instead of leaving image on screen

- **--write-results**

  if specified, write diagnostic images and analysis variables, plot to OUT\_PATH. Mutually incompatible with OUT\_FILE

- **--out-path** OUT\_PATH

  path for output image files (default from FILENAME path

- **--out-fname-label** OUT\_FNAME\_LABEL

  mid part of output image / plot filenames

- **--time-axis** TIME\_AXIS

  Image axis for time

- **--slice-axis** SLICE\_AXIS

  Image axis for slice

nipy\_tsdiffana runs the time series diference algorithm over a 4D image volume, often and FMRI volume.

It works in one of three modes:

\* interactive : the time series difference plot appears on screen.  This is the

-

  default mode

\* non-interactive, plot only : write time series difference plot to graphic

-

  file. Use the "--out-file=\<myfilename\>" option to activate this mode

\* non-interactive, write plot, images and variables : write plot to file, and

-

  write generated diagnostic images and variables to files as well. Use the "--write-results" flag to activate this option. The generated filenames come from the results of the "--out-path" and "--out-fname-label" options (see help).

Write-results option, generated files **-------------------------------------**

When doing the time point analysis, we will make a difference volume between each time point and the next time point in the series.  If we have T volumes then there will be (T-1) difference volumes. Call the vector of difference volumes DV and the first difference volume DV\[0\].  So DV\[0\] results from subtraction of the second volume in the 4D input image from the first volume in the 4D input image.  The element-wise squared values from DV\[0\] is \*DV2\[0\]\*.

The following images will be generated. \<ext\> is the input filename extension (e.g. '.nii'):

\* "dv2\_max\_\<label\>\<ext\>" : 3D image volume, where each slice S is slice from

-

  all of DV2\[0\] (slice S) throudh DV2\[T-1\] (slice S) that has the maximum summed squared values.  This volume gives an idea of the worst (highest difference) slices across the whole time series.

\* "dv2\_mean\_\<label\>\<ext\>" : the mean of all DV2 volumes DV2\[0\] .. DV\[T-1\]

- across the volume (time) dimension.

  Higher voxel values in this volume mean

-

  that time-point to time point differences tended to be high in this voxel.

We also write the mean signal at each time point, and the mean squared difference between each slice in time, as variables to a 'npz' file named "tsdiff\_\<label\>.npz"

The filenames for the outputs are of the form \<out-path\>/\<some\_prefix\>\<label\>\<file-ext\> where \<out-path\> is the path specified by the **--out-path** option, or the path of the input filename; \<some\_prefix\> is one of the standard prefixes above, \<label\> is given by **--out-label**, or by the filename of the input image (with path and extension removed), and \<file-ext\> is '.png' for graphics, or the extension of the input filename for volume images.  For example, specifying only the input filename \`\`/some/path/fname.img\`\` will generate filenames of the form \`\`/some/path/tsdiff\_fname.png, */some/path/dv2\_max\_fname*.img\`\` etc.
