Introduction About Site Map

XML
RSS 2 Feed RSS 2 Feed
Navigation

Main Page | Blog Index

Saturday, December 25th, 2010, 3:40 pm

GNU Octave a Compatible Drop-in Replacement for MATLAB

Over the past couple of months I have been assessing the combination of Octave with some other free/libre software such as Scilab and QtOctave. I did this as part of my existing job in research, as my blog posts ought to have revealed on occasions. I’ve been using MATLAB for the best part of a decade and was at one time ranked #1 in the world for my contributions to MATLAB Central. That, however, changed several years ago when I came to grips with the fact that my free/libre code for MATLAB only helped promote the underlying stack which included MATLAB, a nasty piece of highly expensive proprietary software with BSA bullies behind it. MathWorks is exploiting free labour of many people to sell its non-free software. I can vividly recall Slashdot comments stressing this point, which profoundly changed my attitude towards MATLAB. So I turned to Octave, as I did half a decade ago, but this time it was a lot more mature. People recommended to me programs other than Octave, too. I checked these under different distributions of GNU/Linux and even Windows, which many people out there continue to use, especially on their desktop. I helped some people dump MATLAB. I saw how easy it was.

MATLAB is used extensively in research and in the industry, sometimes even in hospitals (when I was 22 I was asked to help a professor with that). In many cases, it boasts more features than anyone would ever need*. Does a university student really ever use more than the basic functions? Are companies really willing to spend thousands of dollars per year just ‘renting’ a licence for one or two copies of MATLAB, which keeps nagging them for it assumes they are so-called ‘pirates’ (and the BSA comes knocking to ensure there are up-to-date licensing instances)? The answer is usually “no”, but users of MATLAB may not know that software already exists to offer them an alternative, just as Firefox helps replace Internet Explorer and also outperform it in many technical ways. Since MATLAB and Octave are mostly compatible, moving from one to the other is not hard and this reduces risk of being too dependent on one single company, especially if one switches over to Octave and then uses the no-cost redistribution rights to just expand operations to as many machines as are available. Octave runs exceptionally well on GNU/Linux, so no licence of Windows is required, either. In the coming days I’ll continue to post examples of what can be achieved with the more advanced functionality of Octave, including 3-D and video. It’s impressive and it by far exceeds my expectations given what I found in it around 5 years ago.
____
* There is a famous saying that goes like, “80% of the users of Microsoft Office only ever use 20% of its features.”

Friday, December 24th, 2010, 4:55 pm

Making Videos With Animate

A few weeks ago I wrote about turning image sequences into real videos using The GIMP, which is more than just an image editor and my favourite tool for simple videos. But I sought to automate more of the process, so I wrote some Octave code to number the sequence of figures, save them all in raster space under a newly-created directory, and then pass them all using a UNIX-style system call to animate, which is a utility I’ve used for this purpose since 2004. Animate is built in a way that makes it compatible with just about any environment sitting on top of X Server. It allows videos to be saved in so many different formats, including GIF, which makes it easy to open in a lot of programs including Web browsers. Animate also has PDF as an output option — one where frames are separated by pages. This makes it a very powerful tool, which would have been even more powerful had it been possible to save the resultant video from the command line (no such option exists based on the man page). As it stands, making it scriptable is a case of “close, but no cigar” (little human intervention needed). One of this blog’s readers, Twitter, has suggested some other programs that can turn sequences of images into videos without any GUI obstruction. Yes, GUI is trouble in these cases.

The bottom line is, there are many tools for Linux/UNIX which make video composition rather simple and even scriptable (necessary when handling many sets, or sets of 3-D slices). For turning videos into a set of images I use Avidemux. It’s small and simple.

As some example output, here is a video showing how a rough and incorrect estimate deals with cardiac cycle. The crosses represent radii of best circle fit to the surrounding points. There is no constraint in place yet to ensure diffeomorphism.

Slices and frames 220-240 of heart

Expansion accumulator

Directions accumulator

Here is a more properly placed (at least initially) set of landmark points adjusting to fit the heart’s walls.

Slices and frames 200-220 of heart

Expansion accumulator for tracked heart

Directions accumulator for tracked heart

The figures where values are plotted as a function of frame # basically say how much the points move further away from the centre and whether they move clockwise or counterclockwise. These figures correspond to the two videos, where the latter (*tracked.png) belong to the second video.

Friday, December 24th, 2010, 7:46 am

Winter of Code

Creek in December

IT HAS been a week or so since I last made a research-related post, so here is a quick update. I am currently coding some bits that can detect and measure rotation in the heart, including tangential/centrifugal components. The goal is to calculate the twist and also the scale changes separately, giving a figure indicative of each. The notions found in flow/vortex mathematics ought to enable this to be calculated from a set (or matrix) of points, each of which being a vector of directions around a central point. To quote Wikipedia on vortex: “A vortex (plural: vortices) is a spinning, often turbulent, flow of fluid. Any spiral motion with closed streamlines is vortex flow. The motion of the fluid swirling rapidly around a center is called a vortex. The speed and rate of rotation of the fluid in a free (irrotational) vortex are greatest at the center, and decrease progressively with distance from the center, whereas the speed of a forced (rotational) vortex is zero at the center and increases proportional to the distance from the center. Both types of vortices exhibit a pressure minimum at the center, though the pressure minimum in a free vortex is much lower.”

My implementation of this is simplistic as it merely uses an accumulator whose value increases for each point that moves in a given direction (e.g. for each clockwise arrow) and decreases for the opposite.

An issue we face here is that circular motion in the heart walls is far from trivial to see. A careful look at image sequences taken with about 20 frames for each cycle and each slice does not quite expose a ‘squeeze’ of the heart, not unless there is tagging of the image which also enables reconstruction of a higher quality. So, to calculate rotation of the sides based on just intensity is rather hard, unless there is something in the signal that can be detected. Generally, looking at the tracking typically carried out, there is hardly a tendency to pick up any traces of tangential motion and where it does exist it is not consistent. Assuming a direction is known and then estimated with a probabilistic model, there is room for improvement, maybe even a significant change in contrast. Different slices show different directions for the twist and it requires a look inside the heart too, in order to visually compare intensities and assume a rotation of some sort. I will post some images soon to illustrate this.

Additional code was completed to calculate and plot the centre of the points around the heart, based on the fitting of a circle to all the surrounding points (best match). At the end of each tracking sequence a plot if shown to give a statistical analysis of how points move around the walls and whether they move in and out throughout the cardiac cycle. The goal here is to, based on several cycle, find out if and how the algorithm can detect wall motion and quantify it. There is clearly a correlation to be found here.

Today’s addition (it’s a holiday, so lots of spare time for coding and also to read literature) will soon be uploaded along with more material, all of which will be shared not just for the sake of transparency. I’ll post results shortly.

As a side note, I’ve begun looking into the possibility of writing a book about Novell and another possibility I’m looking into is initiating a startup around the code I’ve been writing since 2003 to achieve something nobody achieved before, even with free/libre software (the whole stack). I’m currently doing cardiac analysis but still considering a situation where come back to a more CS-oriented work, at least when the existing contract is over. There are many projects on my mind and choosing just the best one/s is not easy. Then again, it’s good to have possibilities and I’m still in my twenties, so there is no pressure.

Monday, December 20th, 2010, 11:38 pm

TechBytes 21: Hello Dolly, Trolls, Boosters, and Advocates

TechBytes

Direct download as Ogg (1:25:51, 25.6 MB) | Direct download as MP3 (39.3 MB)

Summary: Tim, Gordon, and Roy speak about many different topics including the show itself

TODAY’S show was covering many topics and OpenBytes has published the show notes.

RSS 64x64Today’s show ends with “Harold T Wilkins” by Fanfarlo (from SXSW 2009 Showcasing Artists). We hope you will join us for future shows and consider subscribing to the show via the RSS feed. You can also visit our archives for past shows. If you have an Identi.ca account, consider subscribing to TechBytes in order to keep up to date.

As embedded (HTML5):

Download:

Ogg Theora
(There is also an MP3 version)

Sunday, December 19th, 2010, 1:14 pm

Transparency

Transparency can be a way of life to those who wish to expose what they are doing. Since 2002 when I built this Web site I have made many aspects of my life public and this did not cause much trouble at all. Transparency leads to a state where there are no secrets and thus there is little room for scandals or mischief. Last night I was challenged by a friend to whom my preference of transparency seemed inadequate. This is fine. Well, more and more people willingly become more transparent over time (sadly in Web sites like Facebook which exploit them) and their eagerness to share personal material is proving infectious. Governments too are starting to find out that sooner or later data which they keep secret will leak and Neelie Kroes rightly pointed out that Wikileaks/Cablegate will push more governments toward becoming transparent.

Transparency breeds trust. Secrecy breeds misconduct.

Sunday, December 19th, 2010, 7:41 am

Contour and Arrows

Contour and arrows

The animated figure below shows how contouring is done with a new and improved algorithm in place. The sequence is show in reverse, as the window titles help indicate. Arrows can be put on top of the contour to signal the direction of movement of each landmark point, but arrow can in general add clutter and it may be worth taking a group of several points and study based on these the direction of movement of entire region, then display fewer large arrows.

Contour and gradient

Sunday, December 19th, 2010, 12:40 am

TechBytes on GNU/Linux Gaming

TechBytes

Direct download as Ogg (1:03:24, 18.6 MB) | Direct download as MP3 (29.0 MB)

Summary: Tim and Roy speak about some recent news and discuss the world of GNU/Linux gaming

TODAY’S show was covering games for GNU/Linux and to some degree phones running Linux as well. We left our discussion about trolls and lobbying to tomorrow’s show and OpenBytes will have published the show notes by then (it’s late now in the UK).

RSS 64x64Today’s show ends with “Paper Gown” by Caroline Herring (from SXSW 2009 Showcasing Artists). We hope you will join us for future shows and consider subscribing to the show via the RSS feed. You can also visit our archives for past shows. If you have an Identi.ca account, consider subscribing to TechBytes in order to keep up to date.

As embedded (HTML5):

Download:

Ogg Theora
(There is also an MP3 version)

Real-time Posts

Posts by @schestowitz

Retrieval statistics: 23 queries taking a total of 0.098 seconds • Please report low bandwidth using the feedback form
Original styles created by Ian Main (all acknowledgements) • PHP scripts and styles later modified by Roy Schestowitz • Help yourself to a GPL'd copy
|— Proudly powered by W o r d P r e s s — based on a heavily-hacked version 1.2.1 (Mingus) installation —|