-
Notifications
You must be signed in to change notification settings - Fork 0
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
20 changed files
with
306 additions
and
5 deletions.
There are no files selected for viewing
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
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
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,177 @@ | ||
<!DOCTYPE html> | ||
<html class="writer-html5" lang="en"> | ||
<head> | ||
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Quickstart — cvpl_tools 0.8.2 documentation</title> | ||
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" /> | ||
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=19f00094" /> | ||
|
||
|
||
<!--[if lt IE 9]> | ||
<script src="../_static/js/html5shiv.min.js"></script> | ||
<![endif]--> | ||
|
||
<script src="../_static/jquery.js?v=5d32c60e"></script> | ||
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script> | ||
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js?v=f9948e0f"></script> | ||
<script src="../_static/doctools.js?v=888ff710"></script> | ||
<script src="../_static/sphinx_highlight.js?v=4825356b"></script> | ||
<script src="../_static/js/theme.js"></script> | ||
<link rel="index" title="Index" href="../genindex.html" /> | ||
<link rel="search" title="Search" href="../search.html" /> | ||
<link rel="next" title="OME_ZARR" href="ome_zarr.html" /> | ||
<link rel="prev" title="Introduction - cvpl_tools documentation" href="../index.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" > | ||
|
||
|
||
|
||
<a href="../index.html" class="icon icon-home"> | ||
cvpl_tools | ||
</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 class="current"> | ||
<li class="toctree-l1"><a class="reference internal" href="../index.html">Introduction</a></li> | ||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Quickstart</a><ul> | ||
<li class="toctree-l2"><a class="reference internal" href="#installation">Installation</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="#ome-zarr">OME ZARR</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="#nn-unet">nn-UNet</a></li> | ||
</ul> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="ome_zarr.html">Viewing and IO of OME Zarr</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="setting_up_the_script.html">Setting Up the Script</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="segmentation_pipeline.html">Defining Segmentation Pipeline</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="result_caching.html">Result Caching</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="nnunet.html">nn-UNet</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="beta_amyloid_plaque_detection.html">Beta-Amyloid Plaque Detection</a></li> | ||
</ul> | ||
<p class="caption" role="heading"><span class="caption-text">API Reference</span></p> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../API/napari_zarr.html">cvpl_tools.ome_zarr.napari.add.py</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../API/ome_zarr_io.html">cvpl_tools.ome_zarr.io.py</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../API/tlfs.html">cvpl_tools.tools.fs.py</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../API/ndblock.html">cvpl_tools.im.ndblock.py</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../API/seg_process.html">cvpl_tools.im.process</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../API/algs.html">cvpl_tools.im.algs</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" > | ||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> | ||
<a href="../index.html">cvpl_tools</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 active">Quickstart</li> | ||
<li class="wy-breadcrumbs-aside"> | ||
<a href="../_sources/GettingStarted/quick_start.rst.txt" rel="nofollow"> View page source</a> | ||
</li> | ||
</ul> | ||
<hr/> | ||
</div> | ||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> | ||
<div itemprop="articleBody"> | ||
|
||
<section id="quickstart"> | ||
<span id="quick-start"></span><h1>Quickstart<a class="headerlink" href="#quickstart" title="Permalink to this heading"></a></h1> | ||
<section id="installation"> | ||
<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this heading"></a></h2> | ||
<p>Create an Anaconda environment, and install <a class="reference external" href="https://pytorch.org/get-started/locally/">torch</a> (with GPU | ||
if you need training besides prediction). Check the following environment are installed as well | ||
(use Python 3.11 if you work with SPIMquant environment):</p> | ||
<p>Then <code class="code docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">cvpl_tools</span></code> to finish the installation.</p> | ||
</section> | ||
<section id="ome-zarr"> | ||
<h2>OME ZARR<a class="headerlink" href="#ome-zarr" title="Permalink to this heading"></a></h2> | ||
<p>Create an example OME ZARR, write it to disk and read back:</p> | ||
<p>Read and write can be done on network location. An example of read and display:</p> | ||
</section> | ||
<section id="nn-unet"> | ||
<h2>nn-UNet<a class="headerlink" href="#nn-unet" title="Permalink to this heading"></a></h2> | ||
<p>Download the training (o22)/testing (o23) annotations from Google Drive as follows:</p> | ||
<ol class="arabic simple"> | ||
<li><p><a class="reference external" href="https://drive.google.com/file/d/1S8xNdWD1pznAMaKsrjncBySkHVO5b3HR/view?usp=drive_link">o22</a></p></li> | ||
<li><p><a class="reference external" href="https://drive.google.com/file/d/1xhxLA0RnxoL3c1ojSGTCAIB5yp-Wfrgh/view?usp=drive_link">o23</a></p></li> | ||
</ol> | ||
<p>Put the canvas_o22.tiff file in the same folder as your script, then pair o22 annotation tiff file with the | ||
corresponding training input image volume and start training:</p> | ||
<div class="highlight-Python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">cvpl_tools.examples.mousebrain_processing</span> <span class="kn">import</span> <span class="n">main</span><span class="p">,</span> <span class="n">get_subject</span> | ||
<span class="kn">import</span> <span class="nn">cvpl_tools.nnunet.triplanar</span> <span class="k">as</span> <span class="nn">triplanar</span> | ||
|
||
<span class="n">SUBJECT_ID</span> <span class="o">=</span> <span class="s1">'o22'</span> | ||
<span class="n">SUBJECTS_DIR</span> <span class="o">=</span> <span class="sa">f</span><span class="s1">'subjects'</span> | ||
<span class="n">NNUNET_CACHE_DIR</span> <span class="o">=</span> <span class="sa">f</span><span class="s1">'nnunet_250epoch'</span> | ||
<span class="n">subject</span> <span class="o">=</span> <span class="n">get_subject</span><span class="p">(</span><span class="n">SUBJECT_ID</span><span class="p">,</span> <span class="n">SUBJECTS_DIR</span><span class="p">,</span> <span class="n">NNUNET_CACHE_DIR</span><span class="p">)</span> | ||
<span class="n">main</span><span class="p">(</span><span class="n">subject</span><span class="o">=</span><span class="n">subject</span><span class="p">,</span> <span class="n">run_nnunet</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">run_coiled_process</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> | ||
|
||
<span class="n">train_args</span> <span class="o">=</span> <span class="p">{</span> | ||
<span class="s2">"cache_url"</span><span class="p">:</span> <span class="n">NNUNET_CACHE_DIR</span><span class="p">,</span> | ||
<span class="s2">"train_im"</span><span class="p">:</span> <span class="n">subject</span><span class="o">.</span><span class="n">SECOND_DOWNSAMPLE_CORR_PATH</span><span class="p">,</span> <span class="c1"># image</span> | ||
<span class="s2">"train_seg"</span><span class="p">:</span> <span class="s1">'canvas_o22.tiff'</span><span class="p">,</span> <span class="c1"># label</span> | ||
<span class="s2">"nepoch"</span><span class="p">:</span> <span class="mi">250</span><span class="p">,</span> | ||
<span class="s2">"stack_channels"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> | ||
<span class="s2">"triplanar"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> | ||
<span class="s2">"dataset_id"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> | ||
<span class="s2">"fold"</span><span class="p">:</span> <span class="s1">'0'</span><span class="p">,</span> | ||
<span class="s2">"max_threshold"</span><span class="p">:</span> <span class="mf">7500.</span><span class="p">,</span> | ||
<span class="p">}</span> | ||
<span class="n">triplanar</span><span class="o">.</span><span class="n">train_triplanar</span><span class="p">(</span><span class="n">train_args</span><span class="p">)</span> | ||
</pre></div> | ||
</div> | ||
</section> | ||
</section> | ||
|
||
|
||
</div> | ||
</div> | ||
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> | ||
<a href="../index.html" class="btn btn-neutral float-left" title="Introduction - cvpl_tools documentation" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> | ||
<a href="ome_zarr.html" class="btn btn-neutral float-right" title="OME_ZARR" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> | ||
</div> | ||
|
||
<hr/> | ||
|
||
<div role="contentinfo"> | ||
<p>© Copyright 2024, KarlHanUW.</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> |
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.