<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Using mia from Python</title><link>https://sourceforge.net/p/mia/wiki/Using%2520mia%2520from%2520Python/</link><description>Recent changes to Using mia from Python</description><atom:link href="https://sourceforge.net/p/mia/wiki/Using%20mia%20from%20Python/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 09 Jan 2015 17:32:30 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/mia/wiki/Using%20mia%20from%20Python/feed" rel="self" type="application/rss+xml"/><item><title>Using mia from Python modified by Gert Wollny</title><link>https://sourceforge.net/p/mia/wiki/Using%2520mia%2520from%2520Python/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -1,9 +1,9 @@
 ## Using mia from Python

-The name of the module is simply *mia*, hence the is is loaded as 
+The name of the module is simply *pymia* (from pymia &amp;gt;= 1.0.7 on), hence the is is loaded as 

     :::python 
-    import mia
+    import pymia

 The functionality currently exposed to Python  is limited to loading images, running 2D and 3D filters on gray scale image, and running image registration. Within Python the images are represented as numpy arrays, in fact no MIA objects are exposed directly to Python. 

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Gert Wollny</dc:creator><pubDate>Fri, 09 Jan 2015 17:32:30 -0000</pubDate><guid>https://sourceforge.net9b5aa7fa89ddbf8420b4a504a24b2d9c5525698a</guid></item><item><title>Using mia from Python modified by Gert Wollny</title><link>https://sourceforge.net/p/mia/wiki/Using%2520mia%2520from%2520Python/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -8,29 +8,6 @@
 The functionality currently exposed to Python  is limited to loading images, running 2D and 3D filters on gray scale image, and running image registration. Within Python the images are represented as numpy arrays, in fact no MIA objects are exposed directly to Python.

-### Filtering 
-
-The *mia.filter* function transparently distinguishes between 2D and 3D images. Filters are specified as strings like they are given on the [mia-2dimagefilter](http://mia.sourceforge.net/userref/Secmia2dimagefilter.html) and [mia-3dimagefilter](http://mia.sourceforge.net/userref/Secmia3dimagefilter.html) command line.
-
-Filters can be run one at a time, or as a pipeline. To run a single filter, e.g. a *median* filter of *half filter width* 3 on an image *input* run 
-
-    :::python 
-    filtered = mia.filter(input, "median:w=3")
-
-To run a filter chain, e.g. the above median, followed by a *mean-least-variance* filter with a filter width parameter 5, provide the filters as a list: 
-
-    :::python 
-    filtered = mia.filter(input, ["median:w=3", "mlv:w=5"])
-
-Note that the filters function converts the *input* to the internal MIA image format, creates and runs the filters, and then converts the images back to *numpy* arrays. Therefore, for performance reasons, it is best to run the filter chains instead of one filter at a time. 
-
-In order to avoid re-creating filters one can enable the filter cache by calling 
-
-    :::python 
-    mia.set_filter_plugin_cache(True)
-
-Then, filters with the same description are re-used  in subsequent calls to the *mia.filter* function. The filters in MIA normally work like functions, i.e. no state changes when it is called. *However, in some rare cases, when external data is loaded by means of a filter parameter, this may actually not work like expected (cf. [tickets:#134]).*
-
------
-
-[back](Python, loading images) [top](Using mia from Python)  [forward](Python, running image registration)
+* [Python, loading images]
+* [Python, filtering]
+* [Python, image registration]
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Gert Wollny</dc:creator><pubDate>Thu, 12 Dec 2013 14:46:27 -0000</pubDate><guid>https://sourceforge.net8c83ce591bb78e1fdc601a3541441a1930d07744</guid></item><item><title>Using mia from Python modified by Gert Wollny</title><link>https://sourceforge.net/p/mia/wiki/Using%2520mia%2520from%2520Python/</link><description>&lt;div class="markdown_content"&gt;&lt;h2 id="using-mia-from-python"&gt;Using mia from Python&lt;/h2&gt;
&lt;p&gt;The name of the module is simply &lt;em&gt;mia&lt;/em&gt;, hence the is is loaded as &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;mia&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The functionality currently exposed to Python  is limited to loading images, running 2D and 3D filters on gray scale image, and running image registration. Within Python the images are represented as numpy arrays, in fact no MIA objects are exposed directly to Python. &lt;/p&gt;
&lt;h3 id="filtering"&gt;Filtering&lt;/h3&gt;
&lt;p&gt;The &lt;em&gt;mia.filter&lt;/em&gt; function transparently distinguishes between 2D and 3D images. Filters are specified as strings like they are given on the &lt;a class="" href="http://mia.sourceforge.net/userref/Secmia2dimagefilter.html"&gt;mia-2dimagefilter&lt;/a&gt; and &lt;a class="" href="http://mia.sourceforge.net/userref/Secmia3dimagefilter.html"&gt;mia-3dimagefilter&lt;/a&gt; command line.&lt;/p&gt;
&lt;p&gt;Filters can be run one at a time, or as a pipeline. To run a single filter, e.g. a &lt;em&gt;median&lt;/em&gt; filter of &lt;em&gt;half filter width&lt;/em&gt; 3 on an image &lt;em&gt;input&lt;/em&gt; run &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;filtered&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mia&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;median:w=3&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;To run a filter chain, e.g. the above median, followed by a &lt;em&gt;mean-least-variance&lt;/em&gt; filter with a filter width parameter 5, provide the filters as a list: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;filtered&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mia&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;median:w=3&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;mlv:w=5&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note that the filters function converts the &lt;em&gt;input&lt;/em&gt; to the internal MIA image format, creates and runs the filters, and then converts the images back to &lt;em&gt;numpy&lt;/em&gt; arrays. Therefore, for performance reasons, it is best to run the filter chains instead of one filter at a time. &lt;/p&gt;
&lt;p&gt;In order to avoid re-creating filters one can enable the filter cache by calling &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;mia&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_filter_plugin_cache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then, filters with the same description are re-used  in subsequent calls to the &lt;em&gt;mia.filter&lt;/em&gt; function. The filters in MIA normally work like functions, i.e. no state changes when it is called. &lt;em&gt;However, in some rare cases, when external data is loaded by means of a filter parameter, this may actually not work like expected (cf. &lt;a class="alink" href="/p/mia/tickets/134/"&gt;[tickets:#134]&lt;/a&gt;).&lt;/em&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;a class="" href="../Python,%20loading%20images"&gt;back&lt;/a&gt; &lt;a class="" href="/p/mia/wiki/Using%20mia%20from%20Python/"&gt;top&lt;/a&gt; &lt;a class="" href="../Python,%20running%20image%20registration"&gt;forward&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Gert Wollny</dc:creator><pubDate>Thu, 12 Dec 2013 12:48:17 -0000</pubDate><guid>https://sourceforge.net396b884492e36d1652f2db0eb90190e11452f6ed</guid></item></channel></rss>