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 Jun 6, 2024
1 parent c4b2938 commit ed8a5db
Show file tree
Hide file tree
Showing 21 changed files with 123 additions and 104 deletions.
9 changes: 8 additions & 1 deletion master/_modules/sdcflows/fieldmaps.html
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@ <h1>Source code for sdcflows.fieldmaps</h1><div class="highlight"><pre>
<span class="n">bids_id</span> <span class="o">=</span> <span class="n">attr</span><span class="o">.</span><span class="n">ib</span><span class="p">(</span><span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">kw_only</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">str</span><span class="p">,</span> <span class="n">on_setattr</span><span class="o">=</span><span class="n">_id_setter</span><span class="p">)</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;The unique ``B0FieldIdentifier`` field of this fieldmap.&quot;&quot;&quot;</span>

<span class="n">sanitized_id</span> <span class="o">=</span> <span class="n">attr</span><span class="o">.</span><span class="n">ib</span><span class="p">(</span><span class="n">init</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="nb">repr</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Sanitized version of the bids_id with special characters replaced by underscores.&quot;&quot;&quot;</span>

<span class="n">_wf</span> <span class="o">=</span> <span class="n">attr</span><span class="o">.</span><span class="n">ib</span><span class="p">(</span><span class="n">init</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">repr</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Internal pointer to a workflow.&quot;&quot;&quot;</span>

Expand Down Expand Up @@ -770,6 +773,10 @@ <h1>Source code for sdcflows.fieldmaps</h1><div class="highlight"><pre>
<span class="k">for</span> <span class="n">intent_file</span> <span class="ow">in</span> <span class="n">intents_meta</span><span class="p">:</span>
<span class="n">_intents</span><span class="p">[</span><span class="n">intent_file</span><span class="p">]</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">bids_id</span><span class="p">)</span>

<span class="c1"># Provide a sanitized identifier that can be used in cases where</span>
<span class="c1"># special characters are not allowed.</span>
<span class="bp">self</span><span class="o">.</span><span class="n">sanitized_id</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;[^a-zA-Z0-9]&#39;</span><span class="p">,</span> <span class="s1">&#39;_&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">bids_id</span><span class="p">)</span>

<div class="viewcode-block" id="FieldmapEstimation.paths">
<a class="viewcode-back" href="../../api/sdcflows.fieldmaps.html#sdcflows.fieldmaps.FieldmapEstimation.paths">[docs]</a>
<span class="k">def</span> <span class="nf">paths</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
Expand All @@ -785,7 +792,7 @@ <h1>Source code for sdcflows.fieldmaps</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_wf</span>

<span class="c1"># Override workflow name</span>
<span class="n">kwargs</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;wf_</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">bids_id</span><span class="si">}</span><span class="s2">&quot;</span>
<span class="n">kwargs</span><span class="p">[</span><span class="s2">&quot;name&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;wf_</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">sanitized_id</span><span class="si">}</span><span class="s2">&quot;</span>

<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">method</span> <span class="ow">in</span> <span class="p">(</span><span class="n">EstimatorType</span><span class="o">.</span><span class="n">MAPPED</span><span class="p">,</span> <span class="n">EstimatorType</span><span class="o">.</span><span class="n">PHASEDIFF</span><span class="p">):</span>
<span class="kn">from</span> <span class="nn">.workflows.fit.fieldmap</span> <span class="kn">import</span> <span class="n">init_fmap_wf</span>
Expand Down
6 changes: 3 additions & 3 deletions master/_modules/sdcflows/workflows/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ <h1>Source code for sdcflows.workflows.base</h1><div class="highlight"><pre>
<span class="n">output_dir</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">output_dir</span><span class="p">),</span>
<span class="n">write_coeff</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">bids_fmap_id</span><span class="o">=</span><span class="n">estimator</span><span class="o">.</span><span class="n">bids_id</span><span class="p">,</span>
<span class="n">name</span><span class="o">=</span><span class="sa">f</span><span class="s2">&quot;fmap_derivatives_wf_</span><span class="si">{</span><span class="n">estimator</span><span class="o">.</span><span class="n">bids_id</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">,</span>
<span class="n">name</span><span class="o">=</span><span class="sa">f</span><span class="s2">&quot;fmap_derivatives_wf_</span><span class="si">{</span><span class="n">estimator</span><span class="o">.</span><span class="n">sanitized_id</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">fmap_derivatives_wf</span><span class="o">.</span><span class="n">inputs</span><span class="o">.</span><span class="n">inputnode</span><span class="o">.</span><span class="n">source_files</span> <span class="o">=</span> <span class="n">source_files</span>
<span class="n">fmap_derivatives_wf</span><span class="o">.</span><span class="n">inputs</span><span class="o">.</span><span class="n">inputnode</span><span class="o">.</span><span class="n">fmap_meta</span> <span class="o">=</span> <span class="p">[</span>
Expand All @@ -457,15 +457,15 @@ <h1>Source code for sdcflows.workflows.base</h1><div class="highlight"><pre>
<span class="n">output_dir</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">output_dir</span><span class="p">),</span>
<span class="n">fmap_type</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">estimator</span><span class="o">.</span><span class="n">method</span><span class="p">)</span><span class="o">.</span><span class="n">rpartition</span><span class="p">(</span><span class="s2">&quot;.&quot;</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span><span class="p">(),</span>
<span class="n">bids_fmap_id</span><span class="o">=</span><span class="n">estimator</span><span class="o">.</span><span class="n">bids_id</span><span class="p">,</span>
<span class="n">name</span><span class="o">=</span><span class="sa">f</span><span class="s2">&quot;fmap_reports_wf_</span><span class="si">{</span><span class="n">estimator</span><span class="o">.</span><span class="n">bids_id</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">,</span>
<span class="n">name</span><span class="o">=</span><span class="sa">f</span><span class="s2">&quot;fmap_reports_wf_</span><span class="si">{</span><span class="n">estimator</span><span class="o">.</span><span class="n">sanitized_id</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">fmap_reports_wf</span><span class="o">.</span><span class="n">inputs</span><span class="o">.</span><span class="n">inputnode</span><span class="o">.</span><span class="n">source_files</span> <span class="o">=</span> <span class="n">source_files</span>

<span class="k">if</span> <span class="n">estimator</span><span class="o">.</span><span class="n">method</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="n">EstimatorType</span><span class="o">.</span><span class="n">MAPPED</span><span class="p">,</span> <span class="n">EstimatorType</span><span class="o">.</span><span class="n">PHASEDIFF</span><span class="p">):</span>
<span class="n">fields</span> <span class="o">=</span> <span class="n">INPUT_FIELDS</span><span class="p">[</span><span class="n">estimator</span><span class="o">.</span><span class="n">method</span><span class="p">]</span>
<span class="n">inputnode</span> <span class="o">=</span> <span class="n">pe</span><span class="o">.</span><span class="n">Node</span><span class="p">(</span>
<span class="n">niu</span><span class="o">.</span><span class="n">IdentityInterface</span><span class="p">(</span><span class="n">fields</span><span class="o">=</span><span class="n">fields</span><span class="p">),</span>
<span class="n">name</span><span class="o">=</span><span class="sa">f</span><span class="s2">&quot;in_</span><span class="si">{</span><span class="n">estimator</span><span class="o">.</span><span class="n">bids_id</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">,</span>
<span class="n">name</span><span class="o">=</span><span class="sa">f</span><span class="s2">&quot;in_</span><span class="si">{</span><span class="n">estimator</span><span class="o">.</span><span class="n">sanitized_id</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">,</span>
<span class="p">)</span>
<span class="c1"># fmt:off</span>
<span class="n">workflow</span><span class="o">.</span><span class="n">connect</span><span class="p">([</span>
Expand Down
4 changes: 2 additions & 2 deletions master/_modules/sdcflows/workflows/fit/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ <h1>Source code for sdcflows.workflows.fit.base</h1><div class="highlight"><pre>
<span class="n">output_dir</span><span class="o">=</span><span class="n">config</span><span class="o">.</span><span class="n">execution</span><span class="o">.</span><span class="n">output_dir</span><span class="p">,</span>
<span class="n">bids_fmap_id</span><span class="o">=</span><span class="n">estim</span><span class="o">.</span><span class="n">bids_id</span><span class="p">,</span>
<span class="n">write_coeff</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">name</span><span class="o">=</span><span class="sa">f</span><span class="s2">&quot;fmap_derivatives_</span><span class="si">{</span><span class="n">estim</span><span class="o">.</span><span class="n">bids_id</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">,</span>
<span class="n">name</span><span class="o">=</span><span class="sa">f</span><span class="s2">&quot;fmap_derivatives_</span><span class="si">{</span><span class="n">estim</span><span class="o">.</span><span class="n">sanitized_id</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">,</span>
<span class="p">)</span>

<span class="n">source_paths</span> <span class="o">=</span> <span class="p">[</span>
Expand All @@ -398,7 +398,7 @@ <h1>Source code for sdcflows.workflows.fit.base</h1><div class="highlight"><pre>
<span class="n">fmap_type</span><span class="o">=</span><span class="n">estim</span><span class="o">.</span><span class="n">method</span><span class="p">,</span>
<span class="n">output_dir</span><span class="o">=</span><span class="n">config</span><span class="o">.</span><span class="n">execution</span><span class="o">.</span><span class="n">output_dir</span><span class="p">,</span>
<span class="n">bids_fmap_id</span><span class="o">=</span><span class="n">estim</span><span class="o">.</span><span class="n">bids_id</span><span class="p">,</span>
<span class="n">name</span><span class="o">=</span><span class="sa">f</span><span class="s2">&quot;fmap_reports_</span><span class="si">{</span><span class="n">estim</span><span class="o">.</span><span class="n">bids_id</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">,</span>
<span class="n">name</span><span class="o">=</span><span class="sa">f</span><span class="s2">&quot;fmap_reports_</span><span class="si">{</span><span class="n">estim</span><span class="o">.</span><span class="n">sanitized_id</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">reportlets_wf</span><span class="o">.</span><span class="n">inputs</span><span class="o">.</span><span class="n">inputnode</span><span class="o">.</span><span class="n">source_files</span> <span class="o">=</span> <span class="n">source_paths</span>

Expand Down
6 changes: 4 additions & 2 deletions master/_modules/sdcflows/workflows/outputs.html
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ <h1>Source code for sdcflows.workflows.outputs</h1><div class="highlight"><pre>
<span class="c1"># https://www.nipreps.org/community/licensing/</span>
<span class="c1">#</span>
<span class="sd">&quot;&quot;&quot;Writing out outputs.&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">re</span>

<span class="kn">from</span> <span class="nn">nipype.pipeline</span> <span class="kn">import</span> <span class="n">engine</span> <span class="k">as</span> <span class="n">pe</span>
<span class="kn">from</span> <span class="nn">nipype.interfaces</span> <span class="kn">import</span> <span class="n">utility</span> <span class="k">as</span> <span class="n">niu</span>
<span class="kn">from</span> <span class="nn">niworkflows.interfaces.bids</span> <span class="kn">import</span> <span class="n">DerivativesDataSink</span> <span class="k">as</span> <span class="n">_DDS</span>
Expand Down Expand Up @@ -402,7 +404,7 @@ <h1>Source code for sdcflows.workflows.outputs</h1><div class="highlight"><pre>

<span class="n">custom_entities</span> <span class="o">=</span> <span class="n">custom_entities</span> <span class="ow">or</span> <span class="p">{}</span>
<span class="k">if</span> <span class="n">bids_fmap_id</span><span class="p">:</span>
<span class="n">custom_entities</span><span class="p">[</span><span class="s2">&quot;fmapid&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">bids_fmap_id</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s2">&quot;_&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">)</span>
<span class="n">custom_entities</span><span class="p">[</span><span class="s2">&quot;fmapid&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;[^a-zA-Z0-9]&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="n">bids_fmap_id</span><span class="p">)</span>

<span class="n">workflow</span> <span class="o">=</span> <span class="n">pe</span><span class="o">.</span><span class="n">Workflow</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">)</span>
<span class="n">inputnode</span> <span class="o">=</span> <span class="n">pe</span><span class="o">.</span><span class="n">Node</span><span class="p">(</span>
Expand Down Expand Up @@ -484,7 +486,7 @@ <h1>Source code for sdcflows.workflows.outputs</h1><div class="highlight"><pre>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">custom_entities</span> <span class="o">=</span> <span class="n">custom_entities</span> <span class="ow">or</span> <span class="p">{}</span>
<span class="k">if</span> <span class="n">bids_fmap_id</span><span class="p">:</span>
<span class="n">custom_entities</span><span class="p">[</span><span class="s2">&quot;fmapid&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">bids_fmap_id</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s2">&quot;_&quot;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">)</span>
<span class="n">custom_entities</span><span class="p">[</span><span class="s2">&quot;fmapid&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;[^a-zA-Z0-9]&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="n">bids_fmap_id</span><span class="p">)</span>

<span class="n">workflow</span> <span class="o">=</span> <span class="n">pe</span><span class="o">.</span><span class="n">Workflow</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">)</span>
<span class="n">inputnode</span> <span class="o">=</span> <span class="n">pe</span><span class="o">.</span><span class="n">Node</span><span class="p">(</span>
Expand Down
1 change: 1 addition & 0 deletions master/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ <h1>Library API (application program interface)<a class="headerlink" href="#libr
<li class="toctree-l3"><a class="reference internal" href="api/sdcflows.fieldmaps.html#sdcflows.fieldmaps.FieldmapEstimation.get_workflow"><code class="docutils literal notranslate"><span class="pre">FieldmapEstimation.get_workflow()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="api/sdcflows.fieldmaps.html#sdcflows.fieldmaps.FieldmapEstimation.method"><code class="docutils literal notranslate"><span class="pre">FieldmapEstimation.method</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="api/sdcflows.fieldmaps.html#sdcflows.fieldmaps.FieldmapEstimation.paths"><code class="docutils literal notranslate"><span class="pre">FieldmapEstimation.paths()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="api/sdcflows.fieldmaps.html#sdcflows.fieldmaps.FieldmapEstimation.sanitized_id"><code class="docutils literal notranslate"><span class="pre">FieldmapEstimation.sanitized_id</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="api/sdcflows.fieldmaps.html#sdcflows.fieldmaps.FieldmapEstimation.sources"><code class="docutils literal notranslate"><span class="pre">FieldmapEstimation.sources</span></code></a></li>
</ul>
</li>
Expand Down
Binary file modified master/api/sdcflows-workflows-apply-correction-1.pdf
Binary file not shown.
Binary file modified master/api/sdcflows-workflows-apply-registration-1.pdf
Binary file not shown.
Binary file modified master/api/sdcflows-workflows-fit-fieldmap-1.pdf
Binary file not shown.
Binary file modified master/api/sdcflows-workflows-fit-fieldmap-2.pdf
Binary file not shown.
Binary file modified master/api/sdcflows-workflows-fit-fieldmap-3.pdf
Binary file not shown.
Binary file modified master/api/sdcflows-workflows-fit-pepolar-1.pdf
Binary file not shown.
Binary file modified master/api/sdcflows-workflows-fit-pepolar-2.pdf
Binary file not shown.
Binary file modified master/api/sdcflows-workflows-fit-syn-1.pdf
Binary file not shown.
Binary file modified master/api/sdcflows-workflows-fit-syn-2.pdf
Binary file not shown.
Loading

0 comments on commit ed8a5db

Please sign in to comment.