Skip to content

Commit be0d1a6

Browse files
committed
doc(tat2): point to dR2*, add regexp info
1 parent f654632 commit be0d1a6

3 files changed

Lines changed: 72 additions & 16 deletions

File tree

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# LNCD Tools
2-
small scripts useful for data wrangling at the LNCD
3-
[![DOI](https://zenodo.org/badge/152143120.svg)](https://zenodo.org/badge/latestdoi/152143120)
2+
A set of small data wrangling scripts at the LNCD.
3+
[![https://doi.org/10.5281/zenodo.8302458](https://zenodo.org/badge/152143120.svg)](https://zenodo.org/badge/latestdoi/152143120)
4+
5+
Detailed information in the [docs](https://lncd.github.io/lncdtools/)
46

57

68
## Install
7-
See the [docs](https://lncd.github.io/lncdtools/lncdtools_setup/)
9+
See the [setup documentation](https://lncd.github.io/lncdtools/lncdtools_setup/).
810

911
Briefly clone and add to path
1012
```
@@ -18,24 +20,22 @@ echo "export PATH=\$PATH:$HOME/lncdtools" >> ~/.bashrc
1820

1921
## Tools
2022

23+
* [shell wrappers](https://lncd.github.io/lncdtools/shell/) `niinote`, `skip-exist`, `waitforjobs`, `dryrun`, `drytee`
24+
* [`tat2`](https://lncd.github.io/lncdtools/tat2/) (cf. [`dR2*`](https://github.com/Larsen-Lab/dR2star)), `tsnr`, `melanin_align` - modality specific wrappers
2125
* `4dConcatSubBriks` - extract a subbrick from a list of nifti label with luna ids. Useful for quality checking many structurals, subject masks, or individual contrasts. Wraps around 3dbucket and 3drefit:
2226
* `img_bg_rm` - use imagemagick's `convert` to set a background to alpha (remove). Taken from ["hackerb9" stack overflow solution](https://stackoverflow.com/questions/9155377/set-transparent-background-using-imagemagick-and-commandline-prompt). use on afni and suma screen captures
2327
* `mkmissing` - find missing patterns between two steps in a pipeline (file globs)
2428
* `r` - read dataframe from stdin and run R code with shortcuts and magic a la DataScienceToolkit's Rio
25-
* [`tat2`](https://lncd.github.io/lncdtools/tat2/), `melanin_align` - modality specific wrappers
2629

2730
### [tat2](https://lncd.github.io/lncdtools/tat2/)
2831

29-
also see more detaied [docs](https://lncd.github.io/lncdtools/tat2/)
30-
[<img src="docs/imgs/tat2_example.png" width=400 />](docs/imgs/tat2_examle.png)
31-
(`/Volumes/Hera/Datasets/ABCD/TAT2/tat2_avg3797_med_voldisc.nii.gz` and `/Volumes/Hera/Projects/7TBrainMech/scripts/mri/tat2/mean_176.nii.gz`)
32+
> [!TIP]
33+
> * `tat2` is now (2026) `dR2*` and hosted https://github.com/Larsen-Lab/dR2star
34+
> * dR2* (née tat2) validation is also hosted in its [own repository `tat2-validation`](https://github.com/LabNeuroCogDevel/tat2-validation)
3235
36+
Also see more detaied [docs](https://lncd.github.io/lncdtools/tat2/)
37+
[<img src="docs/imgs/tat2_example.png" width=400 />](docs/imgs/tat2_examle.png)
3338

34-
permutation of `tat2` calls were compared against R2 acquisitions:
35-
`-vol_median` is likely the approprate normalization. <br>
36-
[<img src="docs/imgs/tat2_matrix.png" width=400 />](docs/imgs/tat2_matrix.png)
37-
[<img src="docs/imgs/tat2_vs_r2prime.png" height=400 />](docs/imgs/tat2_vs_r2prime.png) <br>
38-
(`/Volumes/Phillips/mMR_PETDA/scripts/tat2/multiverse`)
3939

4040
## Notes
4141

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: About
33
---
44

55
# Overview
6-
[![DOI](https://zenodo.org/badge/152143120.svg)](https://zenodo.org/badge/latestdoi/152143120)
6+
[![https://doi.org/10.5281/zenodo.8302458](https://zenodo.org/badge/152143120.svg)](https://zenodo.org/badge/latestdoi/152143120)
77

88
[lncdtools](//github.com/lncd/lncdtools) is a suit of shell scripting, GNU Make, and general neuroimaging [^AFNI] companion tools developed in the [Laboratory of NeuroCognitive Development](https://lncd.pitt.edu).
99

@@ -13,9 +13,9 @@ Also see [LNCDR](https://github.com/LabNeuroCogDevel/LNCDR) for GNU R functions.
1313
## Highlights
1414

1515
* [setup](lncdtools_setup) - guide for "installing": clone and add to path
16-
* [`tat2`](tat2) - documentation for calculate time average T2* on 4D EPI
1716
* [BIDS](BIDS) - converting DICOM folders to a BIDS spec file hierarchy using `dcmdirtab`, `dcmtab_bids`, and `mknii`
18-
* [shell scripting tools](shell) - docs for shell scripting with `iffmain`, `waitforjobs`, `dryrun`, `drytee`
17+
* [shell scripting tools](shell) - docs for shell scripting with `iffmain`, `waitforjobs`, `skip-exist`, `dryrun`, `drytee`
1918
* `niinote` - warp a nifti creating command to append AFNI's note header (ad hoc provenance)
2019
* `mkls`, `mkifdiff`, `mkstat`, `mkmissing` - tools for using make with sentinel files
2120
* `3dDeconLogGLTs` `3dmaskave_grp` `3dMinStdClust` `3dNotes_each` `3dSeedCorr` `4dConcatDataTable` `4dConcatSubBriks` - afni extensions
21+
* [`tat2`](tat2) (cf. [`dR2*`](https://github.com/Larsen-Lab/dR2star)) - documentation for calculate time average T2* on 4D EPI

docs/tat2.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# Time averaged T2*
2+
3+
> [!TIP]
4+
> For the 2026 manuscript, `tat2` has been moved and renamed to [`dR2star`](https://github.com/Larsen-Lab/dR2star)).
5+
> Validation code for that is hosted in [own repository `tat2-validation`](https://github.com/LabNeuroCogDevel/tat2-validation)
6+
27
`tat2` ([code](https://github.com/LabNeuroCogDevel/lncdtools/blob/master/tat2)) wraps around `3dROIstats`, `3dcalc`, and `3dTstat` to reduce 4D EPI BOLD data to a per-voxel (3D) measure (`nT2*`) that is inversely related to iron concentration.
38

49
This is used in
@@ -27,7 +32,43 @@ see `tat2 --help`
2732
tat2 -output derive/tat2.nii.gz func/*preproc_bold.nii.gz
2833
```
2934

35+
Will combine all of the matching `*preroc_bold.nii.gz` (presumably multiple 4D time series fMRI data) into a single 3D image `derive/tat2.nii.gz`
36+
37+
### fmriprep
38+
39+
Very limited fmriprep support is provided. More support is offered by [`dR2star`](https://github.com/Larsen-Lab/dR2star).
40+
41+
```
42+
exort FD_THRES=0.3
43+
tat2 -fmriprep /path/to/fmriprep-deriv/
44+
# will make a tat2star file for each func folder found.
45+
# e.g. /path/to/fmriprep-deriv/sub-1/ses-1/func/sub-1_ses-1_desc-preproc_tat2star.nii.gz
46+
```
47+
3048
### With options and relative paths
49+
See https://regex101.com/r/bM6p7X/1 for visual representation and playground of the regular expressions explored below.
50+
51+
The reference region mask and/or censor files may be in another folder or named specific to a participant's visit and run input file.
52+
`-mask_rel` and `-censor_rel` support `s/search/replace/` regular expressions to transform the input `*.nii.gz` name into a matching motion or censor file.
53+
54+
55+
Imagine a somewhat pathological file organization like
56+
```
57+
├── censor_files
58+
│   └── sub-1_ses-2_run-1
59+
│   └── preproc_censor-fd0.3.1D
60+
│   └── sub-1_ses-2_run-2
61+
│   └── preproc_censor-fd0.3.1D
62+
└── func
63+
└── sub-1_ses-2_run-1_desc-preproc_bold.nii.gz
64+
└── sub-1_ses-2_run-1_desc-brain_mask.nii.gz
65+
...
66+
└── sub-1_ses-2_run-2_desc-preproc_bold.nii.gz
67+
└── sub-1_ses-2_run-2_desc-brain_mask.nii.gz
68+
```
69+
70+
`tat2` can accommodate matching pairing each run to the appropriate file using regular expression search and replace.
71+
3172
```
3273
sub_ses="sub-01/ses-01"
3374
censor_regex='s/.*func\/(.*)-preproc_bold.nii.gz/censor_files\/\1\/preproc_censor-fd0.3.1D/'
@@ -42,9 +83,24 @@ tat2 \
4283
deriv/$sub_ses/func/*space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz
4384
```
4485

86+
* sibling mask files are matched using `-mask_rel 's/preproc_bold.nii.gz/brain_mask.nii.gz/'`
87+
1. searches each input file for `preproc_bold.nii.gz`
88+
2. and replaces that with `brain_maks.nii.gz`
89+
* to match censor files across directories, `censor_regex` uses `s/.*func\/(.*)-preproc_bold.nii.gz/censor_files\/\1\/preproc_censor-fd0.3.1D/`). Also see https://regex101.com/r/bM6p7X/1
90+
1. searches each input file for `.*func\/(.*)-preproc_bold.nii.gz`, where
91+
* `\/` "escapes" the directory slash, escape to distinguish it from the search-replace deliminator in `s///`
92+
* where `(.*)` captures the matching part to reuse as `\\1` in
93+
3. the replacement like `censor_files\/\1\/preproc_censor-fd0.3.1D`
94+
95+
Also see [issue#5](https://github.com/lncd/lncdtools/issues/5).
96+
4597
## Preprocessing
98+
4699
We slice-time and motion correction, skull strip, despiking (wavelet), and warp to MNI before running `tat2`.
47-
Notably, smoothing is not included in datasets input to `tat2`.
100+
The validation manuscript ([`tat2-validation`](https://github.com/LabNeuroCogDevel/tat2-validation)) also uses ABCD minimally preprocessed inputs.
101+
102+
> [!CAUTION]
103+
> Notably, smoothing is not included in datasets input to `tat2`.
48104
49105
## Pipeline
50106
![](/lncdtools/imgs/tat2.png)

0 commit comments

Comments
 (0)