<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DkcEQHo6fCp7ImA9WhRaF0g.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764</id><updated>2012-02-20T10:06:41.414-06:00</updated><category term="Mimics" /><category term="visualization" /><category term="DICOM" /><category term="ezDICOM" /><category term="three variable graph" /><category term="django ajax json javascript" /><category term="counting" /><category term="xargs" /><category term="storage" /><category term="ffmpeg" /><category term="modules" /><category term="django" /><category term="spellcheck" /><category term="mplayer" /><category term="Programming" /><category term="matlab" /><category term="make" /><category term="numpy" /><category term="Osirix" /><category term="ImageMagick" /><category term="python" /><category term="Magick++" /><category term="scipy" /><category term="unix" /><category term="Linux" /><category term="html" /><category term="script" /><category term="fem" /><category term="makefile" /><category term="MevisLab" /><category term="abaqus" /><category term="image processing" /><category term="correlation" /><category term="OCR" /><category term="ImageJ" /><category term="beautifulsoup" /><category term="tesseract" /><category term="modulefiles" /><title>Images &amp; Visualization</title><subtitle type="html">Blog on multiple topics in Image Processing and Visualization and anything else not connected.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://imageviz.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/imageviz" /><feedburner:info uri="imageviz" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;AkcNSHc-fCp7ImA9WhRaFU8.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-8701242183053563866</id><published>2012-02-17T19:14:00.001-06:00</published><updated>2012-02-17T19:21:39.954-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-17T19:21:39.954-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="image processing" /><category scheme="http://www.blogger.com/atom/ns#" term="scipy" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="numpy" /><title>Under-graduate education in Image processing</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;SURVEY URL: &lt;a href="http://goo.gl/ORDDz"&gt;&amp;nbsp;http://goo.gl/ORDDz&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal" style="text-align: justify;"&gt;
Image acquisition and processing
have become a standard method for qualifying and quantifying experimental
measurements in various Science Technology Engineering and Mathematics (STEM)
disciplines.&amp;nbsp; Discoveries have been
made possible in medical sciences by advances in diagnostic imaging such as
x-ray based computed tomography (CT) and magnetic resonance imaging (MRI).&amp;nbsp; Biological and cellular functions have
been revealed with new imaging techniques in light based microscopy.&amp;nbsp; Advancements in material sciences have
been aided by electron microscopy analysis of nanoparticles.&amp;nbsp;&amp;nbsp;&amp;nbsp; All these examples and many
more require both knowledge of the physical methods to obtain images and the
analytical processing methods to understand the science behind the images.&amp;nbsp;&lt;/div&gt;
&lt;div class="MsoNormal" style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="text-align: justify;"&gt;
Imaging technology continues to advance
with new modalities and methods available to students and researchers in STEM
disciplines. &amp;nbsp;Thus, a course in image acquisition and processing would have
broad appeal across the STEM disciplines and be useful for transforming
undergraduate and graduate curriculum to better prepare students for their
future.&lt;/div&gt;
&lt;div class="MsoNormal" style="text-align: justify;"&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
Image analysis is an
extraordinarily practical technique that need not be limited to highly
analytical individuals with a math and engineering background.&amp;nbsp; Since researchers in biology, medicine,
and chemistry along with students and scientists from mathematics, physics and
various engineering fields use these techniques regularly; there is a need for
a course that provides a gradual introduction to both acquisition and processing.&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
Such a course will prepare students in the common image acquisition techniques like CT, MRI, light &amp;nbsp;microscope and electron&amp;nbsp;microscope. &amp;nbsp; It will also introduce the practical aspects of image acquisition such as noise, resolution etc. &amp;nbsp;The students will also be programming image processing using&lt;a href="http://python.org/"&gt; Python &lt;/a&gt;as a part of the curriculum. &amp;nbsp;They will be introduced to python modules such as &lt;a href="http://numpy.scipy.org/"&gt;numpy&lt;/a&gt; and &lt;a href="http://scipy.org/"&gt;scipy&lt;/a&gt;. &amp;nbsp; They will learn the&amp;nbsp;various image processing operations like segmentation, morphological operations, measurements and visualization.&lt;br /&gt;
&lt;br /&gt;
We wanted our understanding of this need with the data collected from surveying people interested in image processing or people who wish that they had such a course during their senior year in under-graduate or in graduate school. &amp;nbsp; We created a &lt;a href="http://goo.gl/ORDDz"&gt;survey&lt;/a&gt; to obtain your feedback. &amp;nbsp;&amp;nbsp;&amp;nbsp;It will take only a minute of your time. &amp;nbsp;&amp;nbsp;We request that you fill as much information as you can. &amp;nbsp;Please&amp;nbsp;forward this URL or this blogpost to your friends as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-8701242183053563866?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/8701242183053563866/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=8701242183053563866" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/8701242183053563866?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/8701242183053563866?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/oxeQpwK1ypQ/under-graduate-education-in-image.html" title="Under-graduate education in Image processing" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><georss:featurename>Minneapolis, MN 55421, USA</georss:featurename><georss:point>45.0563001 -93.2599459</georss:point><georss:box>45.0338666 -93.29942790000001 45.0787336 -93.2204639</georss:box><feedburner:origLink>http://imageviz.blogspot.com/2012/02/under-graduate-education-in-image.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck8CQn8ycSp7ImA9WhRaEUg.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-2594632732130239519</id><published>2012-02-12T21:37:00.003-06:00</published><updated>2012-02-13T10:34:23.199-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-13T10:34:23.199-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Programming" /><category scheme="http://www.blogger.com/atom/ns#" term="image processing" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Python modules for scientific image processing</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span id="internal-source-marker_0.9473421797156334" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: #222222; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;Recently my friend, Nick Labello working at University of Chicago performed a large scale, large data image processing. &amp;nbsp;It took one week to process the data acquired over 12 hours. &amp;nbsp;The program was written in Matlab and was run on a desktop.  If the processing time needs to be reduced, the best course of action is to parallelize the program and run it on multiple cores / nodes. &amp;nbsp;Matlab parallelization can be expensive as it is closed-source commercial software. &amp;nbsp;Python on the other hand is free and open-source and hence can be parallelized to large number of cores. &amp;nbsp;Python also has parallelization modules like mpi4py that eases the task. &amp;nbsp;With a clear choice of programming language, Nick worked on evaluating the various python modules. &amp;nbsp;The chosen python module was used to rewrite the Matlab program. &amp;nbsp;&amp;nbsp;Specifically, he reviewed the following&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #222222; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol style="font-weight: bold;"&gt;&lt;span id="internal-source-marker_0.9473421797156334" style="font-family: Arial, Helvetica, sans-serif;"&gt;
&lt;li style="color: #222222; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;Numpy&lt;/span&gt;&lt;/li&gt;
&lt;li style="color: #222222; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;Scipy&lt;/span&gt;&lt;/li&gt;
&lt;li style="color: #222222; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="white-space: pre-wrap;"&gt;Pymorph&lt;/span&gt;&lt;/li&gt;
&lt;li style="color: #222222; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;Mahotas&lt;/span&gt;&lt;/li&gt;
&lt;li style="color: #222222; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;Scikits-image &lt;/span&gt;&lt;/li&gt;
&lt;li style="color: #222222; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;Python Imaging Library (PIL)&lt;/span&gt;&lt;/li&gt;
&lt;/span&gt;&lt;/ol&gt;
&lt;span id="internal-source-marker_0.9473421797156334" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: #222222; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;Nick’s view on the various modules along with some of my view is given below. &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #222222; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #222222; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;b&gt;&lt;a href="http://numpy.scipy.org/"&gt;Numpy&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #222222; font-family: Arial, Helvetica, sans-serif; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: #222222; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;It &lt;/span&gt;&lt;span style="color: #222222; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;do&lt;/span&gt;&lt;span style="color: #222222; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;esn't actually give you any image processing capabilities, but all of the image processing libraries rely on Numpy arrays to store the image data. &amp;nbsp;As a happy result, it is trivial to bounce between all of the different image processing libraries in the code because they all read and write the same datatype.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: #222222;"&gt;&lt;span style="white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://scipy.org/" style="font-weight: bold; white-space: pre-wrap;"&gt;Scipy NDImage &lt;/a&gt;&lt;b style="color: #222222; white-space: pre-wrap;"&gt; &lt;/b&gt;&lt;span style="white-space: pre-wrap;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #222222; font-family: Arial, Helvetica, sans-serif; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #222222; font-family: Arial, Helvetica, sans-serif; white-space: pre-wrap;"&gt;It provides a stable, solid, easy to use very basic functionality (erosion, dilation, etc..). &amp;nbsp;&amp;nbsp;&amp;nbsp;It is missing a lot of the more advanced functions you might find in Matlab such as functions to find endpoints, perimeter pixels, etc. &amp;nbsp;These must be pieced together from elementary operations. &amp;nbsp;The documentation for NDImage is NOT very good for new users. &amp;nbsp;I had a hard time with it at first. &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: #222222; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #222222; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;a href="http://www.mmorph.com/pymorph/"&gt;PyMorph&lt;/a&gt;&lt;/span&gt;&lt;span style="color: #222222; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;a href="http://luispedro.org/software/pymorph"&gt;&amp;nbsp;&lt;/a&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: #222222; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;It has lots of image processing functions that do not rely on anything but Numpy. &amp;nbsp;It does not depend on Scipy. &amp;nbsp;It provides a python only library. &amp;nbsp;A second interesting thing about PyMorph is that it has quite a lot of functionality compared to the other libraries. &amp;nbsp;Unfortunately, since it is written in Python, it is hundreds of times slower than Scipy and the other libraries. &amp;nbsp;This will become an issue for advanced image processing users. &lt;/span&gt;&lt;br /&gt;&lt;a href="http://luispedro.org/software/pymorph" style="font-weight: bold;"&gt;&lt;span style="color: #1155cc; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://luispedro.org/software/pymorph" style="font-weight: bold;"&gt;&lt;span style="color: #1155cc; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color: #222222; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;a href="http://luispedro.org/software/mahotas"&gt;Mahotas&lt;/a&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: Arial, Helvetica, sans-serif; line-height: 18px; text-align: -webkit-auto; white-space: pre-wrap;"&gt;It provides only the most basic functions, but blazing fast, and, in my experience, twice as fast as the equivalent functions in Scipy.&lt;/span&gt;&lt;br /&gt;
&lt;a href="http://luispedro.org/software/mahotas" style="font-weight: bold;"&gt;&lt;span style="color: #1155cc; font-family: Arial, Helvetica, sans-serif; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: #222222; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;a href="http://scikits-image.org/"&gt;Scikits-Image&lt;/a&gt;&lt;/span&gt;&lt;span style="color: #222222; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;  &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="color: #222222; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;It picks up where Scipy leaves off and offers quite a few functions not found in Scipy.&lt;/span&gt;&lt;br /&gt;&lt;a href="http://scikits-image.org/" style="font-weight: bold;"&gt;&lt;span style="color: #1155cc; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color: #222222; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;a href="http://www.pythonware.com/products/pil/"&gt;Python Imaging Library&lt;/a&gt; (PIL) &lt;/span&gt;&lt;span style="color: #222222; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt; &lt;/span&gt;&lt;span style="color: #222222; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;It is free to use but is not open-source. &amp;nbsp;It has very few image processing algorithms and not necessarily useful for scientific imaging.&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #222222;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;a href="http://enthought.com/products/epd.php"&gt;Enthought&lt;/a&gt;   &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;It is __not__ an image processing library. &amp;nbsp;It is a python distribution ready for scientific programming. &amp;nbsp;It has over 100 scientific packages pre-installed, and is compiled against fast MKL/BLAS. &amp;nbsp;My tests were a little bit faster in Enthought-python than the regular Python by 2-3%. &amp;nbsp;Your mileage may vary. &amp;nbsp;The big advantage, though, is that it has everything I need except Mahotas and PyMorph. &amp;nbsp;Also, Mahotas installs easily on Enthought, whereas it was difficult on the original python installation, due to various dependencies.  Enthought is free for students and employees of Universities and Colleges.  Others need to pay for the service.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;i&gt;Ravi's view: &lt;/i&gt; Personally, I do not have much problem installing python modules to regular python interpreter.  The only time it becomes difficult is installing scientific packages like Scipy that have numerous dependencies like Boost libraries.  Readymade binary packages do eliminate the installation steps but are not necessarily well tuned for optimal performance.  Enthought is a great alternative that is as easy to install and yet optimized for performance.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-2594632732130239519?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/2594632732130239519/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=2594632732130239519" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/2594632732130239519?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/2594632732130239519?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/Dj6_CepDPbo/python-modules-for-scientific-image.html" title="Python modules for scientific image processing" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2012/02/python-modules-for-scientific-image.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE8HQXo_fCp7ImA9WhRaEUk.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-7057339051094118785</id><published>2012-02-08T22:58:00.001-06:00</published><updated>2012-02-13T09:27:10.444-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-13T09:27:10.444-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="three variable graph" /><category scheme="http://www.blogger.com/atom/ns#" term="visualization" /><category scheme="http://www.blogger.com/atom/ns#" term="matlab" /><title>Plotting three variable graph using Matlab</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-Pt4cp8ztU3Q/TzHkZBmZAbI/AAAAAAAABeg/TYMuiFyohGQ/s1600/Picture+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style="font-family: inherit;"&gt;Recently,&lt;/span&gt; a user wanted to visualize the effect of four different test conditions causing changes in three different parameters. &amp;nbsp;This visualization will help understand the effect of change in one parameter on others.&lt;br /&gt;
&lt;br /&gt;
The user suggested to plot the three parameters along three different axis. &amp;nbsp;For example, the three parameters with values of [95.0, 1.2, 4.5] will correspond to the co-ordinates of [95.0, 0.0, 0.0], [0, 1.2, 0] and [0, 0, 4.5]. &amp;nbsp;Using these coordinates, one can form a triangle. &amp;nbsp;The shape of the triangle will be different for the various test conditions and it will be easier to visualize the effect of the test conditions on the parameters. &lt;br /&gt;
&lt;br /&gt;
I was not initially sure whether I could&amp;nbsp;accomplish&amp;nbsp;this using a standard&amp;nbsp;Matlab plots. &amp;nbsp;I did a search on google but was not successful, as I did not have a good search term. &amp;nbsp;I resorted to creating a OpenGL program using GL_TRIANGLES. &amp;nbsp; I later found that Matlab has similar functionality. &amp;nbsp;Triangles and other polygons can be easily constructed in Matlab using the "&lt;a href="http://www.mathworks.com/help/techdoc/ref/patch.html"&gt;patch&lt;/a&gt;" function.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;The program&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The vals contains the value that needs to be plotted. &amp;nbsp;Each column is one test condition and the rows contain the parameters that need to be plotted along the axis. &amp;nbsp;The "for loop" runs for each column and creates the x, y and z coordinates and stores them in a, b and c. &amp;nbsp;The patch command will create a triangle using the three coordinates. &amp;nbsp;The last parameter in the patch command is the color of the patch. &amp;nbsp;By default, patch is rendered with all surface opaque and the color specified in the patch command. &amp;nbsp;Since there are too many surfaces, the patch was made transparent and the edges were given different line style and thickness using "plottools". &amp;nbsp;The resulting plot can be seen below.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;% The variables vals has three rows and four columns. The columns contain co-ordinate values along x,y,z axis respectively.&amp;nbsp; The four rows will result in four triangular surfaces.&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;vals = [11.11,3.55,4.97,2.14;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.61,4.63,4.53,4.66;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 91.2,79,93.4,56.3];&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;figure;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;hold on;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;for i = 1:size(vals,2) % For each column in vals&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; a = [vals(1,i)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; b = [0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vals(2,i)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; c = [0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vals(3,i)]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; patch(a,b,c,10*i)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;grid on;&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-vRXzVz3--jY/TzKUqUY6_QI/AAAAAAAABeo/C_3hIKTIIn8/s1600/blogplot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="395" src="http://4.bp.blogspot.com/-vRXzVz3--jY/TzKUqUY6_QI/AAAAAAAABeo/C_3hIKTIIn8/s400/blogplot.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-7057339051094118785?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/7057339051094118785/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=7057339051094118785" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/7057339051094118785?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/7057339051094118785?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/Ad0D9uSfIK0/plotting-three-variable-graph-using.html" title="Plotting three variable graph using Matlab" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-vRXzVz3--jY/TzKUqUY6_QI/AAAAAAAABeo/C_3hIKTIIn8/s72-c/blogplot.png" height="72" width="72" /><thr:total>0</thr:total><georss:featurename>Minneapolis, MN 55421, USA</georss:featurename><georss:point>45.0563001 -93.2599459</georss:point><georss:box>45.0338666 -93.29942790000001 45.0787336 -93.2204639</georss:box><feedburner:origLink>http://imageviz.blogspot.com/2012/02/plotting-three-variable-graph-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04MQ3c_eCp7ImA9Wx5UF0Q.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-6230270327969663645</id><published>2010-10-22T14:23:00.023-05:00</published><updated>2010-10-22T21:13:02.940-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-22T21:13:02.940-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="image processing" /><category scheme="http://www.blogger.com/atom/ns#" term="correlation" /><category scheme="http://www.blogger.com/atom/ns#" term="counting" /><title>Calculating the number of repeating objects in an image</title><content type="html">Recently I was asked to help solve a problem determining the number of seats in an airline. An example of such an airline layout is shown below (click to view the bigger image.)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_iniZFBtdGok/TMHnVTDy-FI/AAAAAAAABaE/ELzVnvUe8Pg/s1600/airline_seating.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 70px;" src="http://3.bp.blogspot.com/_iniZFBtdGok/TMHnVTDy-FI/AAAAAAAABaE/ELzVnvUe8Pg/s400/airline_seating.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5530956170467145810" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I decided to use the method I knew best, Cross Correlation. The idea is to cross correlate the template of the seat (i.e., an image of a single seat) with every pixel in the airline layout image. The template (coordinate origin is its center) is moved over to a particular pixel in the image. The cross correlation coefficient is calculated and the value is used as the intensity of a new image. This is repeated by moving the template to every pixel in the airline layout image. The pixels for which the template matches perfectly with the airline layout image, will have the correlation coefficient close to 1. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_iniZFBtdGok/TMHnRynvqlI/AAAAAAAABZ8/dBmI793tHbQ/s1600/template.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 48px; height: 45px;" src="http://2.bp.blogspot.com/_iniZFBtdGok/TMHnRynvqlI/AAAAAAAABZ8/dBmI793tHbQ/s400/template.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5530956110219946578" /&gt;&lt;/a&gt;&lt;br /&gt;Above: A hard to see template of the seat.&lt;br /&gt;&lt;br /&gt;The results of the cross correlation is shown below (click to view the bigger image.)&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_iniZFBtdGok/TMHnMwa-5xI/AAAAAAAABZ0/Ho8cv8efg9U/s1600/correlated_image.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 123px;" src="http://1.bp.blogspot.com/_iniZFBtdGok/TMHnMwa-5xI/AAAAAAAABZ0/Ho8cv8efg9U/s400/correlated_image.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5530956023730202386" /&gt;&lt;/a&gt;&lt;br /&gt;The bright spots in this image are the points with the highest correlation. It then becomes a simple process of segmenting the high intensity pixel. &lt;br /&gt;&lt;br /&gt;To perform these operations, my natural choice was Matlab and its Image processing toolbox. &lt;br /&gt;&lt;code&gt;&lt;br /&gt;im = imread('airline_seating.jpg');&lt;br /&gt;im = rgb2gray(im);&lt;br /&gt;&lt;br /&gt;im_template = imread('template.jpg');&lt;br /&gt; im_template= rgb2gray(im_template);&lt;br /&gt;&lt;br /&gt;C = normxcorr2(im_template, im);&lt;br /&gt;C1 = C&gt;0.7;&lt;br /&gt;&lt;br /&gt;stat = regionprops(C1);&lt;br /&gt;noofseats = size(stat,1);&lt;br /&gt;disp(['Number of seats = ',num2str(noofseats)]);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;In the first 4 lines of code, we read the airline layout image and the template image. To obtain the correlation image, I did not have to write my own correlation function instead Matlab has one already ready to be used. This function, normxcorr2 needs the airline layout  and the template matrix. Once the correlation image is obtained, we segment it based on the logic that any pixel with value more than 0.7 is considered as pixels corresponding to the center of seat. Since the center of the seat did not segment as a single pixel, I could not count the number of pixels as the number of seats. Instead I calculated the number of regions using regionprops and store it as a structure. The number of elements of the structure is the number of seats.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-6230270327969663645?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/6230270327969663645/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=6230270327969663645" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/6230270327969663645?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/6230270327969663645?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/aLfI8iF08V0/shdflkghjsdlkfgjh-0.html" title="Calculating the number of repeating objects in an image" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_iniZFBtdGok/TMHnVTDy-FI/AAAAAAAABaE/ELzVnvUe8Pg/s72-c/airline_seating.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2010/10/shdflkghjsdlkfgjh-0.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUAARXozfyp7ImA9Wx5UE0s.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-604151876886253520</id><published>2010-10-06T13:22:00.010-05:00</published><updated>2010-10-17T21:09:04.487-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-17T21:09:04.487-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="beautifulsoup" /><category scheme="http://www.blogger.com/atom/ns#" term="html" /><title>Spamming of HTML forms - one case</title><content type="html">Recently I found that a newspaper in its online edition switched from image based &lt;a href="http://en.wikipedia.org/wiki/CAPTCHA"&gt;CAPTCHA system&lt;/a&gt; to solving a mathematical puzzle, in-order to prevent spamming of their comment section using a computer program. A screen capture of the same can be found below.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_iniZFBtdGok/TKy-fCAz40I/AAAAAAAABZI/NcAc6y_8bEg/s1600/Picture+1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 222px;" src="http://2.bp.blogspot.com/_iniZFBtdGok/TKy-fCAz40I/AAAAAAAABZI/NcAc6y_8bEg/s400/Picture+1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5525000283202249538" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The problem with such a system is that they can be easily solved using a computer, which defeats the purpose of using it to differentiate human and computers apart. To test my own skill, I wanted to write a program that can download the page, read it and solve the puzzle as well. Using the information I obtain, I could then post comments without human intervention. &lt;br /&gt;&lt;br /&gt;To accomplish this task, I used the usual suspects like python and and the HTML parser, &lt;a href="http://www.crummy.com/software/BeautifulSoup/"&gt;BeautifulSoup&lt;/a&gt;. BeautifulSoup reads a string of html or xml and converts it to a tree. Using the tree, it is easy to navigate through the tags or search for a particular one based on id or name. It is also powerful enough to differentiate tags based on CSS class in html tags.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;1. import urllib&lt;br /&gt;2. from BeautifulSoup import BeautifulSoup&lt;br /&gt;3. import string,re&lt;br /&gt;&lt;br /&gt;4. doc = urllib.urlopen('http://www.somesight.com/comment/reply/1854565').read()&lt;br /&gt;5. soup = BeautifulSoup(''.join(doc))&lt;br /&gt;&lt;br /&gt;6. a = soup.findAll("span",{"class":"field-prefix"})&lt;br /&gt;7. b = a[0].contents[0].split("=")[0].split("+")&lt;br /&gt;8. c = [int(bs) for bs in b]&lt;br /&gt;9. captcha_response = sum(c)&lt;br /&gt;10. print a,captcha_response&lt;br /&gt;&lt;br /&gt;11. token1 = soup.findAll("input",id="edit-captcha-token")&lt;br /&gt;12. token1_val = token1[0]['value']&lt;br /&gt;13. print token1,token1_val&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The two important information that I need to calculate are the captcha_response which is the solution to the mathematical problem and the captcha_token, a hidden html field in the webpage. Line #6 searches for a class, field-prefix in span tag. This tag contains the string for the mathematical puzzle that needs to be solved.  I obtain the contents of this string and split it in-order to obtain the individual numbers in a list. Finally I convert those numbers from string to integer in Line #8 and sum them using line #9. &lt;br /&gt;&lt;br /&gt;Line #11 searches the hidden captcha token, stored in the input tag with id="edit-captcha-token".&lt;br /&gt;&lt;br /&gt;Armed with these two information, we can post any name and comment to the form. The comments were moderated but it would still require lot of human intervention to clear the spams. &lt;br /&gt;&lt;br /&gt;I informed the webmaster of this issue. They have since moved to a image based system. I removed all reference to the site in this blog post and program in-order to keep their anonymity.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-604151876886253520?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/604151876886253520/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=604151876886253520" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/604151876886253520?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/604151876886253520?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/nYEvVAcDETw/spamming-of-html-forms-one-case.html" title="Spamming of HTML forms - one case" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_iniZFBtdGok/TKy-fCAz40I/AAAAAAAABZI/NcAc6y_8bEg/s72-c/Picture+1.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2010/10/spamming-of-html-forms-one-case.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUEESXc-eip7ImA9Wx5WEUs.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-7240943281193537224</id><published>2010-09-21T14:16:00.026-05:00</published><updated>2010-09-22T10:00:08.952-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-22T10:00:08.952-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="django ajax json javascript" /><title>Ajax in django</title><content type="html">Asynchronous Javascript and XML (Ajax) has become the most important tool for web developers in improving the look and feel of their website. A normal HTML request is sent by a client with request for a particular page. The server prepares the page and sends it to the client browser that renders the page. This approach is still valid for most pages. But the problem is that the whole page gets rendered every time the server processes a request. This might be acceptable for some websites but sites like google maps, stock ticker sites would rather modify a small portion of the page rather than reload them completely. Ajax plays an important role in such applications.&lt;br /&gt;&lt;br /&gt;Django provides support for Ajax and my google-fu turned up a few of them that were really good. The problem I had with them was that the sites focused more on how syntactically Ajax can be executed in Django rather than the overall principle. So, in this post I will focus just on the basic principles of Ajax in Django. The anatomy of a typical django request can be summarized by the image below. The request comes in from the client, the view function processes it and the response is returned using a call to HttpResponse or render_to_response etc. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_iniZFBtdGok/TJkKPXUEfyI/AAAAAAAABXw/vUcAjUKw-RE/s1600/Picture+1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 368px;" src="http://1.bp.blogspot.com/_iniZFBtdGok/TJkKPXUEfyI/AAAAAAAABXw/vUcAjUKw-RE/s400/Picture+1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5519454077391765282" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;In a normal django request, the response is in the form of HTML or CSV or some such file. Ajax needs JSON or XML instead. Hence django is almost ready for Ajax. The only extra step is the need to serialize the data in to JSON or XML format. Django makes it easy by providing serializers that are builtin. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;During the process of serializing, django takes two approaches. &lt;span style="font-weight:bold;"&gt;The first approach is for serializing list of django model objects and the second approach is for everything else.&lt;/span&gt; The everything else could include any dictionary of values that you create but need to pass through serialization. Lets look at each approach separately. Both approach are serialized using simplejson built in to django. In the former, django provides a separate module and hence you do not have to make an explicit simplejson call. In the latter, you need to make explicit calls to simplejson functions. &lt;br /&gt;&lt;br /&gt;In the first approach, we pass the list of django model objects to the serialize function in the serializers module. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt; from django.core import serializers&lt;br /&gt; &lt;br /&gt; def search(request, query):&lt;br /&gt;  return serializers.serialize("xml",User.objects.filter(lastname__startswith=query))&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In the second approach, we need to make a explicit call to simplejson. In the program below, we first load the simplejson module. We then create our dictionary using the values, number and image_loc. We then return the json value using simplejson.dumps() function and django's HttpResponse function. The javascript on the django template will then modify the HTML page according to the values in the json object. If you use the first approach to the dictionary that you created, it will give an error, "'str' object has no attribute '_meta'"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;from django.utils import simplejson&lt;br /&gt;&lt;br /&gt;def servevalues(request):&lt;br /&gt;    number = 10000&lt;br /&gt;    image_loc = 'http://www.google.com/images/logos/ps_logo2.png'&lt;br /&gt;    data = {"number":number,"image_loc":image_loc}&lt;br /&gt;    return HttpResponse(simplejson.dumps(data),mimetype='application/javascript')&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Remember:&lt;br /&gt;1. Ajax calls to django are very similar to http request calls. Both return some form of textual information. Hence syntactically they look alike&lt;br /&gt;&lt;br /&gt;2. There are 2 approach to serializing. The first approach is for django model objects and the second approach is for any other object / dictionary that you create. In either case, the code that you have to write is minimal and simple, the django way!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-7240943281193537224?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/7240943281193537224/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=7240943281193537224" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/7240943281193537224?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/7240943281193537224?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/V69_M-gURqE/ajax-in-django.html" title="Ajax in django" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_iniZFBtdGok/TJkKPXUEfyI/AAAAAAAABXw/vUcAjUKw-RE/s72-c/Picture+1.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2010/09/ajax-in-django.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04CQHsyfCp7ImA9Wx5VEkU.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-8447986147898856235</id><published>2010-07-16T11:34:00.011-05:00</published><updated>2010-10-05T09:46:01.594-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-05T09:46:01.594-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="django" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Keep tab on items you lent using borrow-err.com</title><content type="html">On my free time, I have been working on a small but useful and interesting project. It resulted in the site &lt;a href="http://www.borrow-err.com/"&gt;http://www.borrow-err.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The reason for creating the site was my forgetfulness. I lend books to others and I forget about it. So, I decided to create a website where I can keep track of items I lent to others. If you would like to try it, just key in the details of the items and the name of the borrower in to the home page. The website will then send you a reminder email every month for the items you lent. If you are lucky and you get your items back, you can remove them from the list using the links provided in the email. &lt;br /&gt;&lt;br /&gt;You can access it using any browser. The page is also light enough that it loads fine in mobile browsers as well. So whether you are at home, office or on road, you can use borrow-err.com to keep track of items that you lent.  Try it and give me your feedback.&lt;br /&gt;&lt;br /&gt;Remember: &lt;span style="font-style:italic;"&gt;borrower's err, so you need borrow-err.com&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;October 5th, 2010: &lt;span style="font-style:italic;"&gt;The previous version had the bare minimum styling. Hence I made some changes and I believe the new version is more pleasing to your eye.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-8447986147898856235?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/8447986147898856235/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=8447986147898856235" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/8447986147898856235?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/8447986147898856235?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/mnRyZ9BAM9s/keep-tab-on-items-you-lent-using-borrow.html" title="Keep tab on items you lent using borrow-err.com" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2010/07/keep-tab-on-items-you-lent-using-borrow.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUMQXo_cSp7ImA9WxNaEEQ.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-6183698968478893033</id><published>2009-11-21T10:48:00.006-06:00</published><updated>2009-11-24T13:18:00.449-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-24T13:18:00.449-06:00</app:edited><title>Did you know that ... Part 2</title><content type="html">1. Digital Imaging received this years Nobel Prize in Physics. Willard&lt;br /&gt;Boyle and George Smith received their recognition for work on Charge&lt;br /&gt;Couple Devices (CCD) used in range of scientific instruments including the telescope.&lt;br /&gt;&lt;br /&gt;2. There have been many Nobel Prize awarded to people who used imaging as one of their tools of investigation&lt;br /&gt;&lt;br /&gt;3. Hough Transform used in the detection of geometrical shapes was initially &lt;a href="http://www.google.com/patents?vid=3069654"&gt;patented&lt;/a&gt; by Paul Hough in 1962&lt;br /&gt;&lt;br /&gt;4. &lt;a href="http://stardust.jpl.nasa.gov/tech/aerogel.html"&gt;NASA Aerogel&lt;/a&gt; was used to collect the interstellar and comet particles. The aerogel slows the particles otherwise traveling at high velocity to a halt without heating. NASA collected images of these tracks along which the particle translated and requested help from public in determining the location of them.&lt;br /&gt;&lt;br /&gt;5. &lt;a href="http://www.openshotvideo.com/"&gt;Open shot&lt;/a&gt; is a free non-linear movie editor under Linux. You can clip, resize and trim movies, add transition between scenes, change speed of clips and even "&lt;a href=http://en.wikipedia.org/wiki/Ken_Burns_Effect&gt;Ken Burns effect&lt;/a&gt;".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-6183698968478893033?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/6183698968478893033/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=6183698968478893033" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/6183698968478893033?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/6183698968478893033?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/_9ZlZMv7amc/did-you-know-that-part-2.html" title="Did you know that ... Part 2" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2009/11/did-you-know-that-part-2.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEENRHYzeSp7ImA9WxJUEEs.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-5152344979952727508</id><published>2009-07-08T09:43:00.003-05:00</published><updated>2009-07-08T10:24:55.881-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-08T10:24:55.881-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="matlab" /><title>Matlab alternatives</title><content type="html">Matlab is a powerful programming language for scientific computing. The popularity of Matlab stems from the fact that it is a high level programming language focusing more on faster development and less on syntax. It also has many tool boxes that extend the functionality that is offered by basic Matlab on to other scientific and engineering domains. In spite of all these advantage, it comes with a price, the fact that we need to pay for purchasing, installing and maintaining it. Although the price we pay might be easily offset by the benefits, many Matlab like software are in existence and perform similar even if not the same set of functionality. In this blog, we will look at some of the alternatives. In all these alternatives, the program written to be run on Matlab can be run directly, within the constrains of functionality offered by that particular software. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;FreeMat&lt;/span&gt;&lt;br /&gt;&lt;a href="http://freemat.sourceforge.net/"&gt;FreeMat&lt;/a&gt; is a open source software released under GPL. It is available for most of the common OS like Windows, Linux and Mac. Installing the software on a Windows machine was a piece of cake. Its repertoire of functionality is large but does not have many of the toolboxes offered by Matlab.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Octave&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.gnu.org/software/octave/"&gt;Octave&lt;/a&gt; is another software available under GPL. The syntax of Octave commands are similar to Matlab (&lt;a href="http://www.gnu.org/software/octave/FAQ.html#MATLAB-compatibility"&gt;and not the same&lt;/a&gt;) and is also highly extensible using C, C++ and Fortran. Unlike FreeMat, Octave comes with many toolboxes for Image processing, Signal processing, Statistics etc. Installing the software on a Windows machine using &lt;a href="http://www.cygwin.com/"&gt;cygwin&lt;/a&gt; is easy but installing from source on Linux machine requires expertise due to many dependencies. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Numpy and Scipy &lt;/span&gt;&lt;br /&gt;&lt;a href="http://numpy.scipy.org/"&gt;Numpy and Scipy&lt;/a&gt; are Python modules that can be used to perform high level scientific computation like Matlab. Since these modules are based in python, their syntax is not similar to Matlab but due to its focus on high level programming, the syntax is generally simple. With installation of dependencies like python imaging library (PIL), we can perform image and signal processing. Scipy can also be used to perform optimization and statistics. Prebuilt binary packages are easy to install but installation from source is cumbersome due to its dependencies.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-5152344979952727508?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/5152344979952727508/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=5152344979952727508" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/5152344979952727508?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/5152344979952727508?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/j5XRpqZu1As/matlab-alternatives.html" title="Matlab alternatives" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2009/07/matlab-alternatives.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUHQXc7cSp7ImA9WxVVEU8.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-2446539239791373401</id><published>2009-02-19T13:19:00.015-06:00</published><updated>2009-03-03T16:43:50.909-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-03T16:43:50.909-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="fem" /><category scheme="http://www.blogger.com/atom/ns#" term="abaqus" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="script" /><title>Python and Abaqus</title><content type="html">Recently I had the opportunity to work with a student who needed to perform a Finite Element Analysis on roughly 400 files using Abaqus. Processing such large number of images using the graphical user interface would have been impractical. We were happy to learn that Abaqus has a python scripting module which could help us with the automation.&lt;br /&gt;&lt;br /&gt;We set about writing the python program from the individual function calls given in their manuals. But considering the scope of the software and its complexity, the approach quickly became difficult. Instead, we resorted to creating "macros" and modifying it to our purpose.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);"&gt;Creating Macros&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The macros in Abaqus lets you perform a series of operations and record them as python scripts. The scripts by default are stored in "abaqusMacros.py" with each macro recorded as a function. Since the macro was created for a particular model, we modified the names in the function " Entire_Work_Flow" to be generic so that other models can be loaded. We then added other functions that will call the function created using macro.&lt;br /&gt;&lt;br /&gt;The other function created were "getvalues" that obtains the relavant von mises stress values from the ODB file. The main function reads each of the solid model (.sat file) in a given directory and passes the filename to the macro function. It then calls getvalues function and stores the result in a CSV file for further analysis.&lt;br /&gt;&lt;br /&gt;To run the script, type "abaqus cae -noGUI scriptname.py".&lt;br /&gt;&lt;br /&gt;The Entire_Work_Flow has been trimmed to show only the relevant lines that corresponds to creation of the name of parts, instance and job name.&lt;br /&gt;&lt;br /&gt;&lt;object id="_ds_4637202" name="_ds_4637202" type="application/x-shockwave-flash" data="http://viewer.docstoc.com/" width="670" height="550"&gt;&lt;param name="FlashVars" value="doc_id=4637202&amp;amp;mem_id=14095&amp;amp;doc_type=doc&amp;amp;fullscreen=0"&gt;&lt;param name="movie" value="http://viewer.docstoc.com/"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/object&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;a href="http://www.blogger.com/docs/4637202/Abaqus_python"&gt;Abaqus_python&lt;/a&gt; - &lt;a href="http://www.docstoc.com/"&gt;Free Legal Forms&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-2446539239791373401?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/2446539239791373401/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=2446539239791373401" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/2446539239791373401?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/2446539239791373401?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/mA1HmZN7vhg/python-and-abaqus.html" title="Python and Abaqus" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2009/02/python-and-abaqus.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak4GRHg6fyp7ImA9WxVQFko.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-2159026566758030798</id><published>2009-01-26T16:04:00.014-06:00</published><updated>2009-02-03T10:35:25.617-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-03T10:35:25.617-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><category scheme="http://www.blogger.com/atom/ns#" term="unix" /><title>New Line command</title><content type="html">Once in a while, I come across a task that i need to perform, may be using a python script and then it amazes me to find a tool built in to Linux / Unix.&lt;br /&gt;&lt;br /&gt;I had a series of numbers (stored as a column) representing a physical quantity measured with respect to time. The data was stored as a text file. I had to add the time (in seconds) column before the column in the file. The first row had time of 1 second, the second row had a time of 2 seconds etc. In short, I just needed to add the line number to each row.&lt;br /&gt;&lt;br /&gt;Ordinarily, one could use python to open the file, read each row and add a incremental number in front of each row. But with Linux all that I had to do was &lt;br /&gt;&lt;br /&gt;&lt;code&gt;nl file1.txt &gt; file2.txt&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;where 'nl' is the new line command. The file 'file1.txt' contained the one column of numbers, the measured values and 'file2.txt' will contain two columns, the seconds column and the datacolumn. &lt;br /&gt;&lt;br /&gt;The new line command can also work across pages, can number headers, footers etc. Please check the &lt;a href="http://linux.die.net/man/1/nl"&gt;man page&lt;/a&gt; for more details.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Dec 28, 2009&lt;/span&gt;&lt;br /&gt;I found a second method to add line number:&lt;br /&gt;&lt;br /&gt;To add line number including blank line &lt;code&gt;cat -n file1.txt &gt; file2.txt&lt;/code&gt;. If you wish to add line numbers only for non-blank lines, use &lt;code&gt;cat -b file1.txt &gt; file2.txt&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-2159026566758030798?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/2159026566758030798/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=2159026566758030798" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/2159026566758030798?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/2159026566758030798?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/8XRG_fcdZv4/new-line-command.html" title="New Line command" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2009/01/new-line-command.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0EFQX87eCp7ImA9WxVRF0k.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-5984888048206161254</id><published>2009-01-23T09:52:00.007-06:00</published><updated>2009-01-23T15:20:10.100-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-23T15:20:10.100-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="xargs" /><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><category scheme="http://www.blogger.com/atom/ns#" term="unix" /><title>xargs - taking output of one command and making input for another</title><content type="html">If you would like to take the output of one command and pass it on to another UNIX program, you are in luck. Like many things in Unix/Linux, there are many ways to perform this operation. &lt;br /&gt;&lt;br /&gt;For example if I need to find all jobs that are running in the queue and get complete details, I could perform either&lt;br /&gt;&lt;br /&gt;&lt;code&gt;qstat -f `qstat | grep R | awk '{print $1}'` &lt;/code&gt; &lt;br /&gt;&lt;br /&gt;or &lt;br /&gt;&lt;br /&gt;&lt;code&gt;qstat | grep R | awk '{print $1}' | xargs -n1 qstat -f &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;In the first version, the command within `backticks` is evaluated to obtain the list of jobs that are "running". In this command, 'qstat | grep R' will give a list of rows for jobs running.  The awk command splits that string and obtains the list of job names. &lt;br /&gt;&lt;br /&gt;In the second version, 'qstat | grep R | awk '{print $1}'' is evaluated and the output is passed to xargs command. Both these commands are equivalent, except that the second option is more robust in handling whitespace and null character in output before it becomes an input to the next command.&lt;br /&gt;&lt;br /&gt;We will continue further with the use of xargs and calculate the total time all the currently running jobs would need. &lt;br /&gt;&lt;br /&gt;&lt;code&gt;qstat | grep R | awk '{print $1}' | xargs -n1 qstat -f | grep Resource_List.walltime | awk '{split($3,a,":");sum+=a[1]}END{print sum}'&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;As seen earlier, the output of xargs command gives the input to 'grep Resource_List.walltime' command. The output of this command is the rows that contain information about the wallclock time for each of these jobs. These rows are then parsed to obtain just the 3rd column ($3 in the command) which contains wallclock time formatted as hh:mm:ss. &lt;br /&gt;&lt;br /&gt;This string is split across ":" and the first number, namely the hour, is obtained as "a[1]" in the command. This process is repeated for each of the job and at end the total sum is printed. &lt;br /&gt;&lt;br /&gt;I will keep posting more of such tidbits in the future ....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-5984888048206161254?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/5984888048206161254/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=5984888048206161254" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/5984888048206161254?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/5984888048206161254?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/FUnmbSa67wQ/xargs-taking-output-of-one-command-and.html" title="xargs - taking output of one command and making input for another" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2009/01/xargs-taking-output-of-one-command-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYMRXY5cSp7ImA9WxVRFkk.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-8484298855114753805</id><published>2009-01-22T08:53:00.007-06:00</published><updated>2009-01-22T11:09:44.829-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-22T11:09:44.829-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="modules" /><category scheme="http://www.blogger.com/atom/ns#" term="modulefiles" /><title>Creating module files</title><content type="html">A complex program in Linux will generally be installed in multiple locations. For example, a C++ library like Magick++ after installation will require include files, library files and binary files. Each of these is located in different folders and may be in different parent directories aw well. &lt;br /&gt;&lt;br /&gt;In one of our installation, Magick++ is installed in /usr/local/magick++/magick++/. Under this directory, the include files are in &lt;span style="font-style:italic;"&gt;include&lt;/span&gt;, the library files are in &lt;span style="font-style:italic;"&gt;lib&lt;/span&gt; and binary files are in &lt;span style="font-style:italic;"&gt;bin&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;For a user defined program using the Magick++ library, the path to all three have to be in their environment variable. This is set using a module file.&lt;br /&gt;&lt;br /&gt;A module file is a TCL script. An example of the module file for adding path to magick++ is given below. &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#%Module######################################################################&lt;br /&gt;##&lt;br /&gt;##  Magick++ Module&lt;br /&gt;##&lt;br /&gt;proc ModulesHelp { } {&lt;br /&gt;    puts stderr "\tThis module adds PATH that allow you to compile Magick++&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;set MAGICK_LIB_HOME "/usr/local/magick++/magick++/lib"&lt;br /&gt;set MAGICK_BIN_HOME "/usr/local/magick++/magick++/bin"&lt;br /&gt;set MAGICK_INCLUDE_HOME "/usr/local/magick++/magick++/include"&lt;br /&gt;&lt;br /&gt;append-path PATH $MAGICK_BIN_HOME&lt;br /&gt;append-path LD_LIBRARY_PATH $MAGICK_LIB_HOME&lt;br /&gt;append-path LD_INCLUDE_PATH $MAGICK_INCLUDE_HOME&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The module file begins with #%Module, which helps to identify a module file. The proc ModulesHelp prints a helpful message whenever "&lt;span style="font-style:italic;"&gt;module help magick++&lt;/span&gt;" is typed in linux command prompt. The next three lines create variables that store the location of lib, bin and include direcory. Finally these paths are appended to the environment variables PATH, LD_LIBRARY_PATH and LD_INCLUDE_PATH respectively.&lt;br /&gt;&lt;br /&gt;To invoke this module file and attach all these path to environment variables, type "&lt;span style="font-style:italic;"&gt;module load magick++&lt;/span&gt;" or "&lt;span style="font-style:italic;"&gt;module add magick++&lt;/span&gt;" at the Linux command line.&lt;br /&gt;&lt;br /&gt;To unload these path and environment variables, type "&lt;span style="font-style:italic;"&gt;module unload magick++&lt;/span&gt;"&lt;br /&gt;&lt;br /&gt;In addition to appending path, we can also prepend paths, set and unset environment variables, set and unset aliases etc. Refer to the &lt;a href="http://modules.sourceforge.net/man/modulefile4.html"&gt;manpage&lt;/a&gt; for more details.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-8484298855114753805?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/8484298855114753805/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=8484298855114753805" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/8484298855114753805?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/8484298855114753805?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/c2gJeCTVgS0/creating-module-files.html" title="Creating module files" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2009/01/creating-module-files.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcFQH08fyp7ImA9WxVRFk4.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-8815269255281680415</id><published>2009-01-22T08:30:00.008-06:00</published><updated>2009-01-22T08:53:31.377-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-22T08:53:31.377-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="makefile" /><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><category scheme="http://www.blogger.com/atom/ns#" term="make" /><title>Configuring Make file</title><content type="html">Any of us who have used Linux will eventually end up installing softwares from source. The most common method for installing softwares written is C, C++, Fortran etc is using Makefile. &lt;br /&gt;&lt;br /&gt;The Makefile contains the list of commands that will be used to create the various libraries, binaries etc. &lt;br /&gt;&lt;br /&gt;In the most simplest of the scenario, the installation will involve&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;./configure&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;make clean&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The first step prepares the makefile with all relavant configuration depending on the system on which it is being installed. This could include, the location where the files will be stored after installation, the type of CPU etc. The second step  "make" compiles and "make install" builds and places the program in the appropriate locations. "make clean" clears any temporary files that have been created. &lt;br /&gt;&lt;br /&gt;Depending on the different scenarios and type of software being installed, different configuration may have to be set. In the example below, we will configure the installation of magick++ (a C++ library for ImageMagick) so that it is installed in /usr/local/magick++/magick++/ instead of the default location /usr/local/&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;./configure --with-quantum-depth=8  --prefix=/usr/local/magick++/magick++/ --exec-prefix=/usr/local/magick++/magick++/&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;--prefix is the location where the lib and include files will be stored after compiling. If not specified, it will be assumed as /usr/local&lt;br /&gt;&lt;br /&gt;--exec-prefix is the location where bin files will be located. &lt;br /&gt;&lt;br /&gt;By default, --prefix = --exec-prefix&lt;br /&gt;&lt;br /&gt;There are many other configuration parameters that can be set, which again depends on the software. I will keep posting more such configuration.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-8815269255281680415?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/8815269255281680415/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=8815269255281680415" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/8815269255281680415?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/8815269255281680415?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/H4mniQUn6fw/configuring-make-file.html" title="Configuring Make file" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2009/01/configuring-make-file.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYCSH87fCp7ImA9WxVSEEk.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-8022618269769871623</id><published>2009-01-03T17:38:00.025-06:00</published><updated>2009-01-03T22:42:49.104-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-03T22:42:49.104-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="spellcheck" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Spell checker in Unicode using Python</title><content type="html">I have a project where I had to perform spell check on characters recognized using an optical character recognition program (OCR). My first choice was to search for an existing program written preferably in python, my favorite choice for such work. You can download the complete file &lt;a href="http://www.msi.umn.edu/%7Echityala/spellcheck/spellchecker.py"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Amazingly I found this work by &lt;a href="http://norvig.com/spell-correct.html"&gt;Peter Norvig &lt;/a&gt;. It was very well documented and well written piece of code.&lt;br /&gt;&lt;br /&gt;But I had few issues that I needed to fix and so I could not use it directly.&lt;br /&gt;&lt;br /&gt;1. In my program, unicode characters need to defined as the default character for all input and output unlike peter's program which works on ascii.&lt;br /&gt;&lt;br /&gt;This is performed in the following code&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#!/usr/bin/python -Wall&lt;br /&gt;&lt;font style="color: rgb(255, 0, 0);"&gt;# -*- coding: utf-8 -*- &lt;/font&gt;&lt;br /&gt;&lt;br /&gt;import re, collections, pprint,os&lt;br /&gt;&lt;red style="color: rgb(255, 0, 0);"&gt;import sys &lt;/red&gt;&lt;br /&gt;import codecs&lt;br /&gt;&lt;br /&gt;if __name__ == '__main__':&lt;br /&gt;...&lt;br /&gt;&lt;font style="color: rgb(255, 0, 0);"&gt;reload(sys)&lt;/font&gt; &lt;font style="color: rgb(255, 0, 0);"&gt;    sys.setdefaultencoding('iso8859-1') &lt;/font&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;2. The list of alphabets will also include the unicode characters applicable in my situation like &lt;br /&gt;&lt;font style="color: rgb(255, 0, 0);"&gt;alphabet = u'abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿß'&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;3. The unicode feature of python is smart enough to recognise the right characters for conversion from upper case to lower case. All that needs to be done is to call the .lower() function on any unicode characters in the following function.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;font style="color: rgb(255, 0, 0);"&gt;def words(text):&lt;/font&gt; &lt;font style="color: rgb(255, 0, 0);"&gt;return re.findall(u'[abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿß]+',text.lower())&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Peter's program trains different words by determining the probability of its occurence. In simple terms, it counts the number of time a word appears in a standard piece of text. The larger the piece of text, the more representative it is to the real world. This scenario was not true in my case, as I do not have a piece of text where a word gets repeated multiple times.&lt;br /&gt;&lt;br /&gt;In my case, I have a list of words in a text file. Almost all the word gets repeated only once and not any more. So the rank of a word was not in frequency but its ordinality.&lt;br /&gt;&lt;br /&gt;The ord function in python returns the unicode position of a character input. In the function below, I first determine the ordinality of each word in the possible candidates (i.e., the original set of words). Then the ordinality of the word to be spell checked is also found. The difference between the two ordinalities is determined and the location of the lowest value gives the location of the correct word in the candidates.&lt;br /&gt;&lt;br /&gt;&lt;font style="color: rgb(255, 0, 0);"&gt;&lt;br /&gt;def best_candidate(candidates,word):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clist = list(candidates)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Find ordinality for the complete list&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; so = []&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for cl in clist:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    sum_ord = 0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        for c in cl:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;           sum_ord = sum_ord+ord(c)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        so.append(sum_ord)&lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   #Find ordinality of the given word&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   sum_ord = 0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   for c in word:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;     sum_ord = sum_ord+ord(c)&lt;br /&gt;&lt;p&gt;#Find difference in ordinality and also lowest value location&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;       so_item_l = []&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;       for so_item in so:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;     so_item_l.append(abs(so_item-sum_ord))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;     min_loc = so_item_l.index(min(so_item_l))&lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  return clist[min_loc]&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/codealphabet&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-8022618269769871623?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/8022618269769871623/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=8022618269769871623" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/8022618269769871623?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/8022618269769871623?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/QUCy5L1W5hE/spell-checker-in-unicode-using-python.html" title="Spell checker in Unicode using Python" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2009/01/spell-checker-in-unicode-using-python.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMMQ34_cCp7ImA9WxdWFU4.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-5818668470667263329</id><published>2008-07-08T10:12:00.008-05:00</published><updated>2008-07-08T10:21:22.048-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-08T10:21:22.048-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="matlab" /><title>Convert a series of Matlab figure files in to jpg</title><content type="html">This program converts a set of fig files located in a directory in to jpg files. The program runs through the directory and gets a list of fig file names. These files are then read using the ‘openfig’ command and the output is written using ‘saveas’ command. For example, a file named ‘image.fig’ will be read and saved as ‘image.fig.jpg’. The only variable that needs to be changed is the figdirectory&lt;p&gt;&lt;/p&gt;    &lt;span style="font-weight: bold;"&gt;Bonus: &lt;/span&gt;You can use the parsing directory structure to read any kind of files located in a directory.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;%%Matlab program - fig2jpg&lt;br /&gt;figdirectory = 'C:\Documents and Settings\username\Desktop'&lt;br /&gt;&lt;br /&gt;fullpath = sprintf('%s/*.fig',figdirectory)&lt;br /&gt;d = dir(fullpath);&lt;br /&gt;length_d = length(d)&lt;br /&gt;if(length_d == 0)&lt;br /&gt;  disp('couldnt read the directory details\n');&lt;br /&gt;    disp('check if your files are in correct directory\n');&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;startfig  = 1&lt;br /&gt;endfig = length_d&lt;br /&gt;&lt;br /&gt;for i = startfig:endfig&lt;br /&gt;     fname = d(i).name;&lt;br /&gt;   fname_input = sprintf('%s/%s',figdirectory,fname)&lt;br /&gt;     fname_output =  sprintf('%s/%s.jpg',figdirectory,fname)&lt;br /&gt;     saveas(openfig(fname_input),fname_output,'jpg');&lt;br /&gt;end&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-5818668470667263329?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/5818668470667263329/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=5818668470667263329" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/5818668470667263329?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/5818668470667263329?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/mgjRvdvala0/convert-series-of-matlab-figure-files.html" title="Convert a series of Matlab figure files in to jpg" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2008/07/convert-series-of-matlab-figure-files.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUEQXY-fyp7ImA9WxdWFU4.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-8998956458233277870</id><published>2008-05-13T21:53:00.003-05:00</published><updated>2008-07-08T10:16:40.857-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-08T10:16:40.857-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><title>Setting automatic jobs in Linux</title><content type="html">I was working on setting up a cron job for monitoring the machines under my control and so the natural thing was to set a cron job in Linux. I was new to &lt;code&gt;crontab&lt;/code&gt; command in Linux but as you will soon see, the command is very simple and hence should be easy to master. There are some nuances that I learnt during the course of the work and I will discuss it at the end.&lt;br /&gt;&lt;br /&gt;The crontab command begins with setting the time, date at which a particular job needs to be run. These parameters are set using a crontab file, which can be edited by calling the command &lt;code style="font-style: italic;"&gt;crontab -l&lt;/code&gt;. In the editor, type the following command&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;5   *   *   *   *   command-to-execute &gt; logfile.log &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The number 5 represents the minute at which the command has to be executed. The subsequent values represents the hour, day, month and day of the week (Sunday = 0) respectively. The value * represents all the possible combination. The &gt; pipes the output of the command to a logfile. Once the crontab file has been set, it can be verified using &lt;code&gt;crontab -l&lt;/code&gt;. The crontab file can also be written to a text file and loaded using &lt;code&gt;crontab cronfile.txt&lt;/code&gt;. The content of the cronfile.txt is same as above.&lt;br /&gt;&lt;br /&gt;If you wish that you receive a mail every time the cron runs, add the following line first&lt;br /&gt;&lt;br /&gt;MAILTO: johndoe@email.com (Of course, replace it with the correct email address)&lt;br /&gt;&lt;br /&gt;So far, everything is easy and good but be careful with the following,&lt;br /&gt;&lt;br /&gt;1.Ensure that there is an empty line after the last line of crontab file.&lt;br /&gt;2.For some reason, crontab cannot use the PATH stored by Linux. So ensure that all commands in the crontab file and all the commands and scripts called by crontab are referred with full path.&lt;br /&gt;    &lt;br /&gt;   So instead of calling&lt;br /&gt;           &lt;code style="font-style: italic;"&gt;*   2   *   *  *  python     /path/to/file/pythonfile.py&lt;/code&gt;&lt;code style="font-style: italic;"&gt;&lt;br /&gt;&lt;/code&gt;&lt;code&gt;&lt;br /&gt;call&lt;/code&gt;&lt;code style="font-style: italic;"&gt;&lt;br /&gt;  *  2   *   *   *   /usr/bin/python    /path/to/file/pythonfile.py&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Also make sure that all the path in the python file are also referred using full path.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-8998956458233277870?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/8998956458233277870/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=8998956458233277870" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/8998956458233277870?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/8998956458233277870?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/QEve-Jd4hgg/setting-automatic-jobs-in-linux.html" title="Setting automatic jobs in Linux" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2008/05/setting-automatic-jobs-in-linux.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEAFRnszfip7ImA9WxZbEEs.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-4779103731072960029</id><published>2008-04-09T15:37:00.001-05:00</published><updated>2008-04-12T23:58:37.586-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-12T23:58:37.586-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="OCR" /><category scheme="http://www.blogger.com/atom/ns#" term="tesseract" /><title>Optical Character Recoginition (OCR) using Tesseract</title><content type="html">Recently I had a very interesting project from client who wanted to extract the text (in my case numbers) embedded on thousands of images. My natural choice was to use Tesseract, as it can be scripted and applied to many images in sequenence. &lt;br /&gt;&lt;br /&gt;Tesseract is an OCR software, originally developed by Hewlett Packard and currently developed by Google. It is a open source software released under Apache license. Since it is open source, you can get your hands on it and install it on pretty much any operating system. I installed it on a Windows machine under Cygwin and the installation was a breeze. &lt;br /&gt;&lt;br /&gt;Tesseract does not have any segmentation methods, no document layout and can only output the recognised text to a file. But its accuracy is good enough for many applications. It was ranked among top 3rd OCR software for the year 1995. Making a call to tesseract is also easy&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;tesseract data.bmp text.dat [-l langid]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The values within [] are optional. The &lt;span style="font-style:italic;"&gt;langid &lt;/span&gt;is the the language being recognized. The default language is English. But it also supports French, Italian, German, Spanish. &lt;br /&gt;&lt;br /&gt;Since Tesseract does not have any segmentation methods to separate the text from background, the user have to apply these methods using other softwares like ImageMagick, ITK etc. The most common segmentation technique for scanned documents is the &lt;span style="font-style:italic;"&gt;Local Adaptive Thresholding&lt;/span&gt;. It takes in to account the variation in background intensity across the scanned image and thresholds accordingly. But the right technique has to be chosen depending on the type of image being recognized. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Possible additions to Tesseract&lt;/span&gt;&lt;br /&gt;All the text that I needed to decipher in my images were numbers but Tesseract does not have a langid for numbers. Since there are no langid for numbers, Tesseract deciphered some of these numbers as alphabets. If I have time in the future, I will work on creating the langid for numbers as it will be helpful for many people. If you find that it might be helpful for you, I encourage you to create one or contact me and we can work togther.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-4779103731072960029?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/4779103731072960029/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=4779103731072960029" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/4779103731072960029?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/4779103731072960029?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/XzT3fN7zEn0/optical-character-recoginition-ocr.html" title="Optical Character Recoginition (OCR) using Tesseract" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>5</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2008/04/optical-character-recoginition-ocr.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C04NRH06eip7ImA9WxZVGEg.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-7262950954074880139</id><published>2008-03-27T16:06:00.002-05:00</published><updated>2008-03-29T23:39:55.312-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-03-29T23:39:55.312-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Programming" /><category scheme="http://www.blogger.com/atom/ns#" term="Magick++" /><category scheme="http://www.blogger.com/atom/ns#" term="ImageMagick" /><title>Summary of all chapters</title><content type="html">Currently I am busy with my other projects and I am not able to continue working on chapters on Draw and Pixel class and also on other useful small projects that you could perform. So meanwhile, I am uploading a file which has all my writing thus far. Enjoy reading.&lt;br /&gt;&lt;br /&gt;&lt;object width="670" height="550"&gt;&lt;param name="movie" value="http://www.docstoc.com/docs/wrapper.ashx?doc_id=429912&amp;swf_url=http%3A//content1.docstoc.com.s3.amazonaws.com/chapter1to6.pdf.swf&amp;enableFullScreen=1"/&gt;&lt;param name="allowScriptAccess" value="always" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;embed src="http://www.docstoc.com/docs/wrapper.ashx?doc_id=429912&amp;swf_url=http%3A//content1.docstoc.com.s3.amazonaws.com/chapter1to6.pdf.swf&amp;enableFullScreen=1" width="670" height="550" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;a href="http://www.docstoc.com/docs/429912/Magick-chapter-1-to-6"&gt;Magick++ chapter 1 to 6 &lt;/a&gt; - Get more &lt;a href="http://www.docstoc.com/"&gt;free documents&lt;/a&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-7262950954074880139?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/7262950954074880139/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=7262950954074880139" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/7262950954074880139?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/7262950954074880139?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/3FzfRmAMDV8/summary-of-all-chapters.html" title="Summary of all chapters" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2008/03/summary-of-all-chapters.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQNQHgyfSp7ImA9WxZVFkg.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-7113063635345494855</id><published>2008-03-24T08:59:00.001-05:00</published><updated>2008-03-27T16:13:11.695-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-03-27T16:13:11.695-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Programming" /><category scheme="http://www.blogger.com/atom/ns#" term="Magick++" /><category scheme="http://www.blogger.com/atom/ns#" term="ImageMagick" /><title>Chapter 6: Image class – Part 2</title><content type="html">In chapter 4, we looked at the overview of the Image class and discussed a few  functions, for filtering images, in detail using some example program. In this chapter, we will discuss a higher order image processing function like segmentation. We will first demonstrate a program for performing adaptive thresholding and then a program for performing fuzzy c  mean clustering. Each of these algorithms will be explained and then the program will be illustrated to ensure complete understanding. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Continue reading the pdf file ...&lt;br /&gt;&lt;br /&gt;&lt;object width="670" height="550"&gt;&lt;param name="movie" value="http://www.docstoc.com/docs/wrapper.ashx?doc_id=429892&amp;swf_url=http%3A//content1.docstoc.com.s3.amazonaws.com/chapter6%255b2%255d.pdf.swf&amp;enableFullScreen=1"/&gt;&lt;param name="allowScriptAccess" value="always" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;embed src="http://www.docstoc.com/docs/wrapper.ashx?doc_id=429892&amp;swf_url=http%3A//content1.docstoc.com.s3.amazonaws.com/chapter6%255b2%255d.pdf.swf&amp;enableFullScreen=1" width="670" height="550" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;a href="http://www.docstoc.com/docs/429892/Chapter-6-Image-class-–-Part-2"&gt;Chapter 6: Image class – Part 2&lt;/a&gt; - Get more &lt;a href="http://www.docstoc.com/"&gt;free documents&lt;/a&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-7113063635345494855?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/7113063635345494855/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=7113063635345494855" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/7113063635345494855?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/7113063635345494855?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/LDpgxb0QEkc/chapter-6-image-class-part-2.html" title="Chapter 6: Image class – Part 2" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2008/03/chapter-6-image-class-part-2.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkUDRXY-cCp7ImA9WxZWFkU.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-5832476056438160285</id><published>2008-03-14T11:30:00.003-05:00</published><updated>2008-03-16T11:17:54.858-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-03-16T11:17:54.858-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Programming" /><category scheme="http://www.blogger.com/atom/ns#" term="Magick++" /><category scheme="http://www.blogger.com/atom/ns#" term="ImageMagick" /><title>Chapter 5: Exception class</title><content type="html">In this chapter, we will focus on the Exception class, to identify errors in the Magick++ function calls at run time, ensuring easier debugging of code. We will compliment it with example program that will aid in the understanding of its use. &lt;br /&gt;&lt;br /&gt;Continue reading the pdf below...&lt;br /&gt;&lt;br /&gt;&lt;object width="670" height="550"&gt;&lt;param name="movie" value="http://www.docstoc.com/docs/wrapper.ashx?doc_id=422229&amp;swf_url=http%3A//content1.docstoc.com.s3.amazonaws.com/chapter5.pdf.swf&amp;enableFullScreen=1"/&gt;&lt;param name="allowScriptAccess" value="always" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;embed src="http://www.docstoc.com/docs/wrapper.ashx?doc_id=422229&amp;swf_url=http%3A//content1.docstoc.com.s3.amazonaws.com/chapter5.pdf.swf&amp;enableFullScreen=1" width="670" height="550" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;a href="http://www.docstoc.com/docs/422229/Chapter-5-Exception-class"&gt;Chapter 5: Exception class&lt;/a&gt; - Get more &lt;a href="http://www.docstoc.com/"&gt;free documents&lt;/a&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-5832476056438160285?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/5832476056438160285/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=5832476056438160285" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/5832476056438160285?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/5832476056438160285?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/6ecuDeyVyZU/chapter-5-exception-class.html" title="Chapter 5: Exception class" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2008/03/chapter-5-exception-class.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4ESHc_eSp7ImA9WxZWEEU.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-6562458613278820918</id><published>2008-03-09T12:24:00.002-05:00</published><updated>2008-03-09T12:31:49.941-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-03-09T12:31:49.941-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Programming" /><category scheme="http://www.blogger.com/atom/ns#" term="Magick++" /><category scheme="http://www.blogger.com/atom/ns#" term="ImageMagick" /><title>Chapter 4: Image class – Part 1</title><content type="html">In this previous chapter, we looked at the overview of the various classes available in Magick++. In this chapter, we will focus on the Image class, the base class and learn its features and some of it functionalities. We will compliment these with example programs that will aid in the understanding of its use. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Image class&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As indicated earlier, Image class is the main class in Magick++. It can&lt;br /&gt;1.Read and Write almost all common formats including some field domain specific formats like dicom&lt;br /&gt;2.Create new images&lt;br /&gt;3.Perform image filtering1&lt;br /&gt;4.Perform geometric image transformation&lt;br /&gt;5.Improve quality of photographs&lt;br /&gt;6.Perform image modification like slicing, bordering etc&lt;br /&gt;7.Segmentation2&lt;br /&gt;8.Set image attributes&lt;br /&gt;9.and more such features which could not arranged in to this list&lt;br /&gt;&lt;br /&gt;Continue reading the pdf below...&lt;br /&gt;&lt;br /&gt;&lt;object width="670" height="550"&gt;&lt;param name="movie" value="http://www.docstoc.com/docs/wrapper.ashx?doc_id=419905&amp;swf_url=http%3A//content1.docstoc.com.s3.amazonaws.com/chapter4.pdf.swf&amp;enableFullScreen=1"/&gt;&lt;param name="allowScriptAccess" value="always" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;embed src="http://www.docstoc.com/docs/wrapper.ashx?doc_id=419905&amp;swf_url=http%3A//content1.docstoc.com.s3.amazonaws.com/chapter4.pdf.swf&amp;enableFullScreen=1" width="670" height="550" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;a href="http://www.docstoc.com/docs/419905/Chapter-4-Image-class-–-Part-1"&gt;Chapter 4: Image class – Part 1&lt;/a&gt; - Get more &lt;a href="http://www.docstoc.com/"&gt;free documents&lt;/a&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-6562458613278820918?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/6562458613278820918/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=6562458613278820918" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/6562458613278820918?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/6562458613278820918?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/q3sgL_CpjLE/chapter-4-image-class-part-1.html" title="Chapter 4: Image class – Part 1" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2008/03/chapter-4-image-class-part-1.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUMQ3o8fSp7ImA9WxZXGE4.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-3064550666371555183</id><published>2008-03-02T09:57:00.004-06:00</published><updated>2008-03-06T15:01:22.475-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-03-06T15:01:22.475-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Programming" /><category scheme="http://www.blogger.com/atom/ns#" term="Magick++" /><category scheme="http://www.blogger.com/atom/ns#" term="ImageMagick" /><title>Chapter 3: Introduction to Magick++ classes</title><content type="html">In this chapter, we will look at an overview of the various classes available in Magick++. We will list the various classes and a brief description of their function and then a detailed  look at how these classes work together in-order to create a good programming practise.&lt;br /&gt;&lt;br /&gt;Magick++ classes&lt;br /&gt;  There are a total of 11 classes in Magick++. The major class is Image as it can read, write and create images. Other classes like Color, Geometry etc are used to support the functionalities in Image class and other classes. In the following table, the various classes are arranged roughly in the order of importance...&lt;br /&gt;&lt;br /&gt;Continue reading the pdf file below...&lt;br /&gt;&lt;br /&gt;&lt;object width="670" height="550"&gt;&lt;param name="movie" value="http://www.docstoc.com/docs/wrapper.ashx?doc_id=415234&amp;swf_url=http%3A//content1.docstoc.com.s3.amazonaws.com/chapter3.pdf.swf&amp;enableFullScreen=1"/&gt;&lt;param name="allowScriptAccess" value="always" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;embed src="http://www.docstoc.com/docs/wrapper.ashx?doc_id=415234&amp;swf_url=http%3A//content1.docstoc.com.s3.amazonaws.com/chapter3.pdf.swf&amp;enableFullScreen=1" width="670" height="550" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;a href="http://www.docstoc.com/docs/415234/Chapter-3-Introduction-to-Magick-classes"&gt;Chapter 3: Introduction to Magick++ classes&lt;/a&gt; - Get more &lt;a href="http://www.docstoc.com/"&gt;free documents&lt;/a&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-3064550666371555183?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/3064550666371555183/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=3064550666371555183" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/3064550666371555183?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/3064550666371555183?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/P_L96np5eqk/chapter-3-introduction-to-magick.html" title="Chapter 3: Introduction to Magick++ classes" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2008/03/chapter-3-introduction-to-magick.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQAQHY7eSp7ImA9WxZXGE4.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-89845583462132164</id><published>2008-02-24T23:02:00.003-06:00</published><updated>2008-03-06T15:02:21.801-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-03-06T15:02:21.801-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Programming" /><category scheme="http://www.blogger.com/atom/ns#" term="Magick++" /><category scheme="http://www.blogger.com/atom/ns#" term="ImageMagick" /><title>Chapter 2: Compiling Magick++ program</title><content type="html">In this chapter, we will look at a demonstration program to understand the method for compiling and linking a Magick++ program. Read the pdf file located below ...&lt;br /&gt;&lt;br /&gt;&lt;object width="670" height="550"&gt;&lt;param name="movie" value="http://www.docstoc.com/docs/wrapper.ashx?doc_id=412150&amp;swf_url=http%3A//content1.docstoc.com.s3.amazonaws.com/chapter2.pdf.swf&amp;enableFullScreen=1"/&gt;&lt;param name="allowScriptAccess" value="always" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;embed src="http://www.docstoc.com/docs/wrapper.ashx?doc_id=412150&amp;swf_url=http%3A//content1.docstoc.com.s3.amazonaws.com/chapter2.pdf.swf&amp;enableFullScreen=1" width="670" height="550" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;a href="http://www.docstoc.com/docs/412150/Chapter-2-Compiling-Magick-program"&gt;Chapter 2: Compiling Magick++ program &lt;/a&gt; - Get more &lt;a href="http://www.docstoc.com/"&gt;free documents&lt;/a&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-89845583462132164?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/89845583462132164/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=89845583462132164" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/89845583462132164?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/89845583462132164?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/958f5M-Kx60/chapter-2-compiling-magick-program.html" title="Chapter 2: Compiling Magick++ program" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2008/02/chapter-2-compiling-magick-program.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUMHQno5fip7ImA9WxZXGE4.&quot;"><id>tag:blogger.com,1999:blog-1149088774216168764.post-8080237617797565430</id><published>2008-02-20T20:05:00.012-06:00</published><updated>2008-03-06T15:03:53.426-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-03-06T15:03:53.426-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Programming" /><category scheme="http://www.blogger.com/atom/ns#" term="Magick++" /><category scheme="http://www.blogger.com/atom/ns#" term="ImageMagick" /><title>Chapter 1: Introduction to Magick++</title><content type="html">I have been preparing programs that demonstrate the various capabilities of Magick++. I am planning to prepare them as a set of articles (around 10)  that would demonstrate how Magick++ could be integrated in to your C++ program, thus providing an immense power in manipulating images.&lt;br /&gt;&lt;br /&gt;In this tutorial, I would introduce some of the basics of Magick++ and in the next tutorial, we would work on the various classes that are defined in Magick++. Subsequently, we would prepare simple programs and with advanced features appearing as we progress.&lt;br /&gt;&lt;br /&gt;Continue reading the pdf file below...&lt;br /&gt;&lt;br /&gt;&lt;object width="670" height="550"&gt;&lt;param name="movie" value="http://www.docstoc.com/docs/wrapper.ashx?doc_id=408115&amp;swf_url=http%3A//content1.docstoc.com.s3.amazonaws.com/chapter1[2].pdf.swf&amp;enableFullScreen=1"/&gt;&lt;param name="allowScriptAccess" value="always" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;embed src="http://www.docstoc.com/docs/wrapper.ashx?doc_id=408115&amp;swf_url=http%3A//content1.docstoc.com.s3.amazonaws.com/chapter1[2].pdf.swf&amp;enableFullScreen=1" width="670" height="550" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;font size="1"&gt;&lt;a href="http://www.docstoc.com/docs/408115/Introduction-to-Magick"&gt;Introduction to Magick++&lt;/a&gt; - Get more &lt;a href="http://www.docstoc.com/"&gt;free documents&lt;/a&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1149088774216168764-8080237617797565430?l=imageviz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://imageviz.blogspot.com/feeds/8080237617797565430/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1149088774216168764&amp;postID=8080237617797565430" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/8080237617797565430?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1149088774216168764/posts/default/8080237617797565430?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/imageviz/~3/WryPmgALOgw/chapter-1-introduction-to-magick.html" title="Chapter 1: Introduction to Magick++" /><author><name>Ravishankar Chityala</name><uri>https://profiles.google.com/107181952094718349423</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://imageviz.blogspot.com/2008/02/chapter-1-introduction-to-magick.html</feedburner:origLink></entry></feed>

