Skip to content

Commit

Permalink
Update Doxygen to
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Actions bot for SimpleITK.github.io committed Aug 18, 2024
1 parent d0c858d commit 2140830
Show file tree
Hide file tree
Showing 12 changed files with 337 additions and 326 deletions.
77 changes: 39 additions & 38 deletions doxygen/latest/html/Python_2BoarderSegmentation_8py-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,45 +87,46 @@
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment">#</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"># =========================================================================</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160; </div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160; </div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="keyword">import</span> sys</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="keyword">import</span> SimpleITK <span class="keyword">as</span> sitk</div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="stringliteral">&quot;&quot;&quot; An example script demonstrating boarder segmentation in SimpleITK. &quot;&quot;&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160; </div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="keyword">import</span> sys</div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="keyword">import</span> os</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="comment"># verify that we have the correct number of arguments</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="keywordflow">if</span> len(sys.argv) != 5:</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; sys.stderr.write(<span class="stringliteral">&quot;Usage: prog inputFile outputFile replaceValue upperThreshold\n&quot;</span>)</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; exit(1)</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="comment"># copy the arguments in to variables</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;inputFileName = sys.argv[1]</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;outputFileName = sys.argv[2]</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;replaceValue = int(sys.argv[3])</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;upperThreshold = float(sys.argv[4])</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="comment"># Read the file into an sitkImage</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;image = <a class="code" href="namespaceitk_1_1simple.html#a5e2d8cb994e585790c0bb1a1dd816adc">sitk.ReadImage</a>(inputFileName)</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="comment"># Threshold the value [0,2), results in values inside the range 1, 0 otherwise</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;boundary = <a class="code" href="namespaceitk_1_1simple.html#a9422e1bef3de9588cc00f94666cff7b7">sitk.BinaryThreshold</a>(image, 0, upperThreshold, 1, 0)</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; </div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;boundary = <a class="code" href="namespaceitk_1_1simple.html#a37461020f4b83ab083d010ba3b641ede">sitk.BinaryMorphologicalClosing</a>(boundary, [1] * image.GetDimension())</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; </div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="comment"># Remove any label pixel not connected to the boarder</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;boundary = <a class="code" href="namespaceitk_1_1simple.html#a57affa9aef810811b3a078f64a98ca98">sitk.BinaryGrindPeak</a>(boundary)</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;boundary = <a class="code" href="namespaceitk_1_1simple.html#af8c9d7cc96a299a05890e9c3db911885">sitk.Cast</a>(boundary, image.GetPixelID())</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; </div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="comment"># Multiply, the input image by not the boarder.</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="comment"># This will multiply the image by 0 or 1, where 0 is the</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="comment"># boarder. Making the board 0</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;image = image * ~boundary</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; </div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;<span class="comment"># add the replace value to the pixel on the board</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;image = image + (boundary * replaceValue)</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; </div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="keywordflow">if</span> <span class="stringliteral">&quot;SITK_NOSHOW&quot;</span> <span class="keywordflow">not</span> <span class="keywordflow">in</span> os.environ:</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <a class="code" href="namespaceitk_1_1simple.html#a86cb9e226d455efca3ba034dc2154605">sitk.Show</a>(image, <span class="stringliteral">&quot;Boarder Segmentation&quot;</span>)</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="keyword">import</span> SimpleITK <span class="keyword">as</span> sitk</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="comment"># verify that we have the correct number of arguments</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="keywordflow">if</span> len(sys.argv) != 5:</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; sys.stderr.write(<span class="stringliteral">&quot;Usage: {sys.argv[0]} inputFile outputFile replaceValue upperThreshold\n&quot;</span>)</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; sys.exit(1)</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="comment"># copy the arguments in to variables</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;inputFileName = sys.argv[1]</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;outputFileName = sys.argv[2]</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;replaceValue = int(sys.argv[3])</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;upperThreshold = float(sys.argv[4])</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; </div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="comment"># Read the file into an sitkImage</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;image = <a class="code" href="namespaceitk_1_1simple.html#a5e2d8cb994e585790c0bb1a1dd816adc">sitk.ReadImage</a>(inputFileName)</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; </div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="comment"># Threshold the value [0,2), results in values inside the range 1, 0 otherwise</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;boundary = <a class="code" href="namespaceitk_1_1simple.html#a9422e1bef3de9588cc00f94666cff7b7">sitk.BinaryThreshold</a>(image, 0, upperThreshold, 1, 0)</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; </div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;boundary = <a class="code" href="namespaceitk_1_1simple.html#a37461020f4b83ab083d010ba3b641ede">sitk.BinaryMorphologicalClosing</a>(boundary, [1] * image.GetDimension())</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="comment"># Remove any label pixel not connected to the boarder</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;boundary = <a class="code" href="namespaceitk_1_1simple.html#a57affa9aef810811b3a078f64a98ca98">sitk.BinaryGrindPeak</a>(boundary)</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; </div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;boundary = <a class="code" href="namespaceitk_1_1simple.html#af8c9d7cc96a299a05890e9c3db911885">sitk.Cast</a>(boundary, image.GetPixelID())</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="comment"># Multiply, the input image by not the boarder.</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="comment"># This will multiply the image by 0 or 1, where 0 is the</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;<span class="comment"># boarder. Making the board 0</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;image = image * ~boundary</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; </div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="comment"># add the replace value to the pixel on the board</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;image = image + (boundary * replaceValue)</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; </div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="keywordflow">if</span> <span class="stringliteral">&quot;SITK_NOSHOW&quot;</span> <span class="keywordflow">not</span> <span class="keywordflow">in</span> os.environ:</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <a class="code" href="namespaceitk_1_1simple.html#a86cb9e226d455efca3ba034dc2154605">sitk.Show</a>(image, <span class="stringliteral">&quot;Boarder Segmentation&quot;</span>)</div>
</div><!-- fragment --> </div><!-- contents -->
<div class="ttc" id="anamespaceitk_1_1simple_html_a9422e1bef3de9588cc00f94666cff7b7"><div class="ttname"><a href="namespaceitk_1_1simple.html#a9422e1bef3de9588cc00f94666cff7b7">itk::simple::BinaryThreshold</a></div><div class="ttdeci">Image BinaryThreshold(const Image &amp;image1, double lowerThreshold=0.0, double upperThreshold=255.0, uint8_t insideValue=1u, uint8_t outsideValue=0u)</div><div class="ttdoc">Binarize an input image by thresholding.</div></div>
<div class="ttc" id="anamespaceitk_1_1simple_html_a86cb9e226d455efca3ba034dc2154605"><div class="ttname"><a href="namespaceitk_1_1simple.html#a86cb9e226d455efca3ba034dc2154605">itk::simple::Show</a></div><div class="ttdeci">void SITKIO_EXPORT Show(const Image &amp;image, const std::string &amp;title=&quot;&quot;, const bool debugOn=ProcessObject::GetGlobalDefaultDebug())</div></div>
Expand Down
37 changes: 19 additions & 18 deletions doxygen/latest/html/Python_2CannyEdge_8py-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,26 +87,27 @@
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment">#</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"># =========================================================================</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160; </div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160; </div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="keyword">import</span> SimpleITK <span class="keyword">as</span> sitk</div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="stringliteral">&quot;&quot;&quot; An example script demonstrating Canny Edge Detection in SimpleITK. &quot;&quot;&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160; </div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="keyword">import</span> sys</div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="keyword">import</span> os</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="keywordflow">if</span> len(sys.argv) &lt; 2:</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; print(<span class="stringliteral">&quot;Usage: %s &lt;input&gt;&quot;</span> % (sys.argv[0]))</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; sys.exit(1)</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; </div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;image = <a class="code" href="namespaceitk_1_1simple.html#af8c9d7cc96a299a05890e9c3db911885">sitk.Cast</a>(<a class="code" href="namespaceitk_1_1simple.html#a5e2d8cb994e585790c0bb1a1dd816adc">sitk.ReadImage</a>(sys.argv[1]), sitk.sitkFloat32)</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;edges = <a class="code" href="namespaceitk_1_1simple.html#a68b906bdb463b58176a77c126f2ea1d8">sitk.CannyEdgeDetection</a>(</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; image, lowerThreshold=200, upperThreshold=400, variance=[4] * 3</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;)</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; </div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;stats = <a class="code" href="classitk_1_1simple_1_1StatisticsImageFilter.html">sitk.StatisticsImageFilter</a>()</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;stats.Execute(image)</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; </div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="keywordflow">if</span> <span class="stringliteral">&quot;SITK_NOSHOW&quot;</span> <span class="keywordflow">not</span> <span class="keywordflow">in</span> os.environ:</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <a class="code" href="namespaceitk_1_1simple.html#a86cb9e226d455efca3ba034dc2154605">sitk.Show</a>(<a class="code" href="namespaceitk_1_1simple.html#ada989bd1c85d4d71143a79104d54f916">sitk.Maximum</a>(image * 0.5, edges * stats.GetMaximum() * 0.5))</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="keyword">import</span> SimpleITK <span class="keyword">as</span> sitk</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="keywordflow">if</span> len(sys.argv) &lt; 2:</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; print(f<span class="stringliteral">&quot;Usage: {sys.argv[0]} &lt;input&gt;&quot;</span>)</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; sys.exit(1)</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;image = <a class="code" href="namespaceitk_1_1simple.html#af8c9d7cc96a299a05890e9c3db911885">sitk.Cast</a>(<a class="code" href="namespaceitk_1_1simple.html#a5e2d8cb994e585790c0bb1a1dd816adc">sitk.ReadImage</a>(sys.argv[1]), sitk.sitkFloat32)</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; </div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;edges = <a class="code" href="namespaceitk_1_1simple.html#a68b906bdb463b58176a77c126f2ea1d8">sitk.CannyEdgeDetection</a>(</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; image, lowerThreshold=200, upperThreshold=400, variance=[4] * 3</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;)</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;stats = <a class="code" href="classitk_1_1simple_1_1StatisticsImageFilter.html">sitk.StatisticsImageFilter</a>()</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;stats.Execute(image)</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="keywordflow">if</span> <span class="stringliteral">&quot;SITK_NOSHOW&quot;</span> <span class="keywordflow">not</span> <span class="keywordflow">in</span> os.environ:</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <a class="code" href="namespaceitk_1_1simple.html#a86cb9e226d455efca3ba034dc2154605">sitk.Show</a>(<a class="code" href="namespaceitk_1_1simple.html#ada989bd1c85d4d71143a79104d54f916">sitk.Maximum</a>(image * 0.5, edges * stats.GetMaximum() * 0.5))</div>
</div><!-- fragment --> </div><!-- contents -->
<div class="ttc" id="aclassitk_1_1simple_1_1StatisticsImageFilter_html"><div class="ttname"><a href="classitk_1_1simple_1_1StatisticsImageFilter.html">itk::simple::StatisticsImageFilter</a></div><div class="ttdoc">Compute min, max, variance and mean of an Image .</div><div class="ttdef"><b>Definition:</b> <a href="sitkStatisticsImageFilter_8h_source.html#l00045">sitkStatisticsImageFilter.h:45</a></div></div>
<div class="ttc" id="anamespaceitk_1_1simple_html_a86cb9e226d455efca3ba034dc2154605"><div class="ttname"><a href="namespaceitk_1_1simple.html#a86cb9e226d455efca3ba034dc2154605">itk::simple::Show</a></div><div class="ttdeci">void SITKIO_EXPORT Show(const Image &amp;image, const std::string &amp;title=&quot;&quot;, const bool debugOn=ProcessObject::GetGlobalDefaultDebug())</div></div>
Expand Down
Loading

0 comments on commit 2140830

Please sign in to comment.