%% Generated by Sphinx.
\def\sphinxdocclass{report}
\documentclass[letterpaper,10pt,english]{sphinxmanual}
\ifdefined\pdfpxdimen
\let\sphinxpxdimen\pdfpxdimen\else\newdimen\sphinxpxdimen
\fi \sphinxpxdimen=.75bp\relax
\PassOptionsToPackage{warn}{textcomp}
\usepackage[utf8]{inputenc}
\ifdefined\DeclareUnicodeCharacter
% support both utf8 and utf8x syntaxes
\ifdefined\DeclareUnicodeCharacterAsOptional
\def\sphinxDUC#1{\DeclareUnicodeCharacter{"#1}}
\else
\let\sphinxDUC\DeclareUnicodeCharacter
\fi
\sphinxDUC{00A0}{\nobreakspace}
\sphinxDUC{2500}{\sphinxunichar{2500}}
\sphinxDUC{2502}{\sphinxunichar{2502}}
\sphinxDUC{2514}{\sphinxunichar{2514}}
\sphinxDUC{251C}{\sphinxunichar{251C}}
\sphinxDUC{2572}{\textbackslash}
\fi
\usepackage{cmap}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb,amstext}
\usepackage{babel}
\usepackage{times}
\expandafter\ifx\csname T@LGR\endcsname\relax
\else
% LGR was declared as font encoding
\substitutefont{LGR}{\rmdefault}{cmr}
\substitutefont{LGR}{\sfdefault}{cmss}
\substitutefont{LGR}{\ttdefault}{cmtt}
\fi
\expandafter\ifx\csname T@X2\endcsname\relax
\expandafter\ifx\csname T@T2A\endcsname\relax
\else
% T2A was declared as font encoding
\substitutefont{T2A}{\rmdefault}{cmr}
\substitutefont{T2A}{\sfdefault}{cmss}
\substitutefont{T2A}{\ttdefault}{cmtt}
\fi
\else
% X2 was declared as font encoding
\substitutefont{X2}{\rmdefault}{cmr}
\substitutefont{X2}{\sfdefault}{cmss}
\substitutefont{X2}{\ttdefault}{cmtt}
\fi
\usepackage[Bjarne]{fncychap}
\usepackage{sphinx}
\fvset{fontsize=\small}
\usepackage{geometry}
% Include hyperref last.
\usepackage{hyperref}
% Fix anchor placement for figures with captions.
\usepackage{hypcap}% it must be loaded after hyperref.
% Set up styles of URL: it should be placed after hyperref.
\urlstyle{same}
\addto\captionsenglish{\renewcommand{\contentsname}{Contents:}}
\usepackage{sphinxmessages}
\setcounter{tocdepth}{1}
\title{PathFlowAI Documentation}
\date{Jul 31, 2019}
\release{0.1}
\author{Joshua Levy}
\newcommand{\sphinxlogo}{\vbox{}}
\renewcommand{\releasename}{Release}
\makeindex
\begin{document}
\pagestyle{empty}
\sphinxmaketitle
\pagestyle{plain}
\sphinxtableofcontents
\pagestyle{normal}
\phantomsection\label{\detokenize{index::doc}}
\noindent{\hspace*{\fill}\sphinxincludegraphics[width=480.00000\sphinxpxdimen,height=360.00000\sphinxpxdimen]{{1}.jpeg}\hspace*{\fill}}
\noindent{\hspace*{\fill}\sphinxincludegraphics[width=480.00000\sphinxpxdimen,height=360.00000\sphinxpxdimen]{{2}.jpeg}\hspace*{\fill}}
\noindent{\hspace*{\fill}\sphinxincludegraphics[width=480.00000\sphinxpxdimen,height=360.00000\sphinxpxdimen]{{3}.jpeg}\hspace*{\fill}}
\noindent{\hspace*{\fill}\sphinxincludegraphics[width=480.00000\sphinxpxdimen,height=360.00000\sphinxpxdimen]{{4}.jpeg}\hspace*{\fill}}
\chapter{pathflowai-preprocess}
\label{\detokenize{index:pathflowai-preprocess}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}preprocess \PYG{o}{[}OPTIONS\PYG{o}{]} COMMAND \PYG{o}{[}ARGS\PYG{o}{]}...
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-preprocess command line option@\spxentry{pathflowai-preprocess command line option}!--version@\spxentry{--version}}\index{--version@\spxentry{--version}!pathflowai-preprocess command line option@\spxentry{pathflowai-preprocess command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-version}}\pysigline{\sphinxbfcode{\sphinxupquote{-{-}version}}\sphinxcode{\sphinxupquote{}}}
Show the version and exit.
\end{fulllineitems}
\section{alter\_masks}
\label{\detokenize{index:pathflowai-preprocess-alter-masks}}
Map list of values to other values in mask.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}preprocess alter\PYGZus{}masks \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-preprocess-alter\_masks command line option@\spxentry{pathflowai-preprocess-alter\_masks command line option}!-i, --mask\_dir \textless{}mask\_dir\textgreater{}@\spxentry{-i, --mask\_dir \textless{}mask\_dir\textgreater{}}}\index{-i, --mask\_dir \textless{}mask\_dir\textgreater{}@\spxentry{-i, --mask\_dir \textless{}mask\_dir\textgreater{}}!pathflowai-preprocess-alter\_masks command line option@\spxentry{pathflowai-preprocess-alter\_masks command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-alter-masks-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}mask\_dir}}\sphinxcode{\sphinxupquote{~\textless{}mask\_dir\textgreater{}}}}
Input directory for masks. {[}default: ./inputs/{]}
\end{fulllineitems}
\index{pathflowai-preprocess-alter\_masks command line option@\spxentry{pathflowai-preprocess-alter\_masks command line option}!-o, --output\_dir \textless{}output\_dir\textgreater{}@\spxentry{-o, --output\_dir \textless{}output\_dir\textgreater{}}}\index{-o, --output\_dir \textless{}output\_dir\textgreater{}@\spxentry{-o, --output\_dir \textless{}output\_dir\textgreater{}}!pathflowai-preprocess-alter\_masks command line option@\spxentry{pathflowai-preprocess-alter\_masks command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-alter-masks-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}output\_dir}}\sphinxcode{\sphinxupquote{~\textless{}output\_dir\textgreater{}}}}
Output directory for new masks. {[}default: ./outputs/{]}
\end{fulllineitems}
\index{pathflowai-preprocess-alter\_masks command line option@\spxentry{pathflowai-preprocess-alter\_masks command line option}!-fr, --from\_annotations \textless{}from\_annotations\textgreater{}@\spxentry{-fr, --from\_annotations \textless{}from\_annotations\textgreater{}}}\index{-fr, --from\_annotations \textless{}from\_annotations\textgreater{}@\spxentry{-fr, --from\_annotations \textless{}from\_annotations\textgreater{}}!pathflowai-preprocess-alter\_masks command line option@\spxentry{pathflowai-preprocess-alter\_masks command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-alter-masks-fr}}\pysigline{\sphinxbfcode{\sphinxupquote{-fr}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}from\_annotations}}\sphinxcode{\sphinxupquote{~\textless{}from\_annotations\textgreater{}}}}
Annotations to switch from. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-preprocess-alter\_masks command line option@\spxentry{pathflowai-preprocess-alter\_masks command line option}!-to, --to\_annotations \textless{}to\_annotations\textgreater{}@\spxentry{-to, --to\_annotations \textless{}to\_annotations\textgreater{}}}\index{-to, --to\_annotations \textless{}to\_annotations\textgreater{}@\spxentry{-to, --to\_annotations \textless{}to\_annotations\textgreater{}}!pathflowai-preprocess-alter\_masks command line option@\spxentry{pathflowai-preprocess-alter\_masks command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-alter-masks-to}}\pysigline{\sphinxbfcode{\sphinxupquote{-to}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}to\_annotations}}\sphinxcode{\sphinxupquote{~\textless{}to\_annotations\textgreater{}}}}
Annotations to switch to. {[}default: {]}
\end{fulllineitems}
\section{collapse\_annotations}
\label{\detokenize{index:pathflowai-preprocess-collapse-annotations}}
Adds annotation classes areas to other annotation classes in SQL DB when getting rid of some annotation classes.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}preprocess collapse\PYGZus{}annotations \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}!-i, --input\_patch\_db \textless{}input\_patch\_db\textgreater{}@\spxentry{-i, --input\_patch\_db \textless{}input\_patch\_db\textgreater{}}}\index{-i, --input\_patch\_db \textless{}input\_patch\_db\textgreater{}@\spxentry{-i, --input\_patch\_db \textless{}input\_patch\_db\textgreater{}}!pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-collapse-annotations-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}input\_patch\_db}}\sphinxcode{\sphinxupquote{~\textless{}input\_patch\_db\textgreater{}}}}
Input db. {[}default: patch\_info\_input.db{]}
\end{fulllineitems}
\index{pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}!-o, --output\_patch\_db \textless{}output\_patch\_db\textgreater{}@\spxentry{-o, --output\_patch\_db \textless{}output\_patch\_db\textgreater{}}}\index{-o, --output\_patch\_db \textless{}output\_patch\_db\textgreater{}@\spxentry{-o, --output\_patch\_db \textless{}output\_patch\_db\textgreater{}}!pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-collapse-annotations-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}output\_patch\_db}}\sphinxcode{\sphinxupquote{~\textless{}output\_patch\_db\textgreater{}}}}
Output db. {[}default: patch\_info\_output.db{]}
\end{fulllineitems}
\index{pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}!-fr, --from\_annotations \textless{}from\_annotations\textgreater{}@\spxentry{-fr, --from\_annotations \textless{}from\_annotations\textgreater{}}}\index{-fr, --from\_annotations \textless{}from\_annotations\textgreater{}@\spxentry{-fr, --from\_annotations \textless{}from\_annotations\textgreater{}}!pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-collapse-annotations-fr}}\pysigline{\sphinxbfcode{\sphinxupquote{-fr}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}from\_annotations}}\sphinxcode{\sphinxupquote{~\textless{}from\_annotations\textgreater{}}}}
Annotations to switch from. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}!-to, --to\_annotations \textless{}to\_annotations\textgreater{}@\spxentry{-to, --to\_annotations \textless{}to\_annotations\textgreater{}}}\index{-to, --to\_annotations \textless{}to\_annotations\textgreater{}@\spxentry{-to, --to\_annotations \textless{}to\_annotations\textgreater{}}!pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-collapse-annotations-to}}\pysigline{\sphinxbfcode{\sphinxupquote{-to}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}to\_annotations}}\sphinxcode{\sphinxupquote{~\textless{}to\_annotations\textgreater{}}}}
Annotations to switch to. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}!-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}}\index{-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}!pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-collapse-annotations-ps}}\pysigline{\sphinxbfcode{\sphinxupquote{-ps}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}patch\_size}}\sphinxcode{\sphinxupquote{~\textless{}patch\_size\textgreater{}}}}
Patch size. {[}default: 224{]}
\end{fulllineitems}
\index{pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}!-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}@\spxentry{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}}}\index{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}@\spxentry{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}}!pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-collapse-annotations-rb}}\pysigline{\sphinxbfcode{\sphinxupquote{-rb}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}remove\_background\_annotation}}\sphinxcode{\sphinxupquote{~\textless{}remove\_background\_annotation\textgreater{}}}}
If selected, removes 100\% background patches based on this annotation. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}!-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}@\spxentry{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}}}\index{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}@\spxentry{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}}!pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-collapse-annotations-ma}}\pysigline{\sphinxbfcode{\sphinxupquote{-ma}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}max\_background\_area}}\sphinxcode{\sphinxupquote{~\textless{}max\_background\_area\textgreater{}}}}
Max background area before exclusion. {[}default: 0.05{]}
\end{fulllineitems}
\section{preprocess\_pipeline}
\label{\detokenize{index:pathflowai-preprocess-preprocess-pipeline}}
Preprocessing pipeline that accomplishes 3 things. 1: storage into ZARR format, 2: optional mask adjustment, 3: storage of patch-level information into SQL DB
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}preprocess preprocess\PYGZus{}pipeline \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-npy, --img2npy@\spxentry{-npy, --img2npy}}\index{-npy, --img2npy@\spxentry{-npy, --img2npy}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-npy}}\pysigline{\sphinxbfcode{\sphinxupquote{-npy}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}img2npy}}\sphinxcode{\sphinxupquote{}}}
Image to numpy for faster read. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}}\index{-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-b}}\pysigline{\sphinxbfcode{\sphinxupquote{-b}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}basename}}\sphinxcode{\sphinxupquote{~\textless{}basename\textgreater{}}}}
Basename of patches. {[}default: A01{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-i, --input\_dir \textless{}input\_dir\textgreater{}@\spxentry{-i, --input\_dir \textless{}input\_dir\textgreater{}}}\index{-i, --input\_dir \textless{}input\_dir\textgreater{}@\spxentry{-i, --input\_dir \textless{}input\_dir\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}input\_dir}}\sphinxcode{\sphinxupquote{~\textless{}input\_dir\textgreater{}}}}
Input directory for patches. {[}default: ./inputs/{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-a, --annotations \textless{}annotations\textgreater{}@\spxentry{-a, --annotations \textless{}annotations\textgreater{}}}\index{-a, --annotations \textless{}annotations\textgreater{}@\spxentry{-a, --annotations \textless{}annotations\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-a}}\pysigline{\sphinxbfcode{\sphinxupquote{-a}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}annotations}}\sphinxcode{\sphinxupquote{~\textless{}annotations\textgreater{}}}}
Annotations in image in order. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-pr, --preprocess@\spxentry{-pr, --preprocess}}\index{-pr, --preprocess@\spxentry{-pr, --preprocess}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-pr}}\pysigline{\sphinxbfcode{\sphinxupquote{-pr}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}preprocess}}\sphinxcode{\sphinxupquote{}}}
Run preprocessing pipeline. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-pa, --patches@\spxentry{-pa, --patches}}\index{-pa, --patches@\spxentry{-pa, --patches}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-pa}}\pysigline{\sphinxbfcode{\sphinxupquote{-pa}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}patches}}\sphinxcode{\sphinxupquote{}}}
Add patches to SQL. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-t, --threshold \textless{}threshold\textgreater{}@\spxentry{-t, --threshold \textless{}threshold\textgreater{}}}\index{-t, --threshold \textless{}threshold\textgreater{}@\spxentry{-t, --threshold \textless{}threshold\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-t}}\pysigline{\sphinxbfcode{\sphinxupquote{-t}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}threshold}}\sphinxcode{\sphinxupquote{~\textless{}threshold\textgreater{}}}}
Threshold to remove non-purple slides. {[}default: 0.05{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}}\index{-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-ps}}\pysigline{\sphinxbfcode{\sphinxupquote{-ps}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}patch\_size}}\sphinxcode{\sphinxupquote{~\textless{}patch\_size\textgreater{}}}}
Patch size. {[}default: 224{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-it, --intensity\_threshold \textless{}intensity\_threshold\textgreater{}@\spxentry{-it, --intensity\_threshold \textless{}intensity\_threshold\textgreater{}}}\index{-it, --intensity\_threshold \textless{}intensity\_threshold\textgreater{}@\spxentry{-it, --intensity\_threshold \textless{}intensity\_threshold\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-it}}\pysigline{\sphinxbfcode{\sphinxupquote{-it}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}intensity\_threshold}}\sphinxcode{\sphinxupquote{~\textless{}intensity\_threshold\textgreater{}}}}
Intensity threshold to rate a pixel as non-white. {[}default: 100.0{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-g, --generate\_finetune\_segmentation@\spxentry{-g, --generate\_finetune\_segmentation}}\index{-g, --generate\_finetune\_segmentation@\spxentry{-g, --generate\_finetune\_segmentation}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-g}}\pysigline{\sphinxbfcode{\sphinxupquote{-g}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}generate\_finetune\_segmentation}}\sphinxcode{\sphinxupquote{}}}
Generate patches for one segmentation mask class for targeted finetuning. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-tc, --target\_segmentation\_class \textless{}target\_segmentation\_class\textgreater{}@\spxentry{-tc, --target\_segmentation\_class \textless{}target\_segmentation\_class\textgreater{}}}\index{-tc, --target\_segmentation\_class \textless{}target\_segmentation\_class\textgreater{}@\spxentry{-tc, --target\_segmentation\_class \textless{}target\_segmentation\_class\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-tc}}\pysigline{\sphinxbfcode{\sphinxupquote{-tc}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}target\_segmentation\_class}}\sphinxcode{\sphinxupquote{~\textless{}target\_segmentation\_class\textgreater{}}}}
Segmentation Class to finetune on, output patches to another db. {[}default: 0{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-tt, --target\_threshold \textless{}target\_threshold\textgreater{}@\spxentry{-tt, --target\_threshold \textless{}target\_threshold\textgreater{}}}\index{-tt, --target\_threshold \textless{}target\_threshold\textgreater{}@\spxentry{-tt, --target\_threshold \textless{}target\_threshold\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-tt}}\pysigline{\sphinxbfcode{\sphinxupquote{-tt}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}target\_threshold}}\sphinxcode{\sphinxupquote{~\textless{}target\_threshold\textgreater{}}}}
Threshold to include target for segmentation if saving one class. {[}default: 0.0{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-odb, --out\_db \textless{}out\_db\textgreater{}@\spxentry{-odb, --out\_db \textless{}out\_db\textgreater{}}}\index{-odb, --out\_db \textless{}out\_db\textgreater{}@\spxentry{-odb, --out\_db \textless{}out\_db\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-odb}}\pysigline{\sphinxbfcode{\sphinxupquote{-odb}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}out\_db}}\sphinxcode{\sphinxupquote{~\textless{}out\_db\textgreater{}}}}
Output patch database. {[}default: ./patch\_info.db{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-am, --adjust\_mask@\spxentry{-am, --adjust\_mask}}\index{-am, --adjust\_mask@\spxentry{-am, --adjust\_mask}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-am}}\pysigline{\sphinxbfcode{\sphinxupquote{-am}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}adjust\_mask}}\sphinxcode{\sphinxupquote{}}}
Remove additional background regions from annotation mask. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}@\spxentry{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}}}\index{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}@\spxentry{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-nn}}\pysigline{\sphinxbfcode{\sphinxupquote{-nn}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}n\_neighbors}}\sphinxcode{\sphinxupquote{~\textless{}n\_neighbors\textgreater{}}}}
If adjusting mask, number of neighbors connectivity to remove. {[}default: 5{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-bp, --basic\_preprocess@\spxentry{-bp, --basic\_preprocess}}\index{-bp, --basic\_preprocess@\spxentry{-bp, --basic\_preprocess}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-bp}}\pysigline{\sphinxbfcode{\sphinxupquote{-bp}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}basic\_preprocess}}\sphinxcode{\sphinxupquote{}}}
Basic preprocessing pipeline, annotation areas are not saved. Used for benchmarking tool against comparable pipelines {[}default: False{]}
\end{fulllineitems}
\section{remove\_basename\_from\_db}
\label{\detokenize{index:pathflowai-preprocess-remove-basename-from-db}}
Removes basename/ID from SQL DB.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}preprocess remove\PYGZus{}basename\PYGZus{}from\PYGZus{}db \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-preprocess-remove\_basename\_from\_db command line option@\spxentry{pathflowai-preprocess-remove\_basename\_from\_db command line option}!-i, --input\_patch\_db \textless{}input\_patch\_db\textgreater{}@\spxentry{-i, --input\_patch\_db \textless{}input\_patch\_db\textgreater{}}}\index{-i, --input\_patch\_db \textless{}input\_patch\_db\textgreater{}@\spxentry{-i, --input\_patch\_db \textless{}input\_patch\_db\textgreater{}}!pathflowai-preprocess-remove\_basename\_from\_db command line option@\spxentry{pathflowai-preprocess-remove\_basename\_from\_db command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-remove-basename-from-db-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}input\_patch\_db}}\sphinxcode{\sphinxupquote{~\textless{}input\_patch\_db\textgreater{}}}}
Input db. {[}default: patch\_info\_input.db{]}
\end{fulllineitems}
\index{pathflowai-preprocess-remove\_basename\_from\_db command line option@\spxentry{pathflowai-preprocess-remove\_basename\_from\_db command line option}!-o, --output\_patch\_db \textless{}output\_patch\_db\textgreater{}@\spxentry{-o, --output\_patch\_db \textless{}output\_patch\_db\textgreater{}}}\index{-o, --output\_patch\_db \textless{}output\_patch\_db\textgreater{}@\spxentry{-o, --output\_patch\_db \textless{}output\_patch\_db\textgreater{}}!pathflowai-preprocess-remove\_basename\_from\_db command line option@\spxentry{pathflowai-preprocess-remove\_basename\_from\_db command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-remove-basename-from-db-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}output\_patch\_db}}\sphinxcode{\sphinxupquote{~\textless{}output\_patch\_db\textgreater{}}}}
Output db. {[}default: patch\_info\_output.db{]}
\end{fulllineitems}
\index{pathflowai-preprocess-remove\_basename\_from\_db command line option@\spxentry{pathflowai-preprocess-remove\_basename\_from\_db command line option}!-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}}\index{-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}!pathflowai-preprocess-remove\_basename\_from\_db command line option@\spxentry{pathflowai-preprocess-remove\_basename\_from\_db command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-remove-basename-from-db-b}}\pysigline{\sphinxbfcode{\sphinxupquote{-b}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}basename}}\sphinxcode{\sphinxupquote{~\textless{}basename\textgreater{}}}}
Basename. {[}default: A01{]}
\end{fulllineitems}
\index{pathflowai-preprocess-remove\_basename\_from\_db command line option@\spxentry{pathflowai-preprocess-remove\_basename\_from\_db command line option}!-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}}\index{-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}!pathflowai-preprocess-remove\_basename\_from\_db command line option@\spxentry{pathflowai-preprocess-remove\_basename\_from\_db command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-remove-basename-from-db-ps}}\pysigline{\sphinxbfcode{\sphinxupquote{-ps}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}patch\_size}}\sphinxcode{\sphinxupquote{~\textless{}patch\_size\textgreater{}}}}
Patch size. {[}default: 224{]}
\end{fulllineitems}
\chapter{pathflowai-visualize}
\label{\detokenize{index:pathflowai-visualize}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}visualize \PYG{o}{[}OPTIONS\PYG{o}{]} COMMAND \PYG{o}{[}ARGS\PYG{o}{]}...
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-visualize command line option@\spxentry{pathflowai-visualize command line option}!--version@\spxentry{--version}}\index{--version@\spxentry{--version}!pathflowai-visualize command line option@\spxentry{pathflowai-visualize command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-version}}\pysigline{\sphinxbfcode{\sphinxupquote{-{-}version}}\sphinxcode{\sphinxupquote{}}}
Show the version and exit.
\end{fulllineitems}
\section{extract\_patch}
\label{\detokenize{index:pathflowai-visualize-extract-patch}}
Extract image of patch of any size/location and output to image file
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}visualize extract\PYGZus{}patch \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-i, --input\_dir \textless{}input\_dir\textgreater{}@\spxentry{-i, --input\_dir \textless{}input\_dir\textgreater{}}}\index{-i, --input\_dir \textless{}input\_dir\textgreater{}@\spxentry{-i, --input\_dir \textless{}input\_dir\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}input\_dir}}\sphinxcode{\sphinxupquote{~\textless{}input\_dir\textgreater{}}}}
Input directory for patches. {[}default: ./inputs/{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}}\index{-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-b}}\pysigline{\sphinxbfcode{\sphinxupquote{-b}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}basename}}\sphinxcode{\sphinxupquote{~\textless{}basename\textgreater{}}}}
Basename of patches. {[}default: A01{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-p, --patch\_info\_file \textless{}patch\_info\_file\textgreater{}@\spxentry{-p, --patch\_info\_file \textless{}patch\_info\_file\textgreater{}}}\index{-p, --patch\_info\_file \textless{}patch\_info\_file\textgreater{}@\spxentry{-p, --patch\_info\_file \textless{}patch\_info\_file\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-p}}\pysigline{\sphinxbfcode{\sphinxupquote{-p}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}patch\_info\_file}}\sphinxcode{\sphinxupquote{~\textless{}patch\_info\_file\textgreater{}}}}
Datbase containing all patches {[}default: patch\_info.db{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}}\index{-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-ps}}\pysigline{\sphinxbfcode{\sphinxupquote{-ps}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}patch\_size}}\sphinxcode{\sphinxupquote{~\textless{}patch\_size\textgreater{}}}}
Patch size. {[}default: 224{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-x, --x \textless{}x\textgreater{}@\spxentry{-x, --x \textless{}x\textgreater{}}}\index{-x, --x \textless{}x\textgreater{}@\spxentry{-x, --x \textless{}x\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-x}}\pysigline{\sphinxbfcode{\sphinxupquote{-x}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}x}}\sphinxcode{\sphinxupquote{~\textless{}x\textgreater{}}}}
X Coordinate of patch. {[}default: 0{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-y, --y \textless{}y\textgreater{}@\spxentry{-y, --y \textless{}y\textgreater{}}}\index{-y, --y \textless{}y\textgreater{}@\spxentry{-y, --y \textless{}y\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-y}}\pysigline{\sphinxbfcode{\sphinxupquote{-y}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}y}}\sphinxcode{\sphinxupquote{~\textless{}y\textgreater{}}}}
Y coordinate of patch. {[}default: 0{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-o, --outputfname \textless{}outputfname\textgreater{}@\spxentry{-o, --outputfname \textless{}outputfname\textgreater{}}}\index{-o, --outputfname \textless{}outputfname\textgreater{}@\spxentry{-o, --outputfname \textless{}outputfname\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}outputfname}}\sphinxcode{\sphinxupquote{~\textless{}outputfname\textgreater{}}}}
Output extracted image. {[}default: ./output\_image.png{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-s, --segmentation@\spxentry{-s, --segmentation}}\index{-s, --segmentation@\spxentry{-s, --segmentation}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-s}}\pysigline{\sphinxbfcode{\sphinxupquote{-s}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}segmentation}}\sphinxcode{\sphinxupquote{}}}
Plot segmentations. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-sc, --n\_segmentation\_classes \textless{}n\_segmentation\_classes\textgreater{}@\spxentry{-sc, --n\_segmentation\_classes \textless{}n\_segmentation\_classes\textgreater{}}}\index{-sc, --n\_segmentation\_classes \textless{}n\_segmentation\_classes\textgreater{}@\spxentry{-sc, --n\_segmentation\_classes \textless{}n\_segmentation\_classes\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-sc}}\pysigline{\sphinxbfcode{\sphinxupquote{-sc}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}n\_segmentation\_classes}}\sphinxcode{\sphinxupquote{~\textless{}n\_segmentation\_classes\textgreater{}}}}
Number segmentation classes {[}default: 4{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-c, --custom\_segmentation \textless{}custom\_segmentation\textgreater{}@\spxentry{-c, --custom\_segmentation \textless{}custom\_segmentation\textgreater{}}}\index{-c, --custom\_segmentation \textless{}custom\_segmentation\textgreater{}@\spxentry{-c, --custom\_segmentation \textless{}custom\_segmentation\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-c}}\pysigline{\sphinxbfcode{\sphinxupquote{-c}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}custom\_segmentation}}\sphinxcode{\sphinxupquote{~\textless{}custom\_segmentation\textgreater{}}}}
Add custom segmentation map from prediction, in npy {[}default: {]}
\end{fulllineitems}
\section{overlay\_new\_annotations}
\label{\detokenize{index:pathflowai-visualize-overlay-new-annotations}}
Custom annotations, in format {[}Point: x, y, Point: x, y … {]} one line like this per polygon, overlap these polygons on top of WSI.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}visualize overlay\PYGZus{}new\PYGZus{}annotations \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}!-i, --img\_file \textless{}img\_file\textgreater{}@\spxentry{-i, --img\_file \textless{}img\_file\textgreater{}}}\index{-i, --img\_file \textless{}img\_file\textgreater{}@\spxentry{-i, --img\_file \textless{}img\_file\textgreater{}}!pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-overlay-new-annotations-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}img\_file}}\sphinxcode{\sphinxupquote{~\textless{}img\_file\textgreater{}}}}
Input image. {[}default: image.txt{]}
\end{fulllineitems}
\index{pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}!-a, --annotation\_txt \textless{}annotation\_txt\textgreater{}@\spxentry{-a, --annotation\_txt \textless{}annotation\_txt\textgreater{}}}\index{-a, --annotation\_txt \textless{}annotation\_txt\textgreater{}@\spxentry{-a, --annotation\_txt \textless{}annotation\_txt\textgreater{}}!pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-overlay-new-annotations-a}}\pysigline{\sphinxbfcode{\sphinxupquote{-a}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}annotation\_txt}}\sphinxcode{\sphinxupquote{~\textless{}annotation\_txt\textgreater{}}}}
Column of annotations {[}default: annotation.txt{]}
\end{fulllineitems}
\index{pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}!-ocf, --original\_compression\_factor \textless{}original\_compression\_factor\textgreater{}@\spxentry{-ocf, --original\_compression\_factor \textless{}original\_compression\_factor\textgreater{}}}\index{-ocf, --original\_compression\_factor \textless{}original\_compression\_factor\textgreater{}@\spxentry{-ocf, --original\_compression\_factor \textless{}original\_compression\_factor\textgreater{}}!pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-overlay-new-annotations-ocf}}\pysigline{\sphinxbfcode{\sphinxupquote{-ocf}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}original\_compression\_factor}}\sphinxcode{\sphinxupquote{~\textless{}original\_compression\_factor\textgreater{}}}}
How much compress image. {[}default: 1.0{]}
\end{fulllineitems}
\index{pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}!-cf, --compression\_factor \textless{}compression\_factor\textgreater{}@\spxentry{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}}}\index{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}@\spxentry{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}}!pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-overlay-new-annotations-cf}}\pysigline{\sphinxbfcode{\sphinxupquote{-cf}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}compression\_factor}}\sphinxcode{\sphinxupquote{~\textless{}compression\_factor\textgreater{}}}}
How much compress image. {[}default: 3.0{]}
\end{fulllineitems}
\index{pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}!-o, --outputfilename \textless{}outputfilename\textgreater{}@\spxentry{-o, --outputfilename \textless{}outputfilename\textgreater{}}}\index{-o, --outputfilename \textless{}outputfilename\textgreater{}@\spxentry{-o, --outputfilename \textless{}outputfilename\textgreater{}}!pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-overlay-new-annotations-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}outputfilename}}\sphinxcode{\sphinxupquote{~\textless{}outputfilename\textgreater{}}}}
Output extracted image. {[}default: ./output\_image.png{]}
\end{fulllineitems}
\section{plot\_embeddings}
\label{\detokenize{index:pathflowai-visualize-plot-embeddings}}
Perform UMAP embeddings of patches and plot using plotly.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}visualize plot\PYGZus{}embeddings \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}!-i, --embeddings\_file \textless{}embeddings\_file\textgreater{}@\spxentry{-i, --embeddings\_file \textless{}embeddings\_file\textgreater{}}}\index{-i, --embeddings\_file \textless{}embeddings\_file\textgreater{}@\spxentry{-i, --embeddings\_file \textless{}embeddings\_file\textgreater{}}!pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-embeddings-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}embeddings\_file}}\sphinxcode{\sphinxupquote{~\textless{}embeddings\_file\textgreater{}}}}
Embeddings. {[}default: predictions/embeddings.pkl{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}!-o, --plotly\_output\_file \textless{}plotly\_output\_file\textgreater{}@\spxentry{-o, --plotly\_output\_file \textless{}plotly\_output\_file\textgreater{}}}\index{-o, --plotly\_output\_file \textless{}plotly\_output\_file\textgreater{}@\spxentry{-o, --plotly\_output\_file \textless{}plotly\_output\_file\textgreater{}}!pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-embeddings-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}plotly\_output\_file}}\sphinxcode{\sphinxupquote{~\textless{}plotly\_output\_file\textgreater{}}}}
Plotly output file. {[}default: predictions/embeddings.html{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}!-a, --annotations \textless{}annotations\textgreater{}@\spxentry{-a, --annotations \textless{}annotations\textgreater{}}}\index{-a, --annotations \textless{}annotations\textgreater{}@\spxentry{-a, --annotations \textless{}annotations\textgreater{}}!pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-embeddings-a}}\pysigline{\sphinxbfcode{\sphinxupquote{-a}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}annotations}}\sphinxcode{\sphinxupquote{~\textless{}annotations\textgreater{}}}}
Multiple annotations to color image. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}!-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}@\spxentry{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}}}\index{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}@\spxentry{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}}!pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-embeddings-rb}}\pysigline{\sphinxbfcode{\sphinxupquote{-rb}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}remove\_background\_annotation}}\sphinxcode{\sphinxupquote{~\textless{}remove\_background\_annotation\textgreater{}}}}
If selected, removes 100\% background patches based on this annotation. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}!-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}@\spxentry{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}}}\index{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}@\spxentry{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}}!pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-embeddings-ma}}\pysigline{\sphinxbfcode{\sphinxupquote{-ma}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}max\_background\_area}}\sphinxcode{\sphinxupquote{~\textless{}max\_background\_area\textgreater{}}}}
Max background area before exclusion. {[}default: 0.05{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}!-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}}\index{-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}!pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-embeddings-b}}\pysigline{\sphinxbfcode{\sphinxupquote{-b}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}basename}}\sphinxcode{\sphinxupquote{~\textless{}basename\textgreater{}}}}
Basename of patches. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}!-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}@\spxentry{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}}}\index{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}@\spxentry{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}}!pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-embeddings-nn}}\pysigline{\sphinxbfcode{\sphinxupquote{-nn}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}n\_neighbors}}\sphinxcode{\sphinxupquote{~\textless{}n\_neighbors\textgreater{}}}}
Number nearest neighbors. {[}default: 8{]}
\end{fulllineitems}
\section{plot\_image}
\label{\detokenize{index:pathflowai-visualize-plot-image}}
Plots the whole slide image supplied.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}visualize plot\PYGZus{}image \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-visualize-plot\_image command line option@\spxentry{pathflowai-visualize-plot\_image command line option}!-i, --image\_file \textless{}image\_file\textgreater{}@\spxentry{-i, --image\_file \textless{}image\_file\textgreater{}}}\index{-i, --image\_file \textless{}image\_file\textgreater{}@\spxentry{-i, --image\_file \textless{}image\_file\textgreater{}}!pathflowai-visualize-plot\_image command line option@\spxentry{pathflowai-visualize-plot\_image command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}image\_file}}\sphinxcode{\sphinxupquote{~\textless{}image\_file\textgreater{}}}}
Input image file. {[}default: ./inputs/a.svs{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image command line option@\spxentry{pathflowai-visualize-plot\_image command line option}!-cf, --compression\_factor \textless{}compression\_factor\textgreater{}@\spxentry{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}}}\index{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}@\spxentry{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}}!pathflowai-visualize-plot\_image command line option@\spxentry{pathflowai-visualize-plot\_image command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-cf}}\pysigline{\sphinxbfcode{\sphinxupquote{-cf}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}compression\_factor}}\sphinxcode{\sphinxupquote{~\textless{}compression\_factor\textgreater{}}}}
How much compress image. {[}default: 3.0{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image command line option@\spxentry{pathflowai-visualize-plot\_image command line option}!-o, --outputfname \textless{}outputfname\textgreater{}@\spxentry{-o, --outputfname \textless{}outputfname\textgreater{}}}\index{-o, --outputfname \textless{}outputfname\textgreater{}@\spxentry{-o, --outputfname \textless{}outputfname\textgreater{}}!pathflowai-visualize-plot\_image command line option@\spxentry{pathflowai-visualize-plot\_image command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}outputfname}}\sphinxcode{\sphinxupquote{~\textless{}outputfname\textgreater{}}}}
Output extracted image. {[}default: ./output\_image.png{]}
\end{fulllineitems}
\section{plot\_image\_umap\_embeddings}
\label{\detokenize{index:pathflowai-visualize-plot-image-umap-embeddings}}
Plots a UMAP embedding with each point as its corresponding patch image.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}visualize plot\PYGZus{}image\PYGZus{}umap\PYGZus{}embeddings \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-i, --input\_dir \textless{}input\_dir\textgreater{}@\spxentry{-i, --input\_dir \textless{}input\_dir\textgreater{}}}\index{-i, --input\_dir \textless{}input\_dir\textgreater{}@\spxentry{-i, --input\_dir \textless{}input\_dir\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}input\_dir}}\sphinxcode{\sphinxupquote{~\textless{}input\_dir\textgreater{}}}}
Input directory for patches. {[}default: ./inputs/{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-e, --embeddings\_file \textless{}embeddings\_file\textgreater{}@\spxentry{-e, --embeddings\_file \textless{}embeddings\_file\textgreater{}}}\index{-e, --embeddings\_file \textless{}embeddings\_file\textgreater{}@\spxentry{-e, --embeddings\_file \textless{}embeddings\_file\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-e}}\pysigline{\sphinxbfcode{\sphinxupquote{-e}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}embeddings\_file}}\sphinxcode{\sphinxupquote{~\textless{}embeddings\_file\textgreater{}}}}
Embeddings. {[}default: predictions/embeddings.pkl{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}}\index{-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-b}}\pysigline{\sphinxbfcode{\sphinxupquote{-b}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}basename}}\sphinxcode{\sphinxupquote{~\textless{}basename\textgreater{}}}}
Basename of patches. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-o, --outputfilename \textless{}outputfilename\textgreater{}@\spxentry{-o, --outputfilename \textless{}outputfilename\textgreater{}}}\index{-o, --outputfilename \textless{}outputfilename\textgreater{}@\spxentry{-o, --outputfilename \textless{}outputfilename\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}outputfilename}}\sphinxcode{\sphinxupquote{~\textless{}outputfilename\textgreater{}}}}
Embedding visualization. {[}default: predictions/shap\_plots.png{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-mpl, --mpl\_scatter@\spxentry{-mpl, --mpl\_scatter}}\index{-mpl, --mpl\_scatter@\spxentry{-mpl, --mpl\_scatter}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-mpl}}\pysigline{\sphinxbfcode{\sphinxupquote{-mpl}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}mpl\_scatter}}\sphinxcode{\sphinxupquote{}}}
Plot segmentations. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}@\spxentry{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}}}\index{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}@\spxentry{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-rb}}\pysigline{\sphinxbfcode{\sphinxupquote{-rb}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}remove\_background\_annotation}}\sphinxcode{\sphinxupquote{~\textless{}remove\_background\_annotation\textgreater{}}}}
If selected, removes 100\% background patches based on this annotation. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}@\spxentry{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}}}\index{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}@\spxentry{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-ma}}\pysigline{\sphinxbfcode{\sphinxupquote{-ma}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}max\_background\_area}}\sphinxcode{\sphinxupquote{~\textless{}max\_background\_area\textgreater{}}}}
Max background area before exclusion. {[}default: 0.05{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-z, --zoom \textless{}zoom\textgreater{}@\spxentry{-z, --zoom \textless{}zoom\textgreater{}}}\index{-z, --zoom \textless{}zoom\textgreater{}@\spxentry{-z, --zoom \textless{}zoom\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-z}}\pysigline{\sphinxbfcode{\sphinxupquote{-z}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}zoom}}\sphinxcode{\sphinxupquote{~\textless{}zoom\textgreater{}}}}
Size of images. {[}default: 0.05{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}@\spxentry{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}}}\index{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}@\spxentry{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-nn}}\pysigline{\sphinxbfcode{\sphinxupquote{-nn}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}n\_neighbors}}\sphinxcode{\sphinxupquote{~\textless{}n\_neighbors\textgreater{}}}}
Number nearest neighbors. {[}default: 8{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-sc, --sort\_col \textless{}sort\_col\textgreater{}@\spxentry{-sc, --sort\_col \textless{}sort\_col\textgreater{}}}\index{-sc, --sort\_col \textless{}sort\_col\textgreater{}@\spxentry{-sc, --sort\_col \textless{}sort\_col\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-sc}}\pysigline{\sphinxbfcode{\sphinxupquote{-sc}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}sort\_col}}\sphinxcode{\sphinxupquote{~\textless{}sort\_col\textgreater{}}}}
Sort samples on this column. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-sm, --sort\_mode \textless{}sort\_mode\textgreater{}@\spxentry{-sm, --sort\_mode \textless{}sort\_mode\textgreater{}}}\index{-sm, --sort\_mode \textless{}sort\_mode\textgreater{}@\spxentry{-sm, --sort\_mode \textless{}sort\_mode\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-sm}}\pysigline{\sphinxbfcode{\sphinxupquote{-sm}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}sort\_mode}}\sphinxcode{\sphinxupquote{~\textless{}sort\_mode\textgreater{}}}}
Sort ascending or descending. {[}default: asc{]}
\begin{quote}\begin{description}
\item[{Options}] \leavevmode
asc\textbar{}desc
\end{description}\end{quote}
\end{fulllineitems}
\section{plot\_predictions}
\label{\detokenize{index:pathflowai-visualize-plot-predictions}}
Overlays classification, regression and segmentation patch level predictions on top of whole slide image.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}visualize plot\PYGZus{}predictions \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-i, --input\_dir \textless{}input\_dir\textgreater{}@\spxentry{-i, --input\_dir \textless{}input\_dir\textgreater{}}}\index{-i, --input\_dir \textless{}input\_dir\textgreater{}@\spxentry{-i, --input\_dir \textless{}input\_dir\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}input\_dir}}\sphinxcode{\sphinxupquote{~\textless{}input\_dir\textgreater{}}}}
Input directory for patches. {[}default: ./inputs/{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}}\index{-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-b}}\pysigline{\sphinxbfcode{\sphinxupquote{-b}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}basename}}\sphinxcode{\sphinxupquote{~\textless{}basename\textgreater{}}}}
Basename of patches. {[}default: A01{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-p, --patch\_info\_file \textless{}patch\_info\_file\textgreater{}@\spxentry{-p, --patch\_info\_file \textless{}patch\_info\_file\textgreater{}}}\index{-p, --patch\_info\_file \textless{}patch\_info\_file\textgreater{}@\spxentry{-p, --patch\_info\_file \textless{}patch\_info\_file\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-p}}\pysigline{\sphinxbfcode{\sphinxupquote{-p}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}patch\_info\_file}}\sphinxcode{\sphinxupquote{~\textless{}patch\_info\_file\textgreater{}}}}
Datbase containing all patches {[}default: patch\_info.db{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}}\index{-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-ps}}\pysigline{\sphinxbfcode{\sphinxupquote{-ps}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}patch\_size}}\sphinxcode{\sphinxupquote{~\textless{}patch\_size\textgreater{}}}}
Patch size. {[}default: 224{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-o, --outputfname \textless{}outputfname\textgreater{}@\spxentry{-o, --outputfname \textless{}outputfname\textgreater{}}}\index{-o, --outputfname \textless{}outputfname\textgreater{}@\spxentry{-o, --outputfname \textless{}outputfname\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}outputfname}}\sphinxcode{\sphinxupquote{~\textless{}outputfname\textgreater{}}}}
Output extracted image. {[}default: ./output\_image.png{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-an, --annotations@\spxentry{-an, --annotations}}\index{-an, --annotations@\spxentry{-an, --annotations}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-an}}\pysigline{\sphinxbfcode{\sphinxupquote{-an}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}annotations}}\sphinxcode{\sphinxupquote{}}}
Plot annotations instead of predictions. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-cf, --compression\_factor \textless{}compression\_factor\textgreater{}@\spxentry{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}}}\index{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}@\spxentry{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-cf}}\pysigline{\sphinxbfcode{\sphinxupquote{-cf}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}compression\_factor}}\sphinxcode{\sphinxupquote{~\textless{}compression\_factor\textgreater{}}}}
How much compress image. {[}default: 3.0{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-al, --alpha \textless{}alpha\textgreater{}@\spxentry{-al, --alpha \textless{}alpha\textgreater{}}}\index{-al, --alpha \textless{}alpha\textgreater{}@\spxentry{-al, --alpha \textless{}alpha\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-al}}\pysigline{\sphinxbfcode{\sphinxupquote{-al}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}alpha}}\sphinxcode{\sphinxupquote{~\textless{}alpha\textgreater{}}}}
How much to give annotations/predictions versus original image. {[}default: 0.8{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-s, --segmentation@\spxentry{-s, --segmentation}}\index{-s, --segmentation@\spxentry{-s, --segmentation}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-s}}\pysigline{\sphinxbfcode{\sphinxupquote{-s}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}segmentation}}\sphinxcode{\sphinxupquote{}}}
Plot segmentations. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-sc, --n\_segmentation\_classes \textless{}n\_segmentation\_classes\textgreater{}@\spxentry{-sc, --n\_segmentation\_classes \textless{}n\_segmentation\_classes\textgreater{}}}\index{-sc, --n\_segmentation\_classes \textless{}n\_segmentation\_classes\textgreater{}@\spxentry{-sc, --n\_segmentation\_classes \textless{}n\_segmentation\_classes\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-sc}}\pysigline{\sphinxbfcode{\sphinxupquote{-sc}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}n\_segmentation\_classes}}\sphinxcode{\sphinxupquote{~\textless{}n\_segmentation\_classes\textgreater{}}}}
Number segmentation classes {[}default: 4{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-c, --custom\_segmentation \textless{}custom\_segmentation\textgreater{}@\spxentry{-c, --custom\_segmentation \textless{}custom\_segmentation\textgreater{}}}\index{-c, --custom\_segmentation \textless{}custom\_segmentation\textgreater{}@\spxentry{-c, --custom\_segmentation \textless{}custom\_segmentation\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-c}}\pysigline{\sphinxbfcode{\sphinxupquote{-c}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}custom\_segmentation}}\sphinxcode{\sphinxupquote{~\textless{}custom\_segmentation\textgreater{}}}}
Add custom segmentation map from prediction, npy format. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-ac, --annotation\_col \textless{}annotation\_col\textgreater{}@\spxentry{-ac, --annotation\_col \textless{}annotation\_col\textgreater{}}}\index{-ac, --annotation\_col \textless{}annotation\_col\textgreater{}@\spxentry{-ac, --annotation\_col \textless{}annotation\_col\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-ac}}\pysigline{\sphinxbfcode{\sphinxupquote{-ac}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}annotation\_col}}\sphinxcode{\sphinxupquote{~\textless{}annotation\_col\textgreater{}}}}
Column of annotations {[}default: annotation{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-sf, --scaling\_factor \textless{}scaling\_factor\textgreater{}@\spxentry{-sf, --scaling\_factor \textless{}scaling\_factor\textgreater{}}}\index{-sf, --scaling\_factor \textless{}scaling\_factor\textgreater{}@\spxentry{-sf, --scaling\_factor \textless{}scaling\_factor\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-sf}}\pysigline{\sphinxbfcode{\sphinxupquote{-sf}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}scaling\_factor}}\sphinxcode{\sphinxupquote{~\textless{}scaling\_factor\textgreater{}}}}
Multiply all prediction scores by this amount. {[}default: 1.0{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-tif, --tif\_file@\spxentry{-tif, --tif\_file}}\index{-tif, --tif\_file@\spxentry{-tif, --tif\_file}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-tif}}\pysigline{\sphinxbfcode{\sphinxupquote{-tif}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}tif\_file}}\sphinxcode{\sphinxupquote{}}}
Write to tiff file. {[}default: False{]}
\end{fulllineitems}
\section{shapley\_plot}
\label{\detokenize{index:pathflowai-visualize-shapley-plot}}
Run SHAPley attribution method on patches after classification task to see where model made prediction based on.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}visualize shapley\PYGZus{}plot \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}!-m, --model\_pkl \textless{}model\_pkl\textgreater{}@\spxentry{-m, --model\_pkl \textless{}model\_pkl\textgreater{}}}\index{-m, --model\_pkl \textless{}model\_pkl\textgreater{}@\spxentry{-m, --model\_pkl \textless{}model\_pkl\textgreater{}}!pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-shapley-plot-m}}\pysigline{\sphinxbfcode{\sphinxupquote{-m}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}model\_pkl}}\sphinxcode{\sphinxupquote{~\textless{}model\_pkl\textgreater{}}}}
Plotly output file. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}!-bs, --batch\_size \textless{}batch\_size\textgreater{}@\spxentry{-bs, --batch\_size \textless{}batch\_size\textgreater{}}}\index{-bs, --batch\_size \textless{}batch\_size\textgreater{}@\spxentry{-bs, --batch\_size \textless{}batch\_size\textgreater{}}!pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-shapley-plot-bs}}\pysigline{\sphinxbfcode{\sphinxupquote{-bs}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}batch\_size}}\sphinxcode{\sphinxupquote{~\textless{}batch\_size\textgreater{}}}}
Batch size. {[}default: 32{]}
\end{fulllineitems}
\index{pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}!-o, --outputfilename \textless{}outputfilename\textgreater{}@\spxentry{-o, --outputfilename \textless{}outputfilename\textgreater{}}}\index{-o, --outputfilename \textless{}outputfilename\textgreater{}@\spxentry{-o, --outputfilename \textless{}outputfilename\textgreater{}}!pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-shapley-plot-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}outputfilename}}\sphinxcode{\sphinxupquote{~\textless{}outputfilename\textgreater{}}}}
SHAPley visualization. {[}default: predictions/shap\_plots.png{]}
\end{fulllineitems}
\index{pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}!-mth, --method \textless{}method\textgreater{}@\spxentry{-mth, --method \textless{}method\textgreater{}}}\index{-mth, --method \textless{}method\textgreater{}@\spxentry{-mth, --method \textless{}method\textgreater{}}!pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-shapley-plot-mth}}\pysigline{\sphinxbfcode{\sphinxupquote{-mth}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}method}}\sphinxcode{\sphinxupquote{~\textless{}method\textgreater{}}}}
Method of explaining. {[}default: deep{]}
\begin{quote}\begin{description}
\item[{Options}] \leavevmode
deep\textbar{}gradient
\end{description}\end{quote}
\end{fulllineitems}
\index{pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}!-l, --local\_smoothing \textless{}local\_smoothing\textgreater{}@\spxentry{-l, --local\_smoothing \textless{}local\_smoothing\textgreater{}}}\index{-l, --local\_smoothing \textless{}local\_smoothing\textgreater{}@\spxentry{-l, --local\_smoothing \textless{}local\_smoothing\textgreater{}}!pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-shapley-plot-l}}\pysigline{\sphinxbfcode{\sphinxupquote{-l}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}local\_smoothing}}\sphinxcode{\sphinxupquote{~\textless{}local\_smoothing\textgreater{}}}}
Local smoothing of SHAP scores. {[}default: 0.0{]}
\end{fulllineitems}
\index{pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}!-ns, --n\_samples \textless{}n\_samples\textgreater{}@\spxentry{-ns, --n\_samples \textless{}n\_samples\textgreater{}}}\index{-ns, --n\_samples \textless{}n\_samples\textgreater{}@\spxentry{-ns, --n\_samples \textless{}n\_samples\textgreater{}}!pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-shapley-plot-ns}}\pysigline{\sphinxbfcode{\sphinxupquote{-ns}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}n\_samples}}\sphinxcode{\sphinxupquote{~\textless{}n\_samples\textgreater{}}}}
Number shapley samples for shapley regression (gradient explainer). {[}default: 32{]}
\end{fulllineitems}
\index{pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}!-p, --pred\_out \textless{}pred\_out\textgreater{}@\spxentry{-p, --pred\_out \textless{}pred\_out\textgreater{}}}\index{-p, --pred\_out \textless{}pred\_out\textgreater{}@\spxentry{-p, --pred\_out \textless{}pred\_out\textgreater{}}!pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-shapley-plot-p}}\pysigline{\sphinxbfcode{\sphinxupquote{-p}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}pred\_out}}\sphinxcode{\sphinxupquote{~\textless{}pred\_out\textgreater{}}}}
If not none, output prediction as shap label. {[}default: none{]}
\begin{quote}\begin{description}
\item[{Options}] \leavevmode
none\textbar{}sigmoid\textbar{}softmax
\end{description}\end{quote}
\end{fulllineitems}
\chapter{pathflowai-monitor}
\label{\detokenize{index:pathflowai-monitor}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}monitor \PYG{o}{[}OPTIONS\PYG{o}{]} COMMAND \PYG{o}{[}ARGS\PYG{o}{]}...
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-monitor command line option@\spxentry{pathflowai-monitor command line option}!--version@\spxentry{--version}}\index{--version@\spxentry{--version}!pathflowai-monitor command line option@\spxentry{pathflowai-monitor command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-monitor-version}}\pysigline{\sphinxbfcode{\sphinxupquote{-{-}version}}\sphinxcode{\sphinxupquote{}}}
Show the version and exit.
\end{fulllineitems}
\section{monitor\_usage}
\label{\detokenize{index:pathflowai-monitor-monitor-usage}}
Monitor Usage over Time Interval.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}monitor monitor\PYGZus{}usage \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-monitor-monitor\_usage command line option@\spxentry{pathflowai-monitor-monitor\_usage command line option}!-csv, --records\_output\_csv \textless{}records\_output\_csv\textgreater{}@\spxentry{-csv, --records\_output\_csv \textless{}records\_output\_csv\textgreater{}}}\index{-csv, --records\_output\_csv \textless{}records\_output\_csv\textgreater{}@\spxentry{-csv, --records\_output\_csv \textless{}records\_output\_csv\textgreater{}}!pathflowai-monitor-monitor\_usage command line option@\spxentry{pathflowai-monitor-monitor\_usage command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-monitor-monitor-usage-csv}}\pysigline{\sphinxbfcode{\sphinxupquote{-csv}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}records\_output\_csv}}\sphinxcode{\sphinxupquote{~\textless{}records\_output\_csv\textgreater{}}}}
Where to store records. {[}default: records.csv{]}
\end{fulllineitems}
\index{pathflowai-monitor-monitor\_usage command line option@\spxentry{pathflowai-monitor-monitor\_usage command line option}!-tt, --total\_time \textless{}total\_time\textgreater{}@\spxentry{-tt, --total\_time \textless{}total\_time\textgreater{}}}\index{-tt, --total\_time \textless{}total\_time\textgreater{}@\spxentry{-tt, --total\_time \textless{}total\_time\textgreater{}}!pathflowai-monitor-monitor\_usage command line option@\spxentry{pathflowai-monitor-monitor\_usage command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-monitor-monitor-usage-tt}}\pysigline{\sphinxbfcode{\sphinxupquote{-tt}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}total\_time}}\sphinxcode{\sphinxupquote{~\textless{}total\_time\textgreater{}}}}
Total time to monitor for in minutes. {[}default: 1.0{]}
\end{fulllineitems}
\index{pathflowai-monitor-monitor\_usage command line option@\spxentry{pathflowai-monitor-monitor\_usage command line option}!-dt, --delay\_time \textless{}delay\_time\textgreater{}@\spxentry{-dt, --delay\_time \textless{}delay\_time\textgreater{}}}\index{-dt, --delay\_time \textless{}delay\_time\textgreater{}@\spxentry{-dt, --delay\_time \textless{}delay\_time\textgreater{}}!pathflowai-monitor-monitor\_usage command line option@\spxentry{pathflowai-monitor-monitor\_usage command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-monitor-monitor-usage-dt}}\pysigline{\sphinxbfcode{\sphinxupquote{-dt}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}delay\_time}}\sphinxcode{\sphinxupquote{~\textless{}delay\_time\textgreater{}}}}
Time between samples, in seconds. {[}default: 1.0{]}
\end{fulllineitems}
\phantomsection\label{\detokenize{index:module-pathflowai.datasets}}\index{pathflowai.datasets (module)@\spxentry{pathflowai.datasets}\spxextra{module}}
\chapter{datasets.py}
\label{\detokenize{index:datasets-py}}
Houses the DynamicImageDataset class, also functions to help with image color channel normalization, transformers, etc..
\index{DynamicImageDataset (class in pathflowai.datasets)@\spxentry{DynamicImageDataset}\spxextra{class in pathflowai.datasets}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.DynamicImageDataset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.datasets.}}\sphinxbfcode{\sphinxupquote{DynamicImageDataset}}}{\emph{dataset\_df}, \emph{set}, \emph{patch\_info\_file}, \emph{transformers}, \emph{input\_dir}, \emph{target\_names}, \emph{pos\_annotation\_class}, \emph{other\_annotations={[}{]}}, \emph{segmentation=False}, \emph{patch\_size=224}, \emph{fix\_names=True}, \emph{target\_segmentation\_class=-1}, \emph{target\_threshold=0.0}, \emph{oversampling\_factor=1.0}, \emph{n\_segmentation\_classes=4}, \emph{gdl=False}, \emph{mt\_bce=False}, \emph{classify\_annotations=False}}{}
Generate image dataset that accesses images and annotations via dask.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{dataset\_df:dataframe}}] \leavevmode
Dataframe with WSI, which set it is in (train/test/val) and corresponding WSI labels if applicable.
\item[{\sphinxstylestrong{set:str}}] \leavevmode
Whether train, test, val or pass (normalization) set.
\item[{\sphinxstylestrong{patch\_info\_file:str}}] \leavevmode
SQL db with positional and annotation information on each slide.
\item[{\sphinxstylestrong{transformers:dict}}] \leavevmode
Contains transformers to apply on images.
\item[{\sphinxstylestrong{input\_dir:str}}] \leavevmode
Directory where images comes from.
\item[{\sphinxstylestrong{target\_names:list/str}}] \leavevmode
Names of initial targets, which may be modified.
\item[{\sphinxstylestrong{pos\_annotation\_class:str}}] \leavevmode
If selected and predicting on WSI, this class is labeled as a positive from the WSI, while the other classes are not.
\item[{\sphinxstylestrong{other\_annotations:list}}] \leavevmode
Other annotations to consider from patch info db.
\item[{\sphinxstylestrong{segmentation:bool}}] \leavevmode
Conducting segmentation task?
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size.
\item[{\sphinxstylestrong{fix\_names:bool}}] \leavevmode
Whether to change the names of dataset\_df.
\item[{\sphinxstylestrong{target\_segmentation\_class:list}}] \leavevmode
Now can be used for classification as well, matched with two below options, samples images only from this class. Can specify this and below two options multiple times.
\item[{\sphinxstylestrong{target\_threshold:list}}] \leavevmode
Sampled only if above this threshold of occurence in the patches.
\item[{\sphinxstylestrong{oversampling\_factor:list}}] \leavevmode
Over sample them at this amount.
\item[{\sphinxstylestrong{n\_segmentation\_classes:int}}] \leavevmode
Number classes to segment.
\item[{\sphinxstylestrong{gdl:bool}}] \leavevmode
Using generalized dice loss?
\item[{\sphinxstylestrong{mt\_bce:bool}}] \leavevmode
For multi-target prediction tasks.
\item[{\sphinxstylestrong{classify\_annotations:bool}}] \leavevmode
For classifying annotations.
\end{description}
\end{description}\end{quote}
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
{\hyperref[\detokenize{index:pathflowai.datasets.DynamicImageDataset.binarize_annotations}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{binarize\_annotations}}}}}(self{[}, binarizer, …{]})
&
Label binarize some annotations or threshold them if classifying slide annotations.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.datasets.DynamicImageDataset.concat}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{concat}}}}}(self, other\_dataset)
&
Concatenate this dataset with others.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.datasets.DynamicImageDataset.get_class_weights}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_class\_weights}}}}}(self{[}, i{]})
&
Weight loss function with weights inversely proportional to the class appearence.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.datasets.DynamicImageDataset.retain_ID}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{retain\_ID}}}}}(self, ID)
&
Reduce the sample set to just images from one ID.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.datasets.DynamicImageDataset.split_by_ID}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{split\_by\_ID}}}}}(self)
&
Generator similar to groupby, but splits up by ID, generates (ID,data) using retain\_ID.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.datasets.DynamicImageDataset.subsample}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subsample}}}}}(self, p)
&
Sample subset of dataset.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\index{binarize\_annotations() (pathflowai.datasets.DynamicImageDataset method)@\spxentry{binarize\_annotations()}\spxextra{pathflowai.datasets.DynamicImageDataset method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.DynamicImageDataset.binarize_annotations}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{binarize\_annotations}}}{\emph{self}, \emph{binarizer=None}, \emph{num\_targets=1}, \emph{binary\_threshold=0.0}}{}
Label binarize some annotations or threshold them if classifying slide annotations.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{binarizer:LabelBinarizer}}] \leavevmode
Binarizes the labels of a column(s)
\item[{\sphinxstylestrong{num\_targets:int}}] \leavevmode
Number of desired targets to preidict on.
\item[{\sphinxstylestrong{binary\_threshold:float}}] \leavevmode
Amount of annotation in patch before positive annotation.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{binarizer}] \leavevmode
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{concat() (pathflowai.datasets.DynamicImageDataset method)@\spxentry{concat()}\spxextra{pathflowai.datasets.DynamicImageDataset method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.DynamicImageDataset.concat}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{concat}}}{\emph{self}, \emph{other\_dataset}}{}
Concatenate this dataset with others. Updates its own internal attributes.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{other\_dataset:DynamicImageDataset}}] \leavevmode
Other image dataset.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{get\_class\_weights() (pathflowai.datasets.DynamicImageDataset method)@\spxentry{get\_class\_weights()}\spxextra{pathflowai.datasets.DynamicImageDataset method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.DynamicImageDataset.get_class_weights}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_class\_weights}}}{\emph{self}, \emph{i=0}}{}
Weight loss function with weights inversely proportional to the class appearence.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{i:int}}] \leavevmode
If multi-target, class used for weighting.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{self}] \leavevmode
Dataset.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{retain\_ID() (pathflowai.datasets.DynamicImageDataset method)@\spxentry{retain\_ID()}\spxextra{pathflowai.datasets.DynamicImageDataset method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.DynamicImageDataset.retain_ID}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{retain\_ID}}}{\emph{self}, \emph{ID}}{}
Reduce the sample set to just images from one ID.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{ID:str}}] \leavevmode
Basename/ID to predict on.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{self}] \leavevmode
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{split\_by\_ID() (pathflowai.datasets.DynamicImageDataset method)@\spxentry{split\_by\_ID()}\spxextra{pathflowai.datasets.DynamicImageDataset method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.DynamicImageDataset.split_by_ID}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{split\_by\_ID}}}{\emph{self}}{}
Generator similar to groupby, but splits up by ID, generates (ID,data) using retain\_ID.
\begin{quote}\begin{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{generator}] \leavevmode
ID, DynamicDataset
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{subsample() (pathflowai.datasets.DynamicImageDataset method)@\spxentry{subsample()}\spxextra{pathflowai.datasets.DynamicImageDataset method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.DynamicImageDataset.subsample}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subsample}}}{\emph{self}, \emph{p}}{}
Sample subset of dataset.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{p:float}}] \leavevmode
Fraction to subsample.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\end{fulllineitems}
\index{RandomRotate90() (in module pathflowai.datasets)@\spxentry{RandomRotate90()}\spxextra{in module pathflowai.datasets}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.RandomRotate90}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.datasets.}}\sphinxbfcode{\sphinxupquote{RandomRotate90}}}{}{}
Transformer for random 90 degree rotation image.
\begin{quote}\begin{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{function}] \leavevmode
Transformer function for operation.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{create\_transforms() (in module pathflowai.datasets)@\spxentry{create\_transforms()}\spxextra{in module pathflowai.datasets}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.create_transforms}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.datasets.}}\sphinxbfcode{\sphinxupquote{create\_transforms}}}{\emph{mean}, \emph{std}}{}
Create transformers.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{mean:list}}] \leavevmode
See get\_data\_transforms.
\item[{\sphinxstylestrong{std:list}}] \leavevmode
See get\_data\_transforms.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dict}] \leavevmode
Transformers.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{get\_data\_transforms() (in module pathflowai.datasets)@\spxentry{get\_data\_transforms()}\spxextra{in module pathflowai.datasets}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.get_data_transforms}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.datasets.}}\sphinxbfcode{\sphinxupquote{get\_data\_transforms}}}{\emph{patch\_size=None}, \emph{mean={[}{]}}, \emph{std={[}{]}}, \emph{resize=False}, \emph{transform\_platform='torch'}, \emph{elastic=True}}{}
Get data transformers for training test and validation sets.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Original patch size being transformed.
\item[{\sphinxstylestrong{mean:list of float}}] \leavevmode
Mean RGB
\item[{\sphinxstylestrong{std:list of float}}] \leavevmode
Std RGB
\item[{\sphinxstylestrong{resize:int}}] \leavevmode
Which patch size to resize to.
\item[{\sphinxstylestrong{transform\_platform:str}}] \leavevmode
Use pytorch or albumentation transforms.
\item[{\sphinxstylestrong{elastic:bool}}] \leavevmode
Whether to add elastic deformations from albumentations.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dict}] \leavevmode
Transformers.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{get\_normalizer() (in module pathflowai.datasets)@\spxentry{get\_normalizer()}\spxextra{in module pathflowai.datasets}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.get_normalizer}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.datasets.}}\sphinxbfcode{\sphinxupquote{get\_normalizer}}}{\emph{normalization\_file}, \emph{dataset\_opts}}{}
Find mean and standard deviation of images in batches.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{normalization\_file:str}}] \leavevmode
File to store normalization information.
\item[{\sphinxstylestrong{dataset\_opts:type}}] \leavevmode
Dictionary storing information to create DynamicDataset class.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dict}] \leavevmode
Stores RGB mean, stdev.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{segmentation\_transform() (in module pathflowai.datasets)@\spxentry{segmentation\_transform()}\spxextra{in module pathflowai.datasets}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.segmentation_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.datasets.}}\sphinxbfcode{\sphinxupquote{segmentation\_transform}}}{\emph{img}, \emph{mask}, \emph{transformer}}{}
Run albumentations and return an image and its segmentation mask.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{img:array}}] \leavevmode
Image as array
\item[{\sphinxstylestrong{mask:array}}] \leavevmode
Categorical pixel by pixel.
\item[{\sphinxstylestrong{transformer :}}] \leavevmode
Transformation object.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{tuple arrays}] \leavevmode
Image and mask array.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\phantomsection\label{\detokenize{index:module-pathflowai.losses}}\index{pathflowai.losses (module)@\spxentry{pathflowai.losses}\spxextra{module}}
\chapter{losses.py}
\label{\detokenize{index:losses-py}}
Some additional loss functions that can be called using the pipeline, some of which still to be implemented.
\index{FocalLoss (class in pathflowai.losses)@\spxentry{FocalLoss}\spxextra{class in pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.FocalLoss}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{FocalLoss}}}{\emph{num\_class}, \emph{alpha=None}, \emph{gamma=2}, \emph{balance\_index=-1}, \emph{smooth=None}, \emph{size\_average=True}}{}
\# \sphinxurl{https://raw.githubusercontent.com/Hsuxu/Loss\_ToolBox-PyTorch/master/FocalLoss/FocalLoss.py}
This is a implementation of Focal Loss with smooth label cross entropy supported which is proposed in
‘Focal Loss for Dense Object Detection. (\sphinxurl{https://arxiv.org/abs/1708.02002})’
\begin{quote}
Focal\_Loss= -1*alpha*(1-pt)*log(pt)
\end{quote}
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {}
\sphinxstyleliteralstrong{\sphinxupquote{num\_class}} \textendash{}
\item {}
\sphinxstyleliteralstrong{\sphinxupquote{alpha}} \textendash{} (tensor) 3D or 4D the scalar factor for this criterion
\item {}
\sphinxstyleliteralstrong{\sphinxupquote{gamma}} \textendash{} (float,double) gamma \textgreater{} 0 reduces the relative loss for well-classified examples (p\textgreater{}0.5) putting more
focus on hard misclassified example
\item {}
\sphinxstyleliteralstrong{\sphinxupquote{smooth}} \textendash{} (float,double) smooth value when cross entropy
\item {}
\sphinxstyleliteralstrong{\sphinxupquote{balance\_index}} \textendash{} (int) balance class index, should be specific when alpha is float
\item {}
\sphinxstyleliteralstrong{\sphinxupquote{size\_average}} \textendash{} (bool, optional) By default, the losses are averaged over each loss element in the batch.
\end{itemize}
\end{description}\end{quote}
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
\sphinxcode{\sphinxupquote{\_\_call\_\_}}(self, \textbackslash{}*input, \textbackslash{}*\textbackslash{}*kwargs)
&
Call self as a function.
\\
\hline
\sphinxcode{\sphinxupquote{add\_module}}(self, name, module)
&
Adds a child module to the current module.
\\
\hline
\sphinxcode{\sphinxupquote{apply}}(self, fn)
&
Applies \sphinxcode{\sphinxupquote{fn}} recursively to every submodule (as returned by \sphinxcode{\sphinxupquote{.children()}}) as well as self.
\\
\hline
\sphinxcode{\sphinxupquote{buffers}}(self{[}, recurse{]})
&
Returns an iterator over module buffers.
\\
\hline
\sphinxcode{\sphinxupquote{children}}(self)
&
Returns an iterator over immediate children modules.
\\
\hline
\sphinxcode{\sphinxupquote{cpu}}(self)
&
Moves all model parameters and buffers to the CPU.
\\
\hline
\sphinxcode{\sphinxupquote{cuda}}(self{[}, device{]})
&
Moves all model parameters and buffers to the GPU.
\\
\hline
\sphinxcode{\sphinxupquote{double}}(self)
&
Casts all floating point parameters and buffers to \sphinxcode{\sphinxupquote{double}} datatype.
\\
\hline
\sphinxcode{\sphinxupquote{eval}}(self)
&
Sets the module in evaluation mode.
\\
\hline
\sphinxcode{\sphinxupquote{extra\_repr}}(self)
&
Set the extra representation of the module
\\
\hline
\sphinxcode{\sphinxupquote{float}}(self)
&
Casts all floating point parameters and buffers to float datatype.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.losses.FocalLoss.forward}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{forward}}}}}(self, logit, target)
&
Defines the computation performed at every call.
\\
\hline
\sphinxcode{\sphinxupquote{half}}(self)
&
Casts all floating point parameters and buffers to \sphinxcode{\sphinxupquote{half}} datatype.
\\
\hline
\sphinxcode{\sphinxupquote{load\_state\_dict}}(self, state\_dict{[}, strict{]})
&
Copies parameters and buffers from \sphinxcode{\sphinxupquote{state\_dict}} into this module and its descendants.
\\
\hline
\sphinxcode{\sphinxupquote{modules}}(self)
&
Returns an iterator over all modules in the network.
\\
\hline
\sphinxcode{\sphinxupquote{named\_buffers}}(self{[}, prefix, recurse{]})
&
Returns an iterator over module buffers, yielding both the name of the buffer as well as the buffer itself.
\\
\hline
\sphinxcode{\sphinxupquote{named\_children}}(self)
&
Returns an iterator over immediate children modules, yielding both the name of the module as well as the module itself.
\\
\hline
\sphinxcode{\sphinxupquote{named\_modules}}(self{[}, memo, prefix{]})
&
Returns an iterator over all modules in the network, yielding both the name of the module as well as the module itself.
\\
\hline
\sphinxcode{\sphinxupquote{named\_parameters}}(self{[}, prefix, recurse{]})
&
Returns an iterator over module parameters, yielding both the name of the parameter as well as the parameter itself.
\\
\hline
\sphinxcode{\sphinxupquote{parameters}}(self{[}, recurse{]})
&
Returns an iterator over module parameters.
\\
\hline
\sphinxcode{\sphinxupquote{register\_backward\_hook}}(self, hook)
&
Registers a backward hook on the module.
\\
\hline
\sphinxcode{\sphinxupquote{register\_buffer}}(self, name, tensor)
&
Adds a persistent buffer to the module.
\\
\hline
\sphinxcode{\sphinxupquote{register\_forward\_hook}}(self, hook)
&
Registers a forward hook on the module.
\\
\hline
\sphinxcode{\sphinxupquote{register\_forward\_pre\_hook}}(self, hook)
&
Registers a forward pre-hook on the module.
\\
\hline
\sphinxcode{\sphinxupquote{register\_parameter}}(self, name, param)
&
Adds a parameter to the module.
\\
\hline
\sphinxcode{\sphinxupquote{state\_dict}}(self{[}, destination, prefix, …{]})
&
Returns a dictionary containing a whole state of the module.
\\
\hline
\sphinxcode{\sphinxupquote{to}}(self, \textbackslash{}*args, \textbackslash{}*\textbackslash{}*kwargs)
&
Moves and/or casts the parameters and buffers.
\\
\hline
\sphinxcode{\sphinxupquote{train}}(self{[}, mode{]})
&
Sets the module in training mode.
\\
\hline
\sphinxcode{\sphinxupquote{type}}(self, dst\_type)
&
Casts all parameters and buffers to \sphinxcode{\sphinxupquote{dst\_type}}.
\\
\hline
\sphinxcode{\sphinxupquote{zero\_grad}}(self)
&
Sets gradients of all model parameters to zero.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\begin{savenotes}\sphinxattablestart
\centering
\begin{tabulary}{\linewidth}[t]{|T|T|}
\hline
\sphinxstylestrong{share\_memory}
&\\
\hline
\end{tabulary}
\par
\sphinxattableend\end{savenotes}
\index{forward() (pathflowai.losses.FocalLoss method)@\spxentry{forward()}\spxextra{pathflowai.losses.FocalLoss method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.FocalLoss.forward}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{forward}}}{\emph{self}, \emph{logit}, \emph{target}}{}
Defines the computation performed at every call.
Should be overridden by all subclasses.
\begin{sphinxadmonition}{note}{Note:}
Although the recipe for forward pass needs to be defined within
this function, one should call the \sphinxcode{\sphinxupquote{Module}} instance afterwards
instead of this since the former takes care of running the
registered hooks while the latter silently ignores them.
\end{sphinxadmonition}
\end{fulllineitems}
\end{fulllineitems}
\index{GeneralizedDice (class in pathflowai.losses)@\spxentry{GeneralizedDice}\spxextra{class in pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.GeneralizedDice}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{GeneralizedDice}}}{\emph{**kwargs}}{}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/losses.py}
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
\sphinxcode{\sphinxupquote{\_\_call\_\_}}(self, probs, target, \_)
&
Call self as a function.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\end{fulllineitems}
\index{GeneralizedDiceLoss (class in pathflowai.losses)@\spxentry{GeneralizedDiceLoss}\spxextra{class in pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.GeneralizedDiceLoss}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{GeneralizedDiceLoss}}}{\emph{weight=None}, \emph{channelwise=False}, \emph{eps=1e-06}, \emph{add\_softmax=False}}{}
\sphinxurl{https://raw.githubusercontent.com/inferno-pytorch/inferno/0561e8a95cde6bfc5e10a3609841b7b0ca5b03ca/inferno/extensions/criteria/set\_similarity\_measures.py}
Computes the scalar Generalized Dice Loss defined in \sphinxurl{https://arxiv.org/abs/1707.03237}
This version works for multiple classes and expects predictions for every class (e.g. softmax output) and
one-hot targets for every class.
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
\sphinxcode{\sphinxupquote{\_\_call\_\_}}(self, \textbackslash{}*input, \textbackslash{}*\textbackslash{}*kwargs)
&
Call self as a function.
\\
\hline
\sphinxcode{\sphinxupquote{add\_module}}(self, name, module)
&
Adds a child module to the current module.
\\
\hline
\sphinxcode{\sphinxupquote{apply}}(self, fn)
&
Applies \sphinxcode{\sphinxupquote{fn}} recursively to every submodule (as returned by \sphinxcode{\sphinxupquote{.children()}}) as well as self.
\\
\hline
\sphinxcode{\sphinxupquote{buffers}}(self{[}, recurse{]})
&
Returns an iterator over module buffers.
\\
\hline
\sphinxcode{\sphinxupquote{children}}(self)
&
Returns an iterator over immediate children modules.
\\
\hline
\sphinxcode{\sphinxupquote{cpu}}(self)
&
Moves all model parameters and buffers to the CPU.
\\
\hline
\sphinxcode{\sphinxupquote{cuda}}(self{[}, device{]})
&
Moves all model parameters and buffers to the GPU.
\\
\hline
\sphinxcode{\sphinxupquote{double}}(self)
&
Casts all floating point parameters and buffers to \sphinxcode{\sphinxupquote{double}} datatype.
\\
\hline
\sphinxcode{\sphinxupquote{eval}}(self)
&
Sets the module in evaluation mode.
\\
\hline
\sphinxcode{\sphinxupquote{extra\_repr}}(self)
&
Set the extra representation of the module
\\
\hline
\sphinxcode{\sphinxupquote{float}}(self)
&
Casts all floating point parameters and buffers to float datatype.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.losses.GeneralizedDiceLoss.forward}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{forward}}}}}(self, input, target)
&
input: torch.FloatTensor or torch.cuda.FloatTensor target: torch.FloatTensor or torch.cuda.FloatTensor
\\
\hline
\sphinxcode{\sphinxupquote{half}}(self)
&
Casts all floating point parameters and buffers to \sphinxcode{\sphinxupquote{half}} datatype.
\\
\hline
\sphinxcode{\sphinxupquote{load\_state\_dict}}(self, state\_dict{[}, strict{]})
&
Copies parameters and buffers from \sphinxcode{\sphinxupquote{state\_dict}} into this module and its descendants.
\\
\hline
\sphinxcode{\sphinxupquote{modules}}(self)
&
Returns an iterator over all modules in the network.
\\
\hline
\sphinxcode{\sphinxupquote{named\_buffers}}(self{[}, prefix, recurse{]})
&
Returns an iterator over module buffers, yielding both the name of the buffer as well as the buffer itself.
\\
\hline
\sphinxcode{\sphinxupquote{named\_children}}(self)
&
Returns an iterator over immediate children modules, yielding both the name of the module as well as the module itself.
\\
\hline
\sphinxcode{\sphinxupquote{named\_modules}}(self{[}, memo, prefix{]})
&
Returns an iterator over all modules in the network, yielding both the name of the module as well as the module itself.
\\
\hline
\sphinxcode{\sphinxupquote{named\_parameters}}(self{[}, prefix, recurse{]})
&
Returns an iterator over module parameters, yielding both the name of the parameter as well as the parameter itself.
\\
\hline
\sphinxcode{\sphinxupquote{parameters}}(self{[}, recurse{]})
&
Returns an iterator over module parameters.
\\
\hline
\sphinxcode{\sphinxupquote{register\_backward\_hook}}(self, hook)
&
Registers a backward hook on the module.
\\
\hline
\sphinxcode{\sphinxupquote{register\_buffer}}(self, name, tensor)
&
Adds a persistent buffer to the module.
\\
\hline
\sphinxcode{\sphinxupquote{register\_forward\_hook}}(self, hook)
&
Registers a forward hook on the module.
\\
\hline
\sphinxcode{\sphinxupquote{register\_forward\_pre\_hook}}(self, hook)
&
Registers a forward pre-hook on the module.
\\
\hline
\sphinxcode{\sphinxupquote{register\_parameter}}(self, name, param)
&
Adds a parameter to the module.
\\
\hline
\sphinxcode{\sphinxupquote{state\_dict}}(self{[}, destination, prefix, …{]})
&
Returns a dictionary containing a whole state of the module.
\\
\hline
\sphinxcode{\sphinxupquote{to}}(self, \textbackslash{}*args, \textbackslash{}*\textbackslash{}*kwargs)
&
Moves and/or casts the parameters and buffers.
\\
\hline
\sphinxcode{\sphinxupquote{train}}(self{[}, mode{]})
&
Sets the module in training mode.
\\
\hline
\sphinxcode{\sphinxupquote{type}}(self, dst\_type)
&
Casts all parameters and buffers to \sphinxcode{\sphinxupquote{dst\_type}}.
\\
\hline
\sphinxcode{\sphinxupquote{zero\_grad}}(self)
&
Sets gradients of all model parameters to zero.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\begin{savenotes}\sphinxattablestart
\centering
\begin{tabulary}{\linewidth}[t]{|T|T|}
\hline
\sphinxstylestrong{share\_memory}
&\\
\hline
\end{tabulary}
\par
\sphinxattableend\end{savenotes}
\index{forward() (pathflowai.losses.GeneralizedDiceLoss method)@\spxentry{forward()}\spxextra{pathflowai.losses.GeneralizedDiceLoss method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.GeneralizedDiceLoss.forward}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{forward}}}{\emph{self}, \emph{input}, \emph{target}}{}
input: torch.FloatTensor or torch.cuda.FloatTensor
target: torch.FloatTensor or torch.cuda.FloatTensor
\begin{description}
\item[{Expected shape of the inputs:}] \leavevmode\begin{itemize}
\item {}
if not channelwise: (batch\_size, nb\_classes, …)
\item {}
if channelwise: (batch\_size, nb\_channels, nb\_classes, …)
\end{itemize}
\end{description}
\end{fulllineitems}
\end{fulllineitems}
\index{ShapeError@\spxentry{ShapeError}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.ShapeError}}\pysigline{\sphinxbfcode{\sphinxupquote{exception }}\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{ShapeError}}}~
\end{fulllineitems}
\index{SurfaceLoss (class in pathflowai.losses)@\spxentry{SurfaceLoss}\spxextra{class in pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.SurfaceLoss}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{SurfaceLoss}}}{\emph{**kwargs}}{}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/losses.py}
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
\sphinxcode{\sphinxupquote{\_\_call\_\_}}(self, probs, dist\_maps, \_)
&
Call self as a function.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\end{fulllineitems}
\index{assert\_() (in module pathflowai.losses)@\spxentry{assert\_()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.assert_}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{assert\_}}}{\emph{condition}, \emph{message=''}, \emph{exception\_type=\textless{}class 'AssertionError'\textgreater{}}}{}
\sphinxurl{https://raw.githubusercontent.com/inferno-pytorch/inferno/0561e8a95cde6bfc5e10a3609841b7b0ca5b03ca/inferno/utils/exceptions.py}
Like assert, but with arbitrary exception types.
\end{fulllineitems}
\index{class2one\_hot() (in module pathflowai.losses)@\spxentry{class2one\_hot()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.class2one_hot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{class2one\_hot}}}{\emph{seg:torch.Tensor}, \emph{C:int}}{{ $\rightarrow$ torch.Tensor}}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/utils.py}
\end{fulllineitems}
\index{eq() (in module pathflowai.losses)@\spxentry{eq()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.eq}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{eq}}}{\emph{a:torch.Tensor}, \emph{b}}{{ $\rightarrow$ bool}}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/utils.py}
\end{fulllineitems}
\index{flatten\_samples() (in module pathflowai.losses)@\spxentry{flatten\_samples()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.flatten_samples}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{flatten\_samples}}}{\emph{input\_}}{}
\sphinxurl{https://raw.githubusercontent.com/inferno-pytorch/inferno/0561e8a95cde6bfc5e10a3609841b7b0ca5b03ca/inferno/utils/torch\_utils.py}
Flattens a tensor or a variable such that the channel axis is first and the sample axis
is second. The shapes are transformed as follows:
\begin{quote}
(N, C, H, W) \textendash{}\textgreater{} (C, N * H * W)
(N, C, D, H, W) \textendash{}\textgreater{} (C, N * D * H * W)
(N, C) \textendash{}\textgreater{} (C, N)
\end{quote}
The input must be atleast 2d.
\end{fulllineitems}
\index{one\_hot() (in module pathflowai.losses)@\spxentry{one\_hot()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.one_hot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{one\_hot}}}{\emph{t:torch.Tensor}, \emph{axis=1}}{{ $\rightarrow$ bool}}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/utils.py}
\end{fulllineitems}
\index{one\_hot2dist() (in module pathflowai.losses)@\spxentry{one\_hot2dist()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.one_hot2dist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{one\_hot2dist}}}{\emph{seg:numpy.ndarray}}{{ $\rightarrow$ numpy.ndarray}}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/utils.py}
\end{fulllineitems}
\index{simplex() (in module pathflowai.losses)@\spxentry{simplex()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.simplex}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{simplex}}}{\emph{t:torch.Tensor}, \emph{axis=1}}{{ $\rightarrow$ bool}}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/utils.py}
\end{fulllineitems}
\index{sset() (in module pathflowai.losses)@\spxentry{sset()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.sset}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{sset}}}{\emph{a:torch.Tensor}, \emph{sub:Iterable}}{{ $\rightarrow$ bool}}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/utils.py}
\end{fulllineitems}
\index{uniq() (in module pathflowai.losses)@\spxentry{uniq()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.uniq}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{uniq}}}{\emph{a:torch.Tensor}}{{ $\rightarrow$ Set}}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/utils.py}
\end{fulllineitems}
\phantomsection\label{\detokenize{index:module-pathflowai.sampler}}\index{pathflowai.sampler (module)@\spxentry{pathflowai.sampler}\spxextra{module}}
\chapter{sampler.py}
\label{\detokenize{index:sampler-py}}
Balanced sampling based on one of the columns of the patch information.
\index{ImbalancedDatasetSampler (class in pathflowai.sampler)@\spxentry{ImbalancedDatasetSampler}\spxextra{class in pathflowai.sampler}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.sampler.ImbalancedDatasetSampler}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.sampler.}}\sphinxbfcode{\sphinxupquote{ImbalancedDatasetSampler}}}{\emph{dataset}, \emph{indices=None}, \emph{num\_samples=None}}{}
Samples elements randomly from a given list of indices for imbalanced dataset
\sphinxurl{https://raw.githubusercontent.com/ufoym/imbalanced-dataset-sampler/master/sampler.py}
Arguments:
\begin{quote}
indices (list, optional): a list of indices
num\_samples (int, optional): number of samples to draw
\end{quote}
\end{fulllineitems}
\phantomsection\label{\detokenize{index:module-pathflowai.schedulers}}\index{pathflowai.schedulers (module)@\spxentry{pathflowai.schedulers}\spxextra{module}}
\chapter{schedulers.py}
\label{\detokenize{index:schedulers-py}}
Modulates the learning rate during the training process.
\index{CosineAnnealingWithRestartsLR (class in pathflowai.schedulers)@\spxentry{CosineAnnealingWithRestartsLR}\spxextra{class in pathflowai.schedulers}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.schedulers.CosineAnnealingWithRestartsLR}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.schedulers.}}\sphinxbfcode{\sphinxupquote{CosineAnnealingWithRestartsLR}}}{\emph{optimizer}, \emph{T\_max}, \emph{eta\_min=0}, \emph{last\_epoch=-1}, \emph{T\_mult=1.0}, \emph{alpha\_decay=1.0}}{}
Set the learning rate of each parameter group using a cosine annealing
schedule, where \(\eta_{max}\) is set to the initial lr and
\(T_{cur}\) is the number of epochs since the last restart in SGDR:
\begin{quote}
\begin{equation*}
\begin{split}\eta_t = \eta_{min} + \frac{1}{2}(\eta_{max} - \eta_{min})(1 +
\cos(\frac{T_{cur}}{T_{max}}\pi))\end{split}
\end{equation*}
When last\_epoch=-1, sets initial lr as lr.
It has been proposed in
\end{quote}
\sphinxhref{https://arxiv.org/abs/1608.03983}{SGDR: Stochastic Gradient Descent with Warm Restarts}. This implements
the cosine annealing part of SGDR, the restarts and number of iterations multiplier.
\begin{quote}
\begin{description}
\item[{Args:}] \leavevmode
optimizer (Optimizer): Wrapped optimizer.
T\_max (int): Maximum number of iterations.
T\_mult (float): Multiply T\_max by this number after each restart. Default: 1.
eta\_min (float): Minimum learning rate. Default: 0.
last\_epoch (int): The index of last epoch. Default: -1.
\end{description}
\end{quote}
\begin{quote}\begin{description}
\item[{Attributes}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{step\_n}}] \leavevmode
\end{description}
\end{description}\end{quote}
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
\sphinxcode{\sphinxupquote{load\_state\_dict}}(self, state\_dict)
&
Loads the schedulers state.
\\
\hline
\sphinxcode{\sphinxupquote{state\_dict}}(self)
&
Returns the state of the scheduler as a \sphinxcode{\sphinxupquote{dict}}.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\begin{savenotes}\sphinxattablestart
\centering
\begin{tabulary}{\linewidth}[t]{|T|T|}
\hline
\sphinxstylestrong{cosine}
&\\
\hline
\sphinxstylestrong{get\_lr}
&\\
\hline
\sphinxstylestrong{restart}
&\\
\hline
\sphinxstylestrong{step}
&\\
\hline
\end{tabulary}
\par
\sphinxattableend\end{savenotes}
\end{fulllineitems}
\index{Scheduler (class in pathflowai.schedulers)@\spxentry{Scheduler}\spxextra{class in pathflowai.schedulers}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.schedulers.Scheduler}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.schedulers.}}\sphinxbfcode{\sphinxupquote{Scheduler}}}{\emph{optimizer=None}, \emph{opts=\{'T\_max': 10}, \emph{'T\_mult': 2}, \emph{'eta\_min': 5e-08}, \emph{'lr\_scheduler\_decay': 0.5}, \emph{'scheduler': 'null'\}}}{}
Scheduler class that modulates learning rate of torch optimizers over epochs.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{optimizer}}] \leavevmode{[}type{]}
torch.Optimizer object
\item[{\sphinxstylestrong{opts}}] \leavevmode{[}type{]}
Options of setting the learning rate scheduler, see default.
\end{description}
\item[{Attributes}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{schedulers}}] \leavevmode{[}type{]}
Different types of schedulers to choose from.
\item[{\sphinxstylestrong{scheduler\_step\_fn}}] \leavevmode{[}type{]}
How scheduler updates learning rate.
\item[{\sphinxstylestrong{initial\_lr}}] \leavevmode{[}type{]}
Initial set learning rate.
\item[{\sphinxstylestrong{scheduler\_choice}}] \leavevmode{[}type{]}
What scheduler type was chosen.
\item[{\sphinxstylestrong{scheduler}}] \leavevmode{[}type{]}
Scheduler object chosen that will more directly update optimizer LR.
\end{description}
\end{description}\end{quote}
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
{\hyperref[\detokenize{index:pathflowai.schedulers.Scheduler.get_lr}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_lr}}}}}(self)
&
Return current learning rate.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.schedulers.Scheduler.step}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step}}}}}(self)
&
Update optimizer learning rate
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\index{get\_lr() (pathflowai.schedulers.Scheduler method)@\spxentry{get\_lr()}\spxextra{pathflowai.schedulers.Scheduler method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.schedulers.Scheduler.get_lr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_lr}}}{\emph{self}}{}
Return current learning rate.
\begin{quote}\begin{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{float}] \leavevmode
Current learning rate.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{step() (pathflowai.schedulers.Scheduler method)@\spxentry{step()}\spxextra{pathflowai.schedulers.Scheduler method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.schedulers.Scheduler.step}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{step}}}{\emph{self}}{}
Update optimizer learning rate
\end{fulllineitems}
\end{fulllineitems}
\phantomsection\label{\detokenize{index:module-pathflowai.visualize}}\index{pathflowai.visualize (module)@\spxentry{pathflowai.visualize}\spxextra{module}}
\chapter{visualize.py}
\label{\detokenize{index:visualize-py}}
Plots SHAP outputs, UMAP embeddings, and overlays predictions on top of WSI.
\index{PlotlyPlot (class in pathflowai.visualize)@\spxentry{PlotlyPlot}\spxextra{class in pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.PlotlyPlot}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{PlotlyPlot}}}
Creates plotly html plots.
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
{\hyperref[\detokenize{index:pathflowai.visualize.PlotlyPlot.add_plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_plot}}}}}(self, t\_data\_df{[}, G, color\_col, …{]})
&
Adds plotting data to be plotted.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.visualize.PlotlyPlot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}(self, output\_fname{[}, axes\_off{]})
&
Plot embedding of patches to html file.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\index{add\_plot() (pathflowai.visualize.PlotlyPlot method)@\spxentry{add\_plot()}\spxextra{pathflowai.visualize.PlotlyPlot method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.PlotlyPlot.add_plot}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_plot}}}{\emph{self, t\_data\_df, G=None, color\_col='color', name\_col='name', xyz\_cols={[}'x', 'y', 'z'{]}, size=2, opacity=1.0, custom\_colors={[}{]}}}{}
Adds plotting data to be plotted.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{t\_data\_df:dataframe}}] \leavevmode
3-D transformed dataframe.
\item[{\sphinxstylestrong{G:nx.Graph}}] \leavevmode
Networkx graph.
\item[{\sphinxstylestrong{color\_col:str}}] \leavevmode
Column to use to color points.
\item[{\sphinxstylestrong{name\_col:str}}] \leavevmode
Column to use to name points.
\item[{\sphinxstylestrong{xyz\_cols:list}}] \leavevmode
3 columns that denote x,y,z coords.
\item[{\sphinxstylestrong{size:int}}] \leavevmode
Marker size.
\item[{\sphinxstylestrong{opacity:float}}] \leavevmode
Marker opacity.
\item[{\sphinxstylestrong{custom\_colors:list}}] \leavevmode
Custom colors to supply.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{plot() (pathflowai.visualize.PlotlyPlot method)@\spxentry{plot()}\spxextra{pathflowai.visualize.PlotlyPlot method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.PlotlyPlot.plot}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{plot}}}{\emph{self}, \emph{output\_fname}, \emph{axes\_off=False}}{}
Plot embedding of patches to html file.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{output\_fname:str}}] \leavevmode
Output html file.
\item[{\sphinxstylestrong{axes\_off:bool}}] \leavevmode
Remove axes.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\end{fulllineitems}
\index{PredictionPlotter (class in pathflowai.visualize)@\spxentry{PredictionPlotter}\spxextra{class in pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.PredictionPlotter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{PredictionPlotter}}}{\emph{dask\_arr\_dict}, \emph{patch\_info\_db}, \emph{compression\_factor=3}, \emph{alpha=0.5}, \emph{patch\_size=224}, \emph{no\_db=False}, \emph{plot\_annotation=False}, \emph{segmentation=False}, \emph{n\_segmentation\_classes=4}, \emph{input\_dir=''}, \emph{annotation\_col='annotation'}, \emph{scaling\_factor=1.0}}{}
Plots predictions over entire image.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{dask\_arr\_dict:dict}}] \leavevmode
Stores all dask arrays corresponding to all of the images.
\item[{\sphinxstylestrong{patch\_info\_db:str}}] \leavevmode
Patch level information, eg. prediction.
\item[{\sphinxstylestrong{compression\_factor:float}}] \leavevmode
How much to compress image by.
\item[{\sphinxstylestrong{alpha:float}}] \leavevmode
Low value assigns higher weight to prediction over original image.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size.
\item[{\sphinxstylestrong{no\_db:bool}}] \leavevmode
Don’t use patch information.
\item[{\sphinxstylestrong{plot\_annotation:bool}}] \leavevmode
Plot annotations from patch information.
\item[{\sphinxstylestrong{segmentation:bool}}] \leavevmode
Plot segmentation mask.
\item[{\sphinxstylestrong{n\_segmentation\_classes:int}}] \leavevmode
Number segmentation classes.
\item[{\sphinxstylestrong{input\_dir:str}}] \leavevmode
Input directory.
\item[{\sphinxstylestrong{annotation\_col:str}}] \leavevmode
Annotation column to plot.
\item[{\sphinxstylestrong{scaling\_factor:float}}] \leavevmode
Multiplies the prediction scores to make them appear darker on the images when predicting.
\end{description}
\end{description}\end{quote}
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
{\hyperref[\detokenize{index:pathflowai.visualize.PredictionPlotter.add_custom_segmentation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_custom\_segmentation}}}}}(self, basename, npy)
&
Replace segmentation mask with new custom segmentation.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.visualize.PredictionPlotter.generate_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{generate\_image}}}}}(self, ID)
&
Generate the image array for the whole slide image with predictions overlaid.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.visualize.PredictionPlotter.output_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_image}}}}}(self, img, filename{[}, tif{]})
&
Output calculated image to file.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.visualize.PredictionPlotter.return_patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{return\_patch}}}}}(self, ID, x, y, patch\_size)
&
Return one single patch instead of entire image.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\index{add\_custom\_segmentation() (pathflowai.visualize.PredictionPlotter method)@\spxentry{add\_custom\_segmentation()}\spxextra{pathflowai.visualize.PredictionPlotter method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.PredictionPlotter.add_custom_segmentation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_custom\_segmentation}}}{\emph{self}, \emph{basename}, \emph{npy}}{}
Replace segmentation mask with new custom segmentation.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{basename:str}}] \leavevmode
Patient ID
\item[{\sphinxstylestrong{npy:str}}] \leavevmode
Numpy mask.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{generate\_image() (pathflowai.visualize.PredictionPlotter method)@\spxentry{generate\_image()}\spxextra{pathflowai.visualize.PredictionPlotter method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.PredictionPlotter.generate_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{generate\_image}}}{\emph{self}, \emph{ID}}{}
Generate the image array for the whole slide image with predictions overlaid.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{ID:str}}] \leavevmode
patient ID.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{array}] \leavevmode
Resulting overlaid whole slide image.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{output\_image() (pathflowai.visualize.PredictionPlotter method)@\spxentry{output\_image()}\spxextra{pathflowai.visualize.PredictionPlotter method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.PredictionPlotter.output_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{output\_image}}}{\emph{self}, \emph{img}, \emph{filename}, \emph{tif=False}}{}
Output calculated image to file.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{img:array}}] \leavevmode
Image.
\item[{\sphinxstylestrong{filename:str}}] \leavevmode
Output file name.
\item[{\sphinxstylestrong{tif:bool}}] \leavevmode
Store in TIF format?
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{return\_patch() (pathflowai.visualize.PredictionPlotter method)@\spxentry{return\_patch()}\spxextra{pathflowai.visualize.PredictionPlotter method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.PredictionPlotter.return_patch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{return\_patch}}}{\emph{self}, \emph{ID}, \emph{x}, \emph{y}, \emph{patch\_size}}{}
Return one single patch instead of entire image.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{ID:str}}] \leavevmode
Patient ID
\item[{\sphinxstylestrong{x:int}}] \leavevmode
X coordinate.
\item[{\sphinxstylestrong{y:int}}] \leavevmode
Y coordinate.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{array}] \leavevmode
Image.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\end{fulllineitems}
\index{annotation2rgb() (in module pathflowai.visualize)@\spxentry{annotation2rgb()}\spxextra{in module pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.annotation2rgb}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{annotation2rgb}}}{\emph{i}, \emph{palette}, \emph{arr}}{}
Go from annotation of patch to color.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{i:int}}] \leavevmode
Annotation index.
\item[{\sphinxstylestrong{palette:palette}}] \leavevmode
Index to color mapping.
\item[{\sphinxstylestrong{arr:array}}] \leavevmode
Image array.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{array}] \leavevmode
Resulting image.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{blend() (in module pathflowai.visualize)@\spxentry{blend()}\spxextra{in module pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.blend}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{blend}}}{\emph{arr1}, \emph{arr2}, \emph{alpha=0.5}}{}
Blend 2 arrays together, mixing with alpha.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{arr1:array}}] \leavevmode
Image 1.
\item[{\sphinxstylestrong{arr2:array}}] \leavevmode
Image 2.
\item[{\sphinxstylestrong{alpha:float}}] \leavevmode
Higher alpha makes image more like image 1.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{array}] \leavevmode
Resulting image.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{plot\_image\_() (in module pathflowai.visualize)@\spxentry{plot\_image\_()}\spxextra{in module pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.plot_image_}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{plot\_image\_}}}{\emph{image\_file}, \emph{compression\_factor=2.0}, \emph{test\_image\_name='test.png'}}{}
Plots entire SVS/other image.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{image\_file:str}}] \leavevmode
Image file.
\item[{\sphinxstylestrong{compression\_factor:float}}] \leavevmode
Amount to shrink each dimension of image.
\item[{\sphinxstylestrong{test\_image\_name:str}}] \leavevmode
Output image file.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{plot\_shap() (in module pathflowai.visualize)@\spxentry{plot\_shap()}\spxextra{in module pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.plot_shap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{plot\_shap}}}{\emph{model}, \emph{dataset\_opts}, \emph{transform\_opts}, \emph{batch\_size}, \emph{outputfilename}, \emph{n\_outputs=1}, \emph{method='deep'}, \emph{local\_smoothing=0.0}, \emph{n\_samples=20}, \emph{pred\_out=False}}{}
Plot shapley attributions overlaid on images for classification tasks.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{model:nn.Module}}] \leavevmode
Pytorch model.
\item[{\sphinxstylestrong{dataset\_opts:dict}}] \leavevmode
Options used to configure dataset
\item[{\sphinxstylestrong{transform\_opts:dict}}] \leavevmode
Options used to configure transformers.
\item[{\sphinxstylestrong{batch\_size:int}}] \leavevmode
Batch size for training.
\item[{\sphinxstylestrong{outputfilename:str}}] \leavevmode
Output filename.
\item[{\sphinxstylestrong{n\_outputs:int}}] \leavevmode
Number of top outputs.
\item[{\sphinxstylestrong{method:str}}] \leavevmode
Gradient or deep explainer.
\item[{\sphinxstylestrong{local\_smoothing:float}}] \leavevmode
How much to smooth shapley map.
\item[{\sphinxstylestrong{n\_samples:int}}] \leavevmode
Number shapley samples to draw.
\item[{\sphinxstylestrong{pred\_out:bool}}] \leavevmode
Label images with binary prediction score?
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{plot\_umap\_images() (in module pathflowai.visualize)@\spxentry{plot\_umap\_images()}\spxextra{in module pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.plot_umap_images}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{plot\_umap\_images}}}{\emph{dask\_arr\_dict}, \emph{embeddings\_file}, \emph{ID=None}, \emph{cval=1.0}, \emph{image\_res=300.0}, \emph{outputfname='output\_embedding.png'}, \emph{mpl\_scatter=True}, \emph{remove\_background\_annotation=''}, \emph{max\_background\_area=0.01}, \emph{zoom=0.05}, \emph{n\_neighbors=10}, \emph{sort\_col=''}, \emph{sort\_mode='asc'}}{}
Make UMAP embedding plot, overlaid with images.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{dask\_arr\_dict:dict}}] \leavevmode
Stored dask arrays for each WSI.
\item[{\sphinxstylestrong{embeddings\_file:str}}] \leavevmode
Embeddings pickle file stored from running using after trainign the model.
\item[{\sphinxstylestrong{ID:str}}] \leavevmode
Patient ID.
\item[{\sphinxstylestrong{cval:float}}] \leavevmode
Deprecated
\item[{\sphinxstylestrong{image\_res:float}}] \leavevmode
Image resolution.
\item[{\sphinxstylestrong{outputfname:str}}] \leavevmode
Output image file.
\item[{\sphinxstylestrong{mpl\_scatter:bool}}] \leavevmode
Recommended: Use matplotlib for scatter plot.
\item[{\sphinxstylestrong{remove\_background\_annotation:str}}] \leavevmode
Remove the background annotations. Enter for annotation to remove.
\item[{\sphinxstylestrong{max\_background\_area:float}}] \leavevmode
Maximum backgrund area in each tile for inclusion.
\item[{\sphinxstylestrong{zoom:float}}] \leavevmode
How much to zoom in on each patch, less than 1 is zoom out.
\item[{\sphinxstylestrong{n\_neighbors:int}}] \leavevmode
Number of neighbors for UMAP embedding.
\item[{\sphinxstylestrong{sort\_col:str}}] \leavevmode
Patch info column to sort on.
\item[{\sphinxstylestrong{sort\_mode:str}}] \leavevmode
Sort ascending or descending.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{type}] \leavevmode
Description of returned object.
\item[{Inspired by: \sphinxurl{https://gist.github.com/lukemetz/be6123c7ee3b366e333a}}] \leavevmode
\item[{WIP!! Needs testing.}] \leavevmode
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{prob2rbg() (in module pathflowai.visualize)@\spxentry{prob2rbg()}\spxextra{in module pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.prob2rbg}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{prob2rbg}}}{\emph{prob}, \emph{palette}, \emph{arr}}{}
Convert probability score to rgb image.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{prob:float}}] \leavevmode
Between 0 and 1 score.
\item[{\sphinxstylestrong{palette:palette}}] \leavevmode
Pallet converts between prob and color.
\item[{\sphinxstylestrong{arr:array}}] \leavevmode
Original array.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{array}] \leavevmode
New image colored by prediction score.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{seg2rgb() (in module pathflowai.visualize)@\spxentry{seg2rgb()}\spxextra{in module pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.seg2rgb}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{seg2rgb}}}{\emph{seg}, \emph{palette}, \emph{n\_segmentation\_classes}}{}
Color each pixel by segmentation class.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{seg:array}}] \leavevmode
Segmentation mask.
\item[{\sphinxstylestrong{palette:palette}}] \leavevmode
Color to RGB map.
\item[{\sphinxstylestrong{n\_segmentation\_classes:int}}] \leavevmode
Total number segmentation classes.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{array}] \leavevmode
Returned segmentation image.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{to\_pil() (in module pathflowai.visualize)@\spxentry{to\_pil()}\spxextra{in module pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.to_pil}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{to\_pil}}}{\emph{arr}}{}
Numpy array to pil.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{arr:array}}] \leavevmode
Numpy array.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{Image}] \leavevmode
PIL Image.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\phantomsection\label{\detokenize{index:module-pathflowai.utils}}\index{pathflowai.utils (module)@\spxentry{pathflowai.utils}\spxextra{module}}
\chapter{utils.py}
\label{\detokenize{index:utils-py}}
General utilities that still need to be broken up into preprocessing, machine learning input preparation, and output submodules.
\index{add\_purple\_mask() (in module pathflowai.utils)@\spxentry{add\_purple\_mask()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.add_purple_mask}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{add\_purple\_mask}}}{\emph{arr}}{}
Optional add intensity mask to the dask array.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{arr:dask.array}}] \leavevmode
Image data.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{array}] \leavevmode
Image data with intensity added as forth channel.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{adjust\_mask() (in module pathflowai.utils)@\spxentry{adjust\_mask()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.adjust_mask}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{adjust\_mask}}}{\emph{mask\_file}, \emph{dask\_img\_array\_file}, \emph{out\_npy}, \emph{n\_neighbors}}{}
Fixes segmentation masks to reduce coarse annotations over empty regions.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{mask\_file:str}}] \leavevmode
NPY segmentation mask.
\item[{\sphinxstylestrong{dask\_img\_array\_file:str}}] \leavevmode
Dask image file.
\item[{\sphinxstylestrong{out\_npy:str}}] \leavevmode
Output numpy file.
\item[{\sphinxstylestrong{n\_neighbors:int}}] \leavevmode
Number nearest neighbors for dilation and erosion of mask from background to not background.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{str}] \leavevmode
Output numpy file.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{boxes2interior() (in module pathflowai.utils)@\spxentry{boxes2interior()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.boxes2interior}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{boxes2interior}}}{\emph{img\_size}, \emph{polygons}}{}
Deprecated.
\end{fulllineitems}
\index{create\_purple\_mask() (in module pathflowai.utils)@\spxentry{create\_purple\_mask()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.create_purple_mask}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{create\_purple\_mask}}}{\emph{arr}, \emph{img\_size=None}, \emph{sparse=True}}{}
Create a gray scale intensity mask. This will be changed soon to support other thresholding QC methods.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{arr:dask.array}}] \leavevmode
Dask array containing image information.
\item[{\sphinxstylestrong{img\_size:int}}] \leavevmode
Deprecated.
\item[{\sphinxstylestrong{sparse:bool}}] \leavevmode
Deprecated
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dask.array}] \leavevmode
Intensity, grayscale array over image.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{create\_sparse\_annotation\_arrays() (in module pathflowai.utils)@\spxentry{create\_sparse\_annotation\_arrays()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.create_sparse_annotation_arrays}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{create\_sparse\_annotation\_arrays}}}{\emph{xml\_file}, \emph{img\_size}, \emph{annotations={[}{]}}}{}
Convert annotation xml to shapely objects and store in dictionary.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{xml\_file:str}}] \leavevmode
XML file containing annotations.
\item[{\sphinxstylestrong{img\_size:int}}] \leavevmode
Deprecated.
\item[{\sphinxstylestrong{annotations:list}}] \leavevmode
Annotations to look for in xml export.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dict}] \leavevmode
Dictionary with annotation-shapely object pairs.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{create\_train\_val\_test() (in module pathflowai.utils)@\spxentry{create\_train\_val\_test()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.create_train_val_test}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{create\_train\_val\_test}}}{\emph{train\_val\_test\_pkl}, \emph{input\_info\_db}, \emph{patch\_size}}{}
Create dataframe that splits slides into training validation and test.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{train\_val\_test\_pkl:str}}] \leavevmode
Pickle for training validation and test slides.
\item[{\sphinxstylestrong{input\_info\_db:str}}] \leavevmode
Patch information SQL database.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size looking to access.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dataframe}] \leavevmode
Train test validation splits.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{df2sql() (in module pathflowai.utils)@\spxentry{df2sql()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.df2sql}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{df2sql}}}{\emph{df}, \emph{sql\_file}, \emph{patch\_size}, \emph{mode='replace'}}{}
Write dataframe containing patch level information to SQL db.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{df:dataframe}}] \leavevmode
Dataframe containing patch information.
\item[{\sphinxstylestrong{sql\_file:str}}] \leavevmode
SQL database.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Size of patches.
\item[{\sphinxstylestrong{mode:str}}] \leavevmode
Replace or append.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{dir2images() (in module pathflowai.utils)@\spxentry{dir2images()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.dir2images}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{dir2images}}}{\emph{image\_dir}}{}
Deprecated
\end{fulllineitems}
\index{extract\_patch\_information() (in module pathflowai.utils)@\spxentry{extract\_patch\_information()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.extract_patch_information}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{extract\_patch\_information}}}{\emph{basename}, \emph{input\_dir='./'}, \emph{annotations={[}{]}}, \emph{threshold=0.5}, \emph{patch\_size=224}, \emph{generate\_finetune\_segmentation=False}, \emph{target\_class=0}, \emph{intensity\_threshold=100.0}, \emph{target\_threshold=0.0}, \emph{adj\_mask=''}, \emph{basic\_preprocess=False}, \emph{tries=0}}{}
Final step of preprocessing pipeline. Break up image into patches, include if not background and of a certain intensity, find area of each annotation type in patch, spatial information, image ID and dump data to SQL table.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{basename:str}}] \leavevmode
Patient ID.
\item[{\sphinxstylestrong{input\_dir:str}}] \leavevmode
Input directory.
\item[{\sphinxstylestrong{annotations:list}}] \leavevmode
List of annotations to record, these can be different tissue types, must correspond with XML labels.
\item[{\sphinxstylestrong{threshold:float}}] \leavevmode
Value between 0 and 1 that indicates the minimum amount of patch that musn’t be background for inclusion.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size of patches; this will become one of the tables.
\item[{\sphinxstylestrong{generate\_finetune\_segmentation:bool}}] \leavevmode
Deprecated.
\item[{\sphinxstylestrong{target\_class:int}}] \leavevmode
Number of segmentation classes desired, from 0th class to target\_class-1 will be annotated in SQL.
\item[{\sphinxstylestrong{intensity\_threshold:float}}] \leavevmode
Value between 0 and 255 that represents minimum intensity to not include as background. Will be modified with new transforms.
\item[{\sphinxstylestrong{target\_threshold:float}}] \leavevmode
Deprecated.
\item[{\sphinxstylestrong{adj\_mask:str}}] \leavevmode
Adjusted mask if performed binary opening operations in previous preprocessing step.
\item[{\sphinxstylestrong{basic\_preprocess:bool}}] \leavevmode
Do not store patch level information.
\item[{\sphinxstylestrong{tries:int}}] \leavevmode
Number of tries in case there is a Dask timeout, run again.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dataframe}] \leavevmode
Patch information.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{fix\_name() (in module pathflowai.utils)@\spxentry{fix\_name()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.fix_name}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{fix\_name}}}{\emph{basename}}{}
Fixes illegitimate basename, deprecated.
\end{fulllineitems}
\index{fix\_names() (in module pathflowai.utils)@\spxentry{fix\_names()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.fix_names}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{fix\_names}}}{\emph{file\_dir}}{}
Fixes basenames, deprecated.
\end{fulllineitems}
\index{generate\_patch\_pipeline() (in module pathflowai.utils)@\spxentry{generate\_patch\_pipeline()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.generate_patch_pipeline}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{generate\_patch\_pipeline}}}{\emph{basename}, \emph{input\_dir='./'}, \emph{annotations={[}{]}}, \emph{threshold=0.5}, \emph{patch\_size=224}, \emph{out\_db='patch\_info.db'}, \emph{generate\_finetune\_segmentation=False}, \emph{target\_class=0}, \emph{intensity\_threshold=100.0}, \emph{target\_threshold=0.0}, \emph{adj\_mask=''}, \emph{basic\_preprocess=False}}{}
Short summary.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{basename:str}}] \leavevmode
Patient ID.
\item[{\sphinxstylestrong{input\_dir:str}}] \leavevmode
Input directory.
\item[{\sphinxstylestrong{annotations:list}}] \leavevmode
List of annotations to record, these can be different tissue types, must correspond with XML labels.
\item[{\sphinxstylestrong{threshold:float}}] \leavevmode
Value between 0 and 1 that indicates the minimum amount of patch that musn’t be background for inclusion.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size of patches; this will become one of the tables.
\item[{\sphinxstylestrong{out\_db:str}}] \leavevmode
Output SQL database.
\item[{\sphinxstylestrong{generate\_finetune\_segmentation:bool}}] \leavevmode
Deprecated.
\item[{\sphinxstylestrong{target\_class:int}}] \leavevmode
Number of segmentation classes desired, from 0th class to target\_class-1 will be annotated in SQL.
\item[{\sphinxstylestrong{intensity\_threshold:float}}] \leavevmode
Value between 0 and 255 that represents minimum intensity to not include as background. Will be modified with new transforms.
\item[{\sphinxstylestrong{target\_threshold:float}}] \leavevmode
Deprecated.
\item[{\sphinxstylestrong{adj\_mask:str}}] \leavevmode
Adjusted mask if performed binary opening operations in previous preprocessing step.
\item[{\sphinxstylestrong{basic\_preprocess:bool}}] \leavevmode
Do not store patch level information.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{grab\_interior\_points() (in module pathflowai.utils)@\spxentry{grab\_interior\_points()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.grab_interior_points}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{grab\_interior\_points}}}{\emph{xml\_file}, \emph{img\_size}, \emph{annotations={[}{]}}}{}
Deprecated.
\end{fulllineitems}
\index{image2coords() (in module pathflowai.utils)@\spxentry{image2coords()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.image2coords}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{image2coords}}}{\emph{image\_file}, \emph{output\_point=False}}{}
Deprecated.
\end{fulllineitems}
\index{images2coord\_dict() (in module pathflowai.utils)@\spxentry{images2coord\_dict()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.images2coord_dict}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{images2coord\_dict}}}{\emph{images}, \emph{output\_point=False}}{}
Deprecated
\end{fulllineitems}
\index{img2npy\_() (in module pathflowai.utils)@\spxentry{img2npy\_()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.img2npy_}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{img2npy\_}}}{\emph{input\_dir}, \emph{basename}, \emph{svs\_file}}{}
Convert SVS, TIF, TIFF to NPY.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{input\_dir:str}}] \leavevmode
Output file dir.
\item[{\sphinxstylestrong{basename:str}}] \leavevmode
Basename of output file
\item[{\sphinxstylestrong{svs\_file:str}}] \leavevmode
SVS, TIF, TIFF file input.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{str}] \leavevmode
NPY output file.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{is\_coords\_in\_box() (in module pathflowai.utils)@\spxentry{is\_coords\_in\_box()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.is_coords_in_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{is\_coords\_in\_box}}}{\emph{coords}, \emph{patch\_size}, \emph{boxes}}{}
Get area of annotation in patch.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{coords:array}}] \leavevmode
X,Y coordinates of patch.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size.
\item[{\sphinxstylestrong{boxes:list}}] \leavevmode
Shapely objects for annotations.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{float}] \leavevmode
Area of annotation type.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{is\_image\_in\_boxes() (in module pathflowai.utils)@\spxentry{is\_image\_in\_boxes()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.is_image_in_boxes}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{is\_image\_in\_boxes}}}{\emph{image\_coord\_dict}, \emph{boxes}}{}
Find if image intersects with annotations.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{image\_coord\_dict:dict}}] \leavevmode
Dictionary of patches.
\item[{\sphinxstylestrong{boxes:list}}] \leavevmode
Shapely annotation shapes.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dict}] \leavevmode
Dictionary of whether image intersects with any of the annotations.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{is\_valid\_patch() (in module pathflowai.utils)@\spxentry{is\_valid\_patch()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.is_valid_patch}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{is\_valid\_patch}}}{\emph{xs}, \emph{ys}, \emph{patch\_size}, \emph{purple\_mask}, \emph{intensity\_threshold}, \emph{threshold=0.5}}{}
Deprecated, computes whether patch is valid.
\end{fulllineitems}
\index{load\_dataset() (in module pathflowai.utils)@\spxentry{load\_dataset()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.load_dataset}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{load\_dataset}}}{\emph{in\_zarr}, \emph{in\_pkl}}{}
Load ZARR image and annotations pickle.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{in\_zarr:str}}] \leavevmode
Input image.
\item[{\sphinxstylestrong{in\_pkl:str}}] \leavevmode
Input annotations.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dask.array}] \leavevmode
Image array.
\item[{dict}] \leavevmode
Annotations dictionary.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{load\_image() (in module pathflowai.utils)@\spxentry{load\_image()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.load_image}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{load\_image}}}{\emph{svs\_file}}{}
Load SVS, TIF, TIFF
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{svs\_file:type}}] \leavevmode
Description of parameter \sphinxtitleref{svs\_file}.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{type}] \leavevmode
Description of returned object.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{load\_process\_image() (in module pathflowai.utils)@\spxentry{load\_process\_image()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.load_process_image}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{load\_process\_image}}}{\emph{svs\_file}, \emph{xml\_file=None}, \emph{npy\_mask=None}, \emph{annotations={[}{]}}}{}
Load SVS-like image (including NPY), segmentation/classification annotations, generate dask array and dictionary of annotations.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{svs\_file:str}}] \leavevmode
Image file
\item[{\sphinxstylestrong{xml\_file:str}}] \leavevmode
Annotation file.
\item[{\sphinxstylestrong{npy\_mask:array}}] \leavevmode
Numpy segmentation mask.
\item[{\sphinxstylestrong{annotations:list}}] \leavevmode
List of annotations in xml.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{array}] \leavevmode
Dask array of image.
\item[{dict}] \leavevmode
Annotation masks.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{load\_sql\_df() (in module pathflowai.utils)@\spxentry{load\_sql\_df()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.load_sql_df}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{load\_sql\_df}}}{\emph{sql\_file}, \emph{patch\_size}}{}
Load pandas dataframe from SQL, accessing particular patch size within SQL.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{sql\_file:str}}] \leavevmode
SQL db.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dataframe}] \leavevmode
Patch level information.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\begin{fulllineitems}
\pysigline{\sphinxbfcode{\sphinxupquote{modify\_patch\_info(input\_info\_db='patch\_info.db',~slide\_labels=Empty~DataFrame}}}\pysigline{\sphinxbfcode{\sphinxupquote{Columns:~{[}{]}}}}\pysigline{\sphinxbfcode{\sphinxupquote{Index:~{[}{]},~pos\_annotation\_class='{'},~patch\_size=224,~segmentation=False,~other\_annotations={[}{]},~target\_segmentation\_class=-1,~target\_threshold=0.0,~classify\_annotations=False)}}}
Modify the patch information to get ready for deep learning, incorporate whole slide labels if needed.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{input\_info\_db:str}}] \leavevmode
SQL DB file.
\item[{\sphinxstylestrong{slide\_labels:dataframe}}] \leavevmode
Dataframe with whole slide labels.
\item[{\sphinxstylestrong{pos\_annotation\_class:str}}] \leavevmode
Tissue/annotation label to label with whole slide image label, if not supplied, any slide’s patches receive the whole slide label.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size.
\item[{\sphinxstylestrong{segmentation:bool}}] \leavevmode
Segmentation?
\item[{\sphinxstylestrong{other\_annotations:list}}] \leavevmode
Other annotations to access from patch information.
\item[{\sphinxstylestrong{target\_segmentation\_class:int}}] \leavevmode
Segmentation class to threshold.
\item[{\sphinxstylestrong{target\_threshold:float}}] \leavevmode
Include patch if patch has target area greater than this.
\item[{\sphinxstylestrong{classify\_annotations:bool}}] \leavevmode
Classifying annotations for pretraining, or final model?
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dataframe}] \leavevmode
Modified patch information.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{npy2da() (in module pathflowai.utils)@\spxentry{npy2da()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.npy2da}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{npy2da}}}{\emph{npy\_file}}{}
Numpy to dask array.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{npy\_file:str}}] \leavevmode
Input npy file.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dask.array}] \leavevmode
Converted numpy array to dask.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{parse\_coord\_return\_boxes() (in module pathflowai.utils)@\spxentry{parse\_coord\_return\_boxes()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.parse_coord_return_boxes}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{parse\_coord\_return\_boxes}}}{\emph{xml\_file}, \emph{annotation\_name=''}, \emph{return\_coords=False}}{}
Get list of shapely objects for each annotation in the XML object.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{xml\_file:str}}] \leavevmode
Annotation file.
\item[{\sphinxstylestrong{annotation\_name:str}}] \leavevmode
Name of xml annotation.
\item[{\sphinxstylestrong{return\_coords:bool}}] \leavevmode
Just return list of coords over shapes.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{list}] \leavevmode
List of shapely objects.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{process\_svs() (in module pathflowai.utils)@\spxentry{process\_svs()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.process_svs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{process\_svs}}}{\emph{svs\_file}, \emph{xml\_file}, \emph{annotations={[}{]}}, \emph{output\_dir='./'}}{}
Store images into npy format and store annotations into pickle dictionary.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{svs\_file:str}}] \leavevmode
Image file.
\item[{\sphinxstylestrong{xml\_file:str}}] \leavevmode
Annotations file.
\item[{\sphinxstylestrong{annotations:list}}] \leavevmode
List of annotations in image.
\item[{\sphinxstylestrong{output\_dir:str}}] \leavevmode
Output directory.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{retain\_images() (in module pathflowai.utils)@\spxentry{retain\_images()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.retain_images}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{retain\_images}}}{\emph{image\_dir}, \emph{xml\_file}, \emph{annotation=''}}{}
Deprecated
\end{fulllineitems}
\index{return\_image\_coord() (in module pathflowai.utils)@\spxentry{return\_image\_coord()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.return_image_coord}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{return\_image\_coord}}}{\emph{nx=0}, \emph{ny=0}, \emph{xl=3333}, \emph{yl=3333}, \emph{xi=0}, \emph{yi=0}, \emph{xc=3}, \emph{yc=3}, \emph{dimx=224}, \emph{dimy=224}, \emph{output\_point=False}}{}
Deprecated
\end{fulllineitems}
\index{return\_image\_in\_boxes\_dict() (in module pathflowai.utils)@\spxentry{return\_image\_in\_boxes\_dict()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.return_image_in_boxes_dict}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{return\_image\_in\_boxes\_dict}}}{\emph{image\_dir}, \emph{xml\_file}, \emph{annotation=''}}{}
Deprecated
\end{fulllineitems}
\index{run\_preprocessing\_pipeline() (in module pathflowai.utils)@\spxentry{run\_preprocessing\_pipeline()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.run_preprocessing_pipeline}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{run\_preprocessing\_pipeline}}}{\emph{svs\_file}, \emph{xml\_file=None}, \emph{npy\_mask=None}, \emph{annotations={[}{]}}, \emph{out\_zarr='output\_zarr.zarr'}, \emph{out\_pkl='output.pkl'}}{}
Run preprocessing pipeline. Store image into zarr format, segmentations maintain as npy, and xml annotations as pickle.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{svs\_file:str}}] \leavevmode
Input image file.
\item[{\sphinxstylestrong{xml\_file:str}}] \leavevmode
Input annotation file.
\item[{\sphinxstylestrong{npy\_mask:str}}] \leavevmode
NPY segmentation mask.
\item[{\sphinxstylestrong{annotations:list}}] \leavevmode
List of annotations.
\item[{\sphinxstylestrong{out\_zarr:str}}] \leavevmode
Output zarr for image.
\item[{\sphinxstylestrong{out\_pkl:str}}] \leavevmode
Output pickle for annotations.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{save\_all\_patch\_info() (in module pathflowai.utils)@\spxentry{save\_all\_patch\_info()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.save_all_patch_info}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{save\_all\_patch\_info}}}{\emph{basenames}, \emph{input\_dir='./'}, \emph{annotations={[}{]}}, \emph{threshold=0.5}, \emph{patch\_size=224}, \emph{output\_pkl='patch\_info.pkl'}}{}
Deprecated.
\end{fulllineitems}
\index{save\_dataset() (in module pathflowai.utils)@\spxentry{save\_dataset()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.save_dataset}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{save\_dataset}}}{\emph{arr}, \emph{masks}, \emph{out\_zarr}, \emph{out\_pkl}}{}
Saves dask array image, dictionary of annotations to zarr and pickle respectively.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{arr:array}}] \leavevmode
Image.
\item[{\sphinxstylestrong{masks:dict}}] \leavevmode
Dictionary of annotation shapes.
\item[{\sphinxstylestrong{out\_zarr:str}}] \leavevmode
Zarr output file for image.
\item[{\sphinxstylestrong{out\_pkl:str}}] \leavevmode
Pickle output file.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{segmentation\_predictions2npy() (in module pathflowai.utils)@\spxentry{segmentation\_predictions2npy()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.segmentation_predictions2npy}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{segmentation\_predictions2npy}}}{\emph{y\_pred}, \emph{patch\_info}, \emph{segmentation\_map}, \emph{npy\_output}}{}
Convert segmentation predictions from model to numpy masks.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{y\_pred:list}}] \leavevmode
List of patch segmentation masks
\item[{\sphinxstylestrong{patch\_info:dataframe}}] \leavevmode
Patch information from DB.
\item[{\sphinxstylestrong{segmentation\_map:array}}] \leavevmode
Existing segmentation mask.
\item[{\sphinxstylestrong{npy\_output:str}}] \leavevmode
Output npy file.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{svs2dask\_array() (in module pathflowai.utils)@\spxentry{svs2dask\_array()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.svs2dask_array}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{svs2dask\_array}}}{\emph{svs\_file}, \emph{tile\_size=1000}, \emph{overlap=0}, \emph{remove\_last=True}, \emph{allow\_unknown\_chunksizes=False}}{}
Convert SVS, TIF or TIFF to dask array.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{svs\_file:str}}] \leavevmode
Image file.
\item[{\sphinxstylestrong{tile\_size:int}}] \leavevmode
Size of chunk to be read in.
\item[{\sphinxstylestrong{overlap:int}}] \leavevmode
Do not modify, overlap between neighboring tiles.
\item[{\sphinxstylestrong{remove\_last:bool}}] \leavevmode
Remove last tile because it has a custom size.
\item[{\sphinxstylestrong{allow\_unknown\_chunksizes: bool}}] \leavevmode
Allow different chunk sizes, more flexible, but slowdown.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dask.array}] \leavevmode
Dask Array.
\end{description}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{arr}\PYG{o}{=}\PYG{n}{svs2dask\PYGZus{}array}\PYG{p}{(}\PYG{n}{svs\PYGZus{}file}\PYG{p}{,} \PYG{n}{tile\PYGZus{}size}\PYG{o}{=}\PYG{l+m+mi}{1000}\PYG{p}{,} \PYG{n}{overlap}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{remove\PYGZus{}last}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{,} \PYG{n}{allow\PYGZus{}unknown\PYGZus{}chunksizes}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{)}
\PYG{g+go}{ ..}
\end{sphinxVerbatim}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{arr2}\PYG{o}{=}\PYG{n}{arr}\PYG{o}{.}\PYG{n}{compute}\PYG{p}{(}\PYG{p}{)}
\PYG{g+go}{ ..}
\end{sphinxVerbatim}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{arr3}\PYG{o}{=}\PYG{n}{to\PYGZus{}pil}\PYG{p}{(}\PYG{n}{cv2}\PYG{o}{.}\PYG{n}{resize}\PYG{p}{(}\PYG{n}{arr2}\PYG{p}{,} \PYG{n}{dsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{1440}\PYG{p}{,}\PYG{l+m+mi}{700}\PYG{p}{)}\PYG{p}{,} \PYG{n}{interpolation}\PYG{o}{=}\PYG{n}{cv2}\PYG{o}{.}\PYG{n}{INTER\PYGZus{}CUBIC}\PYG{p}{)}\PYG{p}{)}
\PYG{g+go}{ ..}
\end{sphinxVerbatim}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{arr3}\PYG{o}{.}\PYG{n}{save}\PYG{p}{(}\PYG{n}{test\PYGZus{}image\PYGZus{}name}\PYG{p}{)}
\PYG{g+go}{ ..}
\end{sphinxVerbatim}
\end{description}\end{quote}
\end{fulllineitems}
\chapter{Indices and tables}
\label{\detokenize{index:indices-and-tables}}\begin{itemize}
\item {}
\DUrole{xref,std,std-ref}{genindex}
\item {}
\DUrole{xref,std,std-ref}{modindex}
\item {}
\DUrole{xref,std,std-ref}{search}
\end{itemize}
\renewcommand{\indexname}{Python Module Index}
\begin{sphinxtheindex}
\let\bigletter\sphinxstyleindexlettergroup
\bigletter{p}
\item\relax\sphinxstyleindexentry{pathflowai.datasets}\sphinxstyleindexpageref{index:\detokenize{module-pathflowai.datasets}}
\item\relax\sphinxstyleindexentry{pathflowai.losses}\sphinxstyleindexpageref{index:\detokenize{module-pathflowai.losses}}
\item\relax\sphinxstyleindexentry{pathflowai.sampler}\sphinxstyleindexpageref{index:\detokenize{module-pathflowai.sampler}}
\item\relax\sphinxstyleindexentry{pathflowai.schedulers}\sphinxstyleindexpageref{index:\detokenize{module-pathflowai.schedulers}}
\item\relax\sphinxstyleindexentry{pathflowai.utils}\sphinxstyleindexpageref{index:\detokenize{module-pathflowai.utils}}
\item\relax\sphinxstyleindexentry{pathflowai.visualize}\sphinxstyleindexpageref{index:\detokenize{module-pathflowai.visualize}}
\end{sphinxtheindex}
\renewcommand{\indexname}{Index}
\printindex
\end{document}