Skip to content

Commit

Permalink
docs(master): Update docs of development line
Browse files Browse the repository at this point in the history
  • Loading branch information
nipreps-bot committed Nov 15, 2023
1 parent bca9dcd commit b740453
Show file tree
Hide file tree
Showing 18 changed files with 39 additions and 27 deletions.
1 change: 1 addition & 0 deletions master/_modules/niworkflows/interfaces/bids.html
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ <h1>Source code for niworkflows.interfaces.bids</h1><div class="highlight"><pre>
<span class="n">t2w</span> <span class="o">=</span> <span class="n">OutputMultiObject</span><span class="p">(</span><span class="n">desc</span><span class="o">=</span><span class="s2">&quot;output T2w images&quot;</span><span class="p">)</span>
<span class="n">flair</span> <span class="o">=</span> <span class="n">OutputMultiObject</span><span class="p">(</span><span class="n">desc</span><span class="o">=</span><span class="s2">&quot;output FLAIR images&quot;</span><span class="p">)</span>
<span class="n">pet</span> <span class="o">=</span> <span class="n">OutputMultiObject</span><span class="p">(</span><span class="n">desc</span><span class="o">=</span><span class="s2">&quot;output PET images&quot;</span><span class="p">)</span>
<span class="n">dwi</span> <span class="o">=</span> <span class="n">OutputMultiObject</span><span class="p">(</span><span class="n">desc</span><span class="o">=</span><span class="s2">&quot;output DWI images&quot;</span><span class="p">)</span>


<div class="viewcode-block" id="BIDSDataGrabber">
Expand Down
36 changes: 23 additions & 13 deletions master/_modules/niworkflows/utils/bids.html
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,19 @@ <h1>Source code for niworkflows.utils.bids</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">packaging.version</span> <span class="kn">import</span> <span class="n">Version</span>


<span class="n">DEFAULT_BIDS_QUERIES</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;bold&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;datatype&quot;</span><span class="p">:</span> <span class="s2">&quot;func&quot;</span><span class="p">,</span> <span class="s2">&quot;suffix&quot;</span><span class="p">:</span> <span class="s2">&quot;bold&quot;</span><span class="p">,</span> <span class="s2">&quot;part&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;mag&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">]},</span>
<span class="s2">&quot;dwi&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;suffix&quot;</span><span class="p">:</span> <span class="s2">&quot;dwi&quot;</span><span class="p">},</span>
<span class="s2">&quot;flair&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;datatype&quot;</span><span class="p">:</span> <span class="s2">&quot;anat&quot;</span><span class="p">,</span> <span class="s2">&quot;suffix&quot;</span><span class="p">:</span> <span class="s2">&quot;FLAIR&quot;</span><span class="p">,</span> <span class="s2">&quot;part&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;mag&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">]},</span>
<span class="s2">&quot;fmap&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;datatype&quot;</span><span class="p">:</span> <span class="s2">&quot;fmap&quot;</span><span class="p">},</span>
<span class="s2">&quot;pet&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;suffix&quot;</span><span class="p">:</span> <span class="s2">&quot;pet&quot;</span><span class="p">},</span>
<span class="s2">&quot;roi&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;datatype&quot;</span><span class="p">:</span> <span class="s2">&quot;anat&quot;</span><span class="p">,</span> <span class="s2">&quot;suffix&quot;</span><span class="p">:</span> <span class="s2">&quot;roi&quot;</span><span class="p">},</span>
<span class="s2">&quot;sbref&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;datatype&quot;</span><span class="p">:</span> <span class="s2">&quot;func&quot;</span><span class="p">,</span> <span class="s2">&quot;suffix&quot;</span><span class="p">:</span> <span class="s2">&quot;sbref&quot;</span><span class="p">,</span> <span class="s2">&quot;part&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;mag&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">]},</span>
<span class="s2">&quot;t1w&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;datatype&quot;</span><span class="p">:</span> <span class="s2">&quot;anat&quot;</span><span class="p">,</span> <span class="s2">&quot;suffix&quot;</span><span class="p">:</span> <span class="s2">&quot;T1w&quot;</span><span class="p">,</span> <span class="s2">&quot;part&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;mag&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">]},</span>
<span class="s2">&quot;t2w&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;datatype&quot;</span><span class="p">:</span> <span class="s2">&quot;anat&quot;</span><span class="p">,</span> <span class="s2">&quot;suffix&quot;</span><span class="p">:</span> <span class="s2">&quot;T2w&quot;</span><span class="p">,</span> <span class="s2">&quot;part&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;mag&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">]},</span>
<span class="p">}</span>


<div class="viewcode-block" id="BIDSError">
<a class="viewcode-back" href="../../../api/niworkflows.utils.bids.html#niworkflows.utils.bids.BIDSError">[docs]</a>
<span class="k">class</span> <span class="nc">BIDSError</span><span class="p">(</span><span class="ne">ValueError</span><span class="p">):</span>
Expand Down Expand Up @@ -447,11 +460,13 @@ <h1>Source code for niworkflows.utils.bids</h1><div class="highlight"><pre>
<span class="k">def</span> <span class="nf">collect_data</span><span class="p">(</span>
<span class="n">bids_dir</span><span class="p">,</span>
<span class="n">participant_label</span><span class="p">,</span>
<span class="n">session_id</span><span class="o">=</span><span class="n">Query</span><span class="o">.</span><span class="n">OPTIONAL</span><span class="p">,</span>
<span class="n">session_id</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">task</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">echo</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">group_echos</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">bids_validate</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">bids_filters</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">queries</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Uses pybids to retrieve the input data for a given participant</span>
Expand Down Expand Up @@ -519,19 +534,10 @@ <h1>Source code for niworkflows.utils.bids</h1><div class="highlight"><pre>
<span class="s1">&#39;return_type&#39;</span><span class="p">:</span> <span class="s1">&#39;file&#39;</span><span class="p">,</span>
<span class="s1">&#39;subject&#39;</span><span class="p">:</span> <span class="n">participant_label</span><span class="p">,</span>
<span class="s1">&#39;extension&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s1">&#39;.nii&#39;</span><span class="p">,</span> <span class="s1">&#39;.nii.gz&#39;</span><span class="p">],</span>
<span class="s1">&#39;session&#39;</span><span class="p">:</span> <span class="n">session_id</span><span class="p">,</span>
<span class="s1">&#39;session&#39;</span><span class="p">:</span> <span class="n">session_id</span> <span class="ow">or</span> <span class="n">Query</span><span class="o">.</span><span class="n">OPTIONAL</span><span class="p">,</span>
<span class="p">}</span>

<span class="n">queries</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;fmap&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;datatype&quot;</span><span class="p">:</span> <span class="s2">&quot;fmap&quot;</span><span class="p">},</span>
<span class="s2">&quot;bold&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;datatype&quot;</span><span class="p">:</span> <span class="s2">&quot;func&quot;</span><span class="p">,</span> <span class="s2">&quot;suffix&quot;</span><span class="p">:</span> <span class="s2">&quot;bold&quot;</span><span class="p">,</span> <span class="s2">&quot;part&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;mag&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">]},</span>
<span class="s2">&quot;sbref&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;datatype&quot;</span><span class="p">:</span> <span class="s2">&quot;func&quot;</span><span class="p">,</span> <span class="s2">&quot;suffix&quot;</span><span class="p">:</span> <span class="s2">&quot;sbref&quot;</span><span class="p">,</span> <span class="s2">&quot;part&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;mag&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">]},</span>
<span class="s2">&quot;flair&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;datatype&quot;</span><span class="p">:</span> <span class="s2">&quot;anat&quot;</span><span class="p">,</span> <span class="s2">&quot;suffix&quot;</span><span class="p">:</span> <span class="s2">&quot;FLAIR&quot;</span><span class="p">,</span> <span class="s2">&quot;part&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;mag&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">]},</span>
<span class="s2">&quot;t2w&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;datatype&quot;</span><span class="p">:</span> <span class="s2">&quot;anat&quot;</span><span class="p">,</span> <span class="s2">&quot;suffix&quot;</span><span class="p">:</span> <span class="s2">&quot;T2w&quot;</span><span class="p">,</span> <span class="s2">&quot;part&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;mag&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">]},</span>
<span class="s2">&quot;t1w&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;datatype&quot;</span><span class="p">:</span> <span class="s2">&quot;anat&quot;</span><span class="p">,</span> <span class="s2">&quot;suffix&quot;</span><span class="p">:</span> <span class="s2">&quot;T1w&quot;</span><span class="p">,</span> <span class="s2">&quot;part&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;mag&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">]},</span>
<span class="s2">&quot;roi&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;datatype&quot;</span><span class="p">:</span> <span class="s2">&quot;anat&quot;</span><span class="p">,</span> <span class="s2">&quot;suffix&quot;</span><span class="p">:</span> <span class="s2">&quot;roi&quot;</span><span class="p">},</span>
<span class="s2">&quot;pet&quot;</span><span class="p">:</span> <span class="p">{</span><span class="s2">&quot;suffix&quot;</span><span class="p">:</span> <span class="s2">&quot;pet&quot;</span><span class="p">}</span>
<span class="p">}</span>
<span class="n">queries</span> <span class="o">=</span> <span class="n">queries</span> <span class="ow">or</span> <span class="n">DEFAULT_BIDS_QUERIES</span>
<span class="n">bids_filters</span> <span class="o">=</span> <span class="n">bids_filters</span> <span class="ow">or</span> <span class="p">{}</span>
<span class="k">for</span> <span class="n">acq</span><span class="p">,</span> <span class="n">entities</span> <span class="ow">in</span> <span class="n">bids_filters</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="n">queries</span><span class="p">[</span><span class="n">acq</span><span class="p">]</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">entities</span><span class="p">)</span>
Expand All @@ -552,7 +558,11 @@ <h1>Source code for niworkflows.utils.bids</h1><div class="highlight"><pre>
<span class="p">}</span>

<span class="c1"># Special case: multi-echo BOLD, grouping echos</span>
<span class="k">if</span> <span class="nb">any</span><span class="p">([</span><span class="s2">&quot;_echo-&quot;</span> <span class="ow">in</span> <span class="n">bold</span> <span class="k">for</span> <span class="n">bold</span> <span class="ow">in</span> <span class="n">subj_data</span><span class="p">[</span><span class="s2">&quot;bold&quot;</span><span class="p">]]):</span>
<span class="k">if</span> <span class="p">(</span>
<span class="n">group_echos</span>
<span class="ow">and</span> <span class="s2">&quot;bold&quot;</span> <span class="ow">in</span> <span class="n">subj_data</span>
<span class="ow">and</span> <span class="nb">any</span><span class="p">([</span><span class="s2">&quot;_echo-&quot;</span> <span class="ow">in</span> <span class="n">bold</span> <span class="k">for</span> <span class="n">bold</span> <span class="ow">in</span> <span class="n">subj_data</span><span class="p">[</span><span class="s2">&quot;bold&quot;</span><span class="p">]])</span>
<span class="p">):</span>
<span class="n">subj_data</span><span class="p">[</span><span class="s2">&quot;bold&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">group_multiecho</span><span class="p">(</span><span class="n">subj_data</span><span class="p">[</span><span class="s2">&quot;bold&quot;</span><span class="p">])</span>

<span class="k">return</span> <span class="n">subj_data</span><span class="p">,</span> <span class="n">layout</span></div>
Expand Down
Binary file modified master/api/niworkflows-anat-ants-1.pdf
Binary file not shown.
Binary file modified master/api/niworkflows-anat-ants-2.pdf
Binary file not shown.
Binary file modified master/api/niworkflows-anat-ants-3.pdf
Binary file not shown.
Binary file modified master/api/niworkflows-anat-coregistration-1.pdf
Binary file not shown.
Binary file modified master/api/niworkflows-anat-freesurfer-1.pdf
Binary file not shown.
Binary file modified master/api/niworkflows-anat-skullstrip-1.pdf
Binary file not shown.
Binary file modified master/api/niworkflows-func-util-1.pdf
Binary file not shown.
Binary file modified master/api/niworkflows-func-util-2.pdf
Binary file not shown.
Binary file modified master/api/niworkflows-func-util-3.pdf
Binary file not shown.
Binary file modified master/api/niworkflows-workflows-epi-refmap-1.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions master/api/niworkflows.interfaces.bids.html
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@
<dt class="field-even">Outputs<span class="colon">:</span></dt>
<dd class="field-even"><ul class="simple">
<li><p><strong>bold</strong> (<em>a list of items which are any value</em>) – Output functional images.</p></li>
<li><p><strong>dwi</strong> (<em>a list of items which are any value</em>) – Output DWI images.</p></li>
<li><p><strong>flair</strong> (<em>a list of items which are any value</em>) – Output FLAIR images.</p></li>
<li><p><strong>fmap</strong> (<em>a list of items which are any value</em>) – Output fieldmaps.</p></li>
<li><p><strong>out_dict</strong> (<em>a dictionary with keys which are any value and with values which are any value</em>) – Output data structure.</p></li>
Expand Down
Loading

0 comments on commit b740453

Please sign in to comment.