Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkent committed May 30, 2018
1 parent ce7e7b2 commit 272090b
Show file tree
Hide file tree
Showing 24 changed files with 535 additions and 111 deletions.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/installation.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/reproin.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/usage.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
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
16 changes: 3 additions & 13 deletions docs/_build/html/TODOs.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TODOs &#8212; xnat_downloader 0.1.dev documentation</title>
<title>TODOs &#8212; xnat_downloader 0.2.0 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" src="_static/documentation_options.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="Usage" href="usage.html" />

<link rel="stylesheet" href="_static/custom.css" type="text/css" />

Expand Down Expand Up @@ -50,20 +49,11 @@ <h1 class="logo"><a href="index.html">xnat_downloader</a></h1>


<h3>Navigation</h3>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="JSON.html">JSON file formatting</a></li>
<li class="toctree-l1"><a class="reference internal" href="changes.html">Changes</a></li>
<li class="toctree-l1"><a class="reference internal" href="usage.html">Usage</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">TODOs</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="usage.html" title="previous chapter">Usage</a></li>
</ul></li>
</ul>
</div>
Expand All @@ -87,7 +77,7 @@ <h3>Quick search</h3>
&copy;2017, James Kent.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.7.2</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.7.5</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>

|
Expand Down
11 changes: 6 additions & 5 deletions docs/_build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
Welcome to xnat_downloader's documentation!
===========================================
xnat_downloader takes dicoms from an xnat server and
saves them in `BIDS <http://bids.neuroimaging.io/>`_ format

.. toctree::
:maxdepth: 2
:caption: Contents:
:maxdepth: 2
:caption: Contents:

installation
JSON
changes
usage
changes
TODOs


Expand Down
14 changes: 11 additions & 3 deletions docs/_build/html/_sources/installation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@
Installation
============

1. clone `repository <https://github.com/HBClab/xnat_downloader>`_ from github
local install
-------------
1. clone the `repository <https://github.com/HBClab/xnat_downloader>`_ from github

``git clone https://github.com/HBClab/xnat_downloader``

2) within the terminal, cd into the place where you downloaded the repository. If you see a setup.py, in the directory (use ``ls``), then you are in the right place.
2) within the terminal, cd into the place where you downloaded the repository.
If you see a setup.py, in the directory (use ``ls``),
then you are in the right place.

``cd /path/to/repository``
``cd /path/to/repository/xnat_downloader``

3) Install the repository using python.

``python setup.py install``

docker install
--------------
``docker pull jdkent/xnat_downloader``
92 changes: 92 additions & 0 deletions docs/_build/html/_sources/reproin.rst.txt
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
68 changes: 67 additions & 1 deletion docs/_build/html/_sources/usage.rst.txt
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.
4 changes: 3 additions & 1 deletion docs/_build/html/_static/doctools.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ jQuery.fn.highlightText = function(text, className) {
if (node.nodeType === 3) {
var val = node.nodeValue;
var pos = val.toLowerCase().indexOf(text);
if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
if (pos >= 0 &&
!jQuery(node.parentNode).hasClass(className) &&
!jQuery(node.parentNode).hasClass("nohighlight")) {
var span;
var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
if (isInSVG) {
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.1.dev',
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '0.2.0',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
Expand Down
18 changes: 3 additions & 15 deletions docs/_build/html/changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Changes &#8212; xnat_downloader 0.1.dev documentation</title>
<title>Changes &#8212; xnat_downloader 0.2.0 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" src="_static/documentation_options.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Usage" href="usage.html" />
<link rel="prev" title="JSON file formatting" href="JSON.html" />

<link rel="stylesheet" href="_static/custom.css" type="text/css" />

Expand Down Expand Up @@ -51,21 +49,11 @@ <h1 class="logo"><a href="index.html">xnat_downloader</a></h1>


<h3>Navigation</h3>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="JSON.html">JSON file formatting</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Changes</a></li>
<li class="toctree-l1"><a class="reference internal" href="usage.html">Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="TODOs.html">TODOs</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="JSON.html" title="previous chapter">JSON file formatting</a></li>
<li>Next: <a href="usage.html" title="next chapter">Usage</a></li>
</ul></li>
</ul>
</div>
Expand All @@ -89,7 +77,7 @@ <h3>Quick search</h3>
&copy;2017, James Kent.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.7.2</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.7.5</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>

|
Expand Down
10 changes: 4 additions & 6 deletions docs/_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Index &#8212; xnat_downloader 0.1.dev documentation</title>
<title>Index &#8212; xnat_downloader 0.2.0 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" src="_static/documentation_options.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
Expand Down Expand Up @@ -53,12 +53,10 @@ <h1 class="logo"><a href="index.html">xnat_downloader</a></h1>


<h3>Navigation</h3>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="JSON.html">JSON file formatting</a></li>
<li class="toctree-l1"><a class="reference internal" href="changes.html">Changes</a></li>
<li class="toctree-l1"><a class="reference internal" href="usage.html">Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="changes.html">Changes</a></li>
<li class="toctree-l1"><a class="reference internal" href="TODOs.html">TODOs</a></li>
</ul>

Expand Down Expand Up @@ -89,7 +87,7 @@ <h3>Quick search</h3>
&copy;2017, James Kent.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.7.2</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.7.5</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>

</div>
Expand Down
Loading

0 comments on commit 272090b

Please sign in to comment.