-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
535 additions
and
111 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: f87de8b0c59005225db4e18afe44d67f | ||
config: 07d27a37c07d9a0511eade0d8bbceda9 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
.. _reproin: | ||
|
||
reproin | ||
======= | ||
This is the reproin heuristic, copied from `heudiconv <https://github.com/nipy/heudiconv/blob/master/heudiconv/heuristics/reproin.py>`_ | ||
|
||
|
||
.. code-block:: console | ||
(AKA dbic-bids) Flexible heuristic to establish BIDS DataLad datasets hierarchy | ||
Initially developed and deployed at Dartmouth Brain Imaging Center | ||
(http://dbic.dartmouth.edu) using Siemens Prisma 3T under the umbrellas of the | ||
Center of Reproducible Neuroimaging Computation (ReproNim, http://repronim.org) | ||
and Center for Open Neuroscience (CON, http://centerforopenneuroscience.org). | ||
## Dataset ownership/location | ||
Datasets will be arranged in a hierarchy similar to how study/exam cards are | ||
arranged at the scanner console. You should have | ||
- "region" defined per each PI, | ||
- on the first level most probably as PI_StudentOrRA/ (e.g., Gobbini_Matteo) | ||
- StudyID_StudyName/ (e.g. 1002_faceangles) | ||
- Arbitrary name for the exam card -- it doesn't get into Study Description. | ||
Selecting specific exam card would populate Study Description field using | ||
aforementioned levels, which will be used by this heuristic to decide on the | ||
location of the dataset. | ||
In case of multiple sessions, it is recommended to generate separate "cards" | ||
per each session. | ||
## Sequence naming on the scanner console | ||
Sequence names on the scanner must follow this specification to avoid manual | ||
conversion/handling: | ||
[PREFIX:]<seqtype[-label]>[_ses-<SESID>][_task-<TASKID>][_acq-<ACQLABEL>][_run-<RUNID>][_dir-<DIR>][<more BIDS>][__<custom>] | ||
where | ||
[PREFIX:] - leading capital letters followed by : are stripped/ignored | ||
<...> - value to be entered | ||
[...] - optional -- might be nearly mandatory for some modalities (e.g., | ||
run for functional) and very optional for others | ||
*ID - alpha-numerical identifier (e.g. 01,02, pre, post, pre01) for a run, | ||
task, session. Note that makes more sense to use numerical values for | ||
RUNID (e.g., _run-01, _run-02) for obvious sorting and possibly | ||
descriptive ones for e.g. SESID (_ses-movie, _ses-localizer) | ||
<seqtype[-label]> | ||
a known BIDS sequence type which is usually a name of the folder under | ||
subject's directory. And (optional) label is specific per sequence type | ||
(e.g. typical "bold" for func, or "T1w" for "anat"), which could often | ||
(but not always) be deduced from DICOM. Known to BIDS modalities are: | ||
anat - anatomical data. Might also be collected multiple times across | ||
runs (e.g. if subject is taken out of magnet etc), so could | ||
(optionally) have "_run" definition attached. For "standard anat" | ||
labels, please consult to "8.3 Anatomy imaging data" but most | ||
common are 'T1w', 'T2w', 'angio' | ||
func - functional (AKA task, including resting state) data. | ||
Typically contains multiple runs, and might have multiple different | ||
tasks different per each run | ||
(e.g. _task-memory_run-01, _task-oddball_run-02) | ||
fmap - field maps | ||
dwi - diffusion weighted imaging (also can as well have runs) | ||
_ses-<SESID> (optional) | ||
a session. Having a single sequence within a study would make that study | ||
follow "multi-session" layout. A common practice to have a _ses specifier | ||
within the scout sequence name. You can either specify explicit session | ||
identifier (SESID) or just say to maintain, create (starts with 1). | ||
You can also use _ses-{date} in case of scanning phantoms or non-human | ||
subjects and wanting sessions to be coded by the acquisition date. | ||
_task-<TASKID> (optional) | ||
a short name for a task performed during that run. If not provided and it | ||
is a func sequence, _task-UNKNOWN will be automatically added to comply with | ||
BIDS. Consult http://www.cognitiveatlas.org/tasks on known tasks. | ||
_acq-<ACQLABEL> (optional) | ||
a short custom label to distinguish a different set of parameters used for | ||
acquiring the same modality (e.g. _acq-highres, _acq-lowres etc) | ||
_run-<RUNID> (optional) | ||
a (typically functional) run. The same idea as with SESID. | ||
_dir-[AP,PA,LR,RL,VD,DV] (optional) | ||
to be used for fmap images, whenever a pair of the SE images is collected | ||
to be used to estimate the fieldmap | ||
<more BIDS> (optional) | ||
any other fields (e.g. _acq-) from BIDS acquisition | ||
__<custom> (optional) | ||
after two underscores any arbitrary comment which will not matter to how | ||
layout in BIDS. But that one theoretically should not be necessary, | ||
and (ab)use of it would just signal lack of thought while preparing sequence | ||
name to start with since everything could have been expressed in BIDS fields. | ||
## Last moment checks/FAQ: | ||
- Functional runs should have _task-<TASKID> field defined | ||
- Do not use "+", "_" or "-" within SESID, TASKID, ACQLABEL, RUNID, so we | ||
could detect "canceled" runs. | ||
- If run was canceled -- just copy canceled run (with the same index) and re-run | ||
it. Files with overlapping name will be considered duplicate/canceled session | ||
and only the last one would remain. The others would acquire | ||
__dup0<number> suffix. | ||
Although we still support "-" and "+" used within SESID and TASKID, their use is | ||
not recommended, thus not listed here | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,75 @@ | ||
============ | ||
Usage | ||
============ | ||
.. code-block:: console | ||
usage: xnat_downloader [-h] [-c CONFIG] [-i INPUT_JSON] | ||
xnat_downloader downloads xnat dicoms and saves them in BIDs compatible | ||
directory format | ||
optional arguments: | ||
-h, --help show this help message and exit | ||
-c CONFIG, --config CONFIG login file (contains user/pass info) | ||
Required arguments: | ||
-i INPUT_JSON, --input_json INPUT_JSON json file defining inputs for this script. | ||
json format | ||
------------------- | ||
The json file has multiple fields specifying where and how | ||
the data are downloaded from xnat. | ||
|
||
* **destination**: string | ||
(required) The absolute path to the | ||
output base directory of the BIDS dataset | ||
* **project**: string | ||
(required) The name of the project on xnat | ||
* **server**: string | ||
(required) The base URL to the xnat server (e.g. "https://central.xnat.org") | ||
* **subjects**: list | ||
(optional) The subjects you wish to download from xnat. | ||
Use the subject names as they are seen on xnat. | ||
* **sub_dict**: dictionary | ||
(optional) (non-BIDS) If you want to change the subject label | ||
that is not represented in the xnat subject name | ||
* **session_labels**: list | ||
(optional) (non-BIDS) If you want to replace the names of the sessions | ||
on xnat with your own list of scans. | ||
|
||
.. warning:: this will not behave as expected if the subject on xnat | ||
has a missing "middle" session or an extra session. | ||
* **scan_dict**: dictionary | ||
(conditionally required) (non-BIDS) required if your dicoms are not stored | ||
in a BIDS format on xnat. The keys to the dictionary are | ||
scan names as they are seen on xnat (e.g. "SAG FSPGR BRAVO"), | ||
and the values are the associated :ref:`reproin` (BIDS-ish) | ||
name for the scan (e.g. "anat-T1w"). | ||
|
||
Once installed and the json file is configured, the final step is to call the command, like so: | ||
example json | ||
************ | ||
.. literalinclude:: ../tests/non_bids_test.json | ||
|
||
Once installed and the json file is configured, | ||
the final step is to call the command. | ||
|
||
**locally installed:** (python2 only) | ||
|
||
.. code-block:: console | ||
xnat_downloader -i /path/to/json/file.json | ||
**via docker:** | ||
|
||
.. code-block:: console | ||
docker run \ | ||
-v /path/to/out:/out \ | ||
-v /path/to/json/:/json \ | ||
jdkent:xnat_downloader \ | ||
-i /json/file.json | ||
**Note**: when calling via docker, | ||
the destination location should be specified | ||
relative to where the path is in the docker | ||
container, not on your machine. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.