Skip to content

Commit

Permalink
Add docs directory
Browse files Browse the repository at this point in the history
  • Loading branch information
LalithShiyam committed Aug 28, 2023
1 parent 83aa0fc commit 628340c
Show file tree
Hide file tree
Showing 108 changed files with 24,689 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Binary file added docs/_build/doctrees/contribute.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file added docs/_build/doctrees/falconz.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/index.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/installation.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/introduction.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/modules.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/qimp_philosophy.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/requirements.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/usage_guide.doctree
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +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: 9fb5c8c32e219a606f78ba2001d5d9ad
tags: 645f666f9bcd5a90fca523b33c5a78b7
236 changes: 236 additions & 0 deletions docs/_build/html/_modules/falconz/display.html

Large diffs are not rendered by default.

227 changes: 227 additions & 0 deletions docs/_build/html/_modules/falconz/download.html

Large diffs are not rendered by default.

339 changes: 339 additions & 0 deletions docs/_build/html/_modules/falconz/falconz.html

Large diffs are not rendered by default.

331 changes: 331 additions & 0 deletions docs/_build/html/_modules/falconz/file_utilities.html

Large diffs are not rendered by default.

378 changes: 378 additions & 0 deletions docs/_build/html/_modules/falconz/image_conversion.html

Large diffs are not rendered by default.

589 changes: 589 additions & 0 deletions docs/_build/html/_modules/falconz/image_processing.html

Large diffs are not rendered by default.

191 changes: 191 additions & 0 deletions docs/_build/html/_modules/falconz/input_validation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>falconz.input_validation &mdash; FALCONZ 2.0 documentation</title>
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
<link rel="stylesheet" href="../../_static/dark_mode_css/general.css" type="text/css" />
<link rel="stylesheet" href="../../_static/dark_mode_css/dark.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->

<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/dark_mode_js/default_dark.js"></script>
<script src="../../_static/dark_mode_js/theme_switcher.js"></script>
<script src="../../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
</head>

<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" style="background: #343131" >



<a href="../../index.html" class="icon icon-home">
FALCONZ
<img src="../../_static/Falcon-logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../introduction.html">FALCON: The Forefront of PET Imaging Motion Correction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../requirements.html">FALCON System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../installation.html">Installation Guide for FalconZ</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../usage_guide.html">FALCON Usage Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../contribute.html">Strengthen FalconZ: Report Bugs and Improvements</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../qimp_philosophy.html">The ‘Z’ Factor in QIMP Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../modules.html">falconz</a></li>
</ul>

</div>
</div>
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" style="background: #343131" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">FALCONZ</a>
</nav>

<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="../index.html">Module code</a></li>
<li class="breadcrumb-item active">falconz.input_validation</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<h1>Source code for falconz.input_validation</h1><div class="highlight"><pre>
<span></span><span class="ch">#!/usr/bin/env python3</span>
<span class="c1"># -*- coding: utf-8 -*-</span>

<span class="sd">&quot;&quot;&quot;</span>
<span class="sd">.. module:: input_validation</span>
<span class="sd"> :platform: Unix, Windows</span>
<span class="sd"> :synopsis: A module for input validation for the falconz.</span>

<span class="sd">.. moduleauthor:: Lalith Kumar Shiyam Sundar &lt;[email protected]&gt;</span>

<span class="sd">This module handles input validation for the falconz.</span>

<span class="sd">Usage:</span>
<span class="sd"> The functions in this module can be imported and used in other modules within the falconz to perform image conversion.</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">import</span> <span class="nn">os</span>


<div class="viewcode-block" id="InputValidation"><a class="viewcode-back" href="../../falconz.html#falconz.input_validation.InputValidation">[docs]</a><span class="k">class</span> <span class="nc">InputValidation</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> A class for input validation for the falconz.</span>

<span class="sd"> :param args: The arguments to validate.</span>
<span class="sd"> :type args: Any</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">args</span> <span class="o">=</span> <span class="n">args</span>

<div class="viewcode-block" id="InputValidation.validate"><a class="viewcode-back" href="../../falconz.html#falconz.input_validation.InputValidation.validate">[docs]</a> <span class="k">def</span> <span class="nf">validate</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Validates the input arguments.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_check_directory_exists</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_check_reference_frame_index</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_check_start_frame</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_check_registration_type</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_check_multi_resolution_iterations</span><span class="p">()</span>
<span class="n">logging</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">&quot;Input validation successful.&quot;</span><span class="p">)</span></div>

<span class="k">def</span> <span class="nf">_check_directory_exists</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Checks if the specified directory exists.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">main_folder</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;The specified directory does not exist: </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">main_folder</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">_check_reference_frame_index</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Checks if the reference frame index is valid.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">reference_frame_index</span><span class="p">,</span> <span class="nb">int</span><span class="p">)</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">reference_frame_index</span> <span class="o">&lt;</span> <span class="o">-</span><span class="mi">1</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;Reference frame index must be a non-negative integer or -1: </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">reference_frame_index</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">_check_start_frame</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Checks if the start frame is valid.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">start_frame</span><span class="p">,</span> <span class="nb">int</span><span class="p">)</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">start_frame</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Start frame must be a non-negative integer: </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">start_frame</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">_check_registration_type</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Checks if the registration type is valid.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">allowed_registration_paradigms</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;rigid&quot;</span><span class="p">,</span> <span class="s2">&quot;affine&quot;</span><span class="p">,</span> <span class="s2">&quot;deformable&quot;</span><span class="p">]</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">registration</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">allowed_registration_paradigms</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Invalid registration type. Allowed values are: </span><span class="si">{</span><span class="n">allowed_registration_paradigms</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">_check_multi_resolution_iterations</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Checks if the multi-resolution iterations are valid.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">multi_resolution_iterations</span><span class="p">,</span> <span class="nb">str</span><span class="p">)</span> <span class="ow">or</span> <span class="ow">not</span> <span class="nb">all</span><span class="p">(</span>
<span class="n">i</span><span class="o">.</span><span class="n">isdigit</span><span class="p">()</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">multi_resolution_iterations</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)):</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;Multi resolution iterations must be a &#39;x&#39; separated numeric string: </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">multi_resolution_iterations</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span></div>
</pre></div>

</div>
</div>
<footer>

<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2023, Quantitative Imaging and Medical Physics Team, Medical University of Vienna.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.


</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>

</body>
</html>
Loading

0 comments on commit 628340c

Please sign in to comment.