<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
    <channel>
        <title>I Blog Imaging</title>
        <link>http://www.idoimaging.com/blog/</link>
        <description>Andy Crabb&apos;s I Do Imaging blog</description>
        <language>en</language>
        <copyright>Copyright 2010</copyright>
        <lastBuildDate>Sat, 09 Jan 2010 08:20:15 -0500</lastBuildDate>
        <generator>http://www.sixapart.com/movabletype/</generator>
        <docs>http://www.rssboard.org/rss-specification</docs>
        
        <item>
            <title>I Did Imaging in 2009</title>
            <description><![CDATA[76,000 people used my site last year, which is cool, even though that's only 6% more than 2008.&nbsp; Visits were up 12%, the average user visited 1.5 times. Modest, but growth of a sort.<br /><br /><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.idoimaging.com/blog/newzealand.html" onclick="window.open('http://www.idoimaging.com/blog/newzealand.html','popup','width=232,height=223,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.idoimaging.com/blog/assets_c/2010/01/newzealand-thumb-160x153.png" alt="newzealand.png" class="mt-image-right" style="margin: 0pt 0pt 20px 20px; float: right;" height="153" width="160" /></a></span>Sometimes I wonder how big the total 'market' is for a web site about medical imaging software, free or otherwise.&nbsp; It's a bit daunting to look at the whole picture and try to work out how many radiology departments there are in the world, so sometimes I look at a smaller sample.&nbsp; Last year, for instance, Google tells me I got 315 visits from New Zealand, a place I know reasonably well.&nbsp; Australia had about 1,700 visits which is about right given the relative populations.&nbsp; Google Stats gives you all sorts of useful information, such as I had strong growth in Wollongong, but&nbsp; the radiologists in Hobart seem to be losing interest.&nbsp; Guess I'll have to step up the Tasmanian marketing effort.&nbsp; There are those who may argue that 'meaningful' statistics require larger samples than the number of frugalWollongongian radiologists, or readers of infrequently updated free imaging software blogs.&nbsp; To them, I say, pshaw.<br /><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.idoimaging.com/blog/woolongong2.html" onclick="window.open('http://www.idoimaging.com/blog/woolongong2.html','popup','width=278,height=112,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.idoimaging.com/blog/blogimages/woolongong-thumb-160x64.png" alt="woolongong.png" class="mt-image-right" style="margin: 0pt 0pt 20px 20px; float: right;" height="64" width="160" /></a></span><br />Back to my example.&nbsp; There are about 50-100 radiologists per million population, so New Zealand has say 300.&nbsp; And for each of them let's say there are four others who might be interested in imaging - programmers, physicists, technologists, students.&nbsp; So I'm going to define my New Zealand target market as 1,500 with a professional interest and who knows how many patients sent home with their scans on a DVD.&nbsp; If I count only the pros and ignore the sent-homes, I'm getting about 20% of them to visit my site each year.&nbsp; Not bad but I do want the remaining 80% to <span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="alexa.png" src="http://www.idoimaging.com/blog/blogimages/alexa.png" class="mt-image-left" style="margin: 0pt 20px 20px 0pt; float: left;" height="66" width="150" /></span>at least see how much great software is available.&nbsp; And that, extrapolated world wide, would give me close to half a million unique visitors a year.&nbsp; That might help me achieve one of my more modest goals: get a global site ranking with only one comma in it.<br /><div><br /></div><div><br /></div>]]></description>
            <link>http://www.idoimaging.com/blog/2010/01/i-did-imaging-in-2009.html</link>
            <guid>http://www.idoimaging.com/blog/2010/01/i-did-imaging-in-2009.html</guid>
            
                <category domain="http://www.sixapart.com/ns/types#category">idoimaging.com</category>
            
            
            <pubDate>Sat, 09 Jan 2010 08:20:15 -0500</pubDate>
        </item>
        
        <item>
            <title>November Version Releases</title>
            <description><![CDATA[<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.idoimaging.com/blog/blogimages/vinci_head.png"><img alt="vinci_head.png" src="http://www.idoimaging.com/blog/blogimages/vinci_head-thumb-60x93.png" width="60" height="93" class="mt-image-left" style="float: left; margin: 0 20px 20px 0;" /></a></span><a href="http://www.idoimaging.com/cgi-sys/cgiwrap/acrabb/imaging/program.pl?ident=334">Vinci</a>&nbsp;has another new version release. &nbsp;I've mentioned this program before; it is a heavyweight neuro imaging program specializing in PET imaging, and is a leader in this field. &nbsp;That said, it's a pretty narrow field, but it happens to be my field which is why I like this program so much. &nbsp;Their release schedule is regular and substantial - for example, one 'maintenance' release a while ago was to expand their platform base to the Mac and Linux. &nbsp;I see no reason why this program couldn't be used for non-neuro imaging and its feature list will keep the most demanding analyst busy for days.<div><br /></div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.idoimaging.com/blog/blogimages/huntington.html" onclick="window.open('http://www.idoimaging.com/blog/blogimages/huntington.html','popup','width=537,height=481,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.idoimaging.com/blog/assets_c/2009/11/huntington-thumb-120x107.jpg" width="120" height="107" alt="huntington.jpg" class="mt-image-right" style="float: right; margin: 0 0 20px 20px;" /></a></span><div><a href="http://www.idoimaging.com/cgi-sys/cgiwrap/acrabb/imaging/program.pl?ident=208">Anatomist / BrainVISA</a>&nbsp;is another major program in neuro image processing and analysis, though specializing in MRI this time. &nbsp;It is a product of a consortium of French academic institutions and is frequently updated and well supported. &nbsp;It's true open source and has been built on many operating systems, though prefers Linux. &nbsp;I've not used this program, it's specialized and not in my particular field. &nbsp;I will download and test it for a review, though, and I've admired their images, does that count?</div><div><br /></div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.idoimaging.com/blog/blogimages/radscaper.html" onclick="window.open('http://www.idoimaging.com/blog/blogimages/radscaper.html','popup','width=593,height=574,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.idoimaging.com/blog/blogimages/radscaper-thumb-120x116.png" width="120" height="116" alt="radscaper.png" class="mt-image-left" style="float: left; margin: 0 20px 20px 0;" /></a></span><div><a href="http://www.idoimaging.com/cgi-sys/cgiwrap/acrabb/imaging/program.pl?ident=321">RadScaper</a>&nbsp;is a Java applet-based image viewer from Divinev, and the recently released updates feature an attractive redesign along with technical improvements. &nbsp;There are a couple of these around, but RadScaper is in continuous development and its capabilities have grown considerably. &nbsp;There are obvious limitations to viewing images in a web browser rather than a stand-alone imaging application, but Radscaper can be run on just about any computer and requires no software installation at all. &nbsp;The image files are supplied via straight HTML so there should be no issue in accessing the image server through a firewall or other security appliance. &nbsp;</div><div><br /></div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.idoimaging.com/blog/blogimages/osirix_logo.html" onclick="window.open('http://www.idoimaging.com/blog/blogimages/osirix_logo.html','popup','width=150,height=111,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.idoimaging.com/blog/blogimages/osirix_logo-thumb-120x88.jpg" width="120" height="88" alt="osirix_logo.jpg" class="mt-image-right" style="float: right; margin: 0 0 20px 20px;" /></a></span><div><a href="http://www.idoimaging.com/cgi-sys/cgiwrap/acrabb/imaging/program.pl?ident=251">Osirix</a>&nbsp;has another of its regular updates released. &nbsp;It's the program I almost love to hate, since it could be argued that it is the only DICOM program you need, which would make my site obsolete! &nbsp;As a general purpose radiology workstation, or indeed for many specialized purposes, Osirix will do pretty much everything with DICOM files. &nbsp;I use it all day long for imaging and PACS work, and I recommend it to colleagues. &nbsp;If they are not currently Macintosh users, this program probably justifies purchasing a Mac. &nbsp;Of course, it is limited to DICOM and is limited to Macintosh (it utilizes so many advanced Mac core technologies that porting it to another OS would mean redesigning it). &nbsp;Try this program.</div><div><br /></div><div>No image file for&nbsp;<a href="http://www.idoimaging.com/cgi-sys/cgiwrap/acrabb/imaging/program.pl?ident=176">dcm4che</a>, the comprehensive DICOM Java library and related applications, which has another update out. &nbsp;This vast toolkit is all command-line business, specializing in PACS operations, networking, getting images from A to B with complete accuracy and great efficiency. &nbsp;How hard core is it? &nbsp;The 'che' is actually 'Che' as in Guevara - the developer was "<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; line-height: 17px; ">inspired by the revolutionary nature of open source". &nbsp;Some programs have a special place in my heart, but dcm4che has something even more special, a permanent place in my directory path. &nbsp;All my machines (from 6 to 60 of them depending on how you count them) have </span><span class="Apple-style-span" style="color: rgb(0, 0, 0); line-height: 17px; "><font class="Apple-style-span" face="'Courier New'" size="3"><span class="Apple-style-span" style="font-size: 12px;">/usr/local/dcm4che/bin</span></font></span><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; line-height: 17px; "> hard coded in my path (even Windows machines, since I do most of my work at the&nbsp;<span class="Apple-style-span" style="font-family: arial, helvetica, hirakakupro-w3, osaka, 'ms pgothic', sans-serif; line-height: normal; color: rgb(51, 51, 51); "><a href="http://www.cygwin.com">Cygwin</a><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; line-height: 17px; ">&nbsp;command line). &nbsp;For me, a standard step in getting any machine to a minimal functional state is to install Java and then dcm4che. &nbsp;In fact just today I was installing a WIndows 7 virtual machine (I run Parallels on the Mac), getting Java to install in C:\java, since the default '</span><span class="Apple-style-span" style="color: rgb(0, 0, 0); line-height: 17px; "><font class="Apple-style-span" face="'Courier New'" size="3"><span class="Apple-style-span" style="font-size: 12px;">Program Files (x86)</span></font></span><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; line-height: 17px; ">' directory causes all sorts of issues in the path, what with all those spaces and parentheses. &nbsp;dcm4che's sibling is dcm4chee (the 'e' is for 'Enterprise'), a powerful PACS server in Java that provides the core of my test lab.</span></span></span></div><div><font class="Apple-style-span" color="#000000" face="Helvetica, Arial, sans-serif"><span class="Apple-style-span" style="line-height: 17px;"><br /></span></font></div><div><br /></div>]]></description>
            <link>http://www.idoimaging.com/blog/2009/11/november-version-releases.html</link>
            <guid>http://www.idoimaging.com/blog/2009/11/november-version-releases.html</guid>
            
                <category domain="http://www.sixapart.com/ns/types#category">Imaging Software</category>
            
                <category domain="http://www.sixapart.com/ns/types#category">Osirix</category>
            
            
            <pubDate>Mon, 23 Nov 2009 20:34:09 -0500</pubDate>
        </item>
        
        <item>
            <title>Firefox Rules!</title>
            <description><![CDATA[<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="firefox.jpg" src="http://www.idoimaging.com/blog/blogimages/firefox.jpg" class="mt-image-left" style="margin: 0pt 20px 20px 0pt; float: left;" height="91" width="91" /></span><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="mozilla.jpg" src="http://www.idoimaging.com/blog/blogimages/mozilla.jpg" class="mt-image-right" style="margin: 0pt 0pt 20px 20px; float: right;" height="78" width="104" /></span>By which of course I mean, it rules the ratings.&nbsp; Though it could also be said to rule, because it is a really good browser and was the first real alternative to Internet Explorer, back in the days when it was called Mozilla.&nbsp; I kind of miss the old logo and the spirit of rebelliousness that came with not running Internet Explorer back in those heady days.&nbsp; Though if we're going to talk old web browsers I could hark back to 1993 and getting NCSA Mosaic for the first time...but I digress.<br /><br /><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.idoimaging.com/blog/blogimages/report_browser.html" onclick="window.open('http://www.idoimaging.com/blog/blogimages/report_browser.html','popup','width=1000,height=681,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.idoimaging.com/blog/blogimages/report_browser-thumb-300x204.png" alt="report_browser.png" class="mt-image-right" style="margin: 0pt 0pt 20px 20px; float: right;" height="204" width="300" /></a></span>So, these ratings.&nbsp; Here at I Do Imaging World HQ we (I) analyze the web logs on a regular schedule - given that I've done it twice,that is hard to disprove.&nbsp; And when I looked at the web browser statistics I see that some time around July, Firefox because the most popular web browser used to access this site.&nbsp; Of course, I credit my readers with being high achieving trend setters, so I don't know if this reflects the web use as a whole.&nbsp; Still, I think it's a significant point in Web history.&nbsp; Over the last two years, Internet Explorer has gone from almost 60% to just under 40% share, while Firefox has climbed from about 35% to just over 40%.&nbsp; Safari and Opera have seen modest gains, from about 5% to about 8% each, with Chrome, which of course didn't exist two years ago, now at about the same level.<br /><br />Any one of these is a perfectly good browser.&nbsp; In the last year I've been using Internet Explorer occasionally and have found that the latest release is actually really good.&nbsp; I've been using Firefox for so long that IE has caught up a lot.&nbsp; I use all five of these on the PC, on the Mac I use Safari, Firefox and Opera, and on Linux I run Firefox and Opera.&nbsp; I really like Opera, partly for their adherence to standards (though all browsers these days are pretty good about that), but also I like to stick up for the little guy.&nbsp; And, I can't shake the idea that any software from Scandinavia is just plain cool.<br /><br /><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.idoimaging.com/blog/blogimages/report_os.html" onclick="window.open('http://www.idoimaging.com/blog/blogimages/report_os.html','popup','width=1000,height=681,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.idoimaging.com/blog/blogimages/report_os-thumb-300x204.png" alt="report_os.png" class="mt-image-left" style="margin: 0pt 20px 20px 0pt; float: left;" height="204" width="300" /></a></span>On the operating system side, things are a little less dramatic.&nbsp; Most people still run Windows, though in two years this share has fallen from almost 90% to just over 80%.&nbsp; The Mac has seen a steady rise, growing 50% in share from about 8% to about 12%.&nbsp; Linux trucks along on the desktops of about 7% or so of the desktops of my readers.&nbsp; For years and years I was among those hard-core souls, using a Solaris or Fedora machine as my primary workstation, but recently I've found little reason to use any machine other than my Mac Pro.&nbsp; I still use it as a Unix workstation at the command line, but as far as my web stats are concerned, hello, I'm a Mac.<br /><br /></div><div><br /></div>]]></description>
            <link>http://www.idoimaging.com/blog/2009/11/firefox-rules.html</link>
            <guid>http://www.idoimaging.com/blog/2009/11/firefox-rules.html</guid>
            
            
            <pubDate>Sat, 21 Nov 2009 15:39:40 -0500</pubDate>
        </item>
        
        <item>
            <title>Mac OS 10.6 and Windows 7</title>
            <description><![CDATA[Two new OS releases in the last month and I've installed them both.<div><br /></div><div>My 10.6 / Snow Leopard Mac installations went smoothly though I've heard of friends who had issues during the installation. &nbsp;I did a reformat and fresh install as I do every time I install a new OS, not that it's necessary but it's good to know where you stand. &nbsp;Plus, it's an opportunity to look at what I have on the machine and how it's organized, and think about a better way to arrange things. &nbsp;I reinstall all the applications either from the DVD or download.</div><div><br /></div><div>The major issues I had with 10.6 were with Java incompatibilities. &nbsp;I can't connect to our VPN at work, though this is partly due to the VPN server software not being upgraded. &nbsp;Still, one would hope that changing versions of a language didn't break anything. &nbsp;I had another problem with a commercial Java-based imaging application, though the latest update fixed this. &nbsp;</div><div><br /></div><div>Overall the changes in 10.6 have been minor. &nbsp;The machine does boot faster though I don't often do this; the workstation stays on and the laptop goes to sleep between uses. &nbsp;Programs perhaps load a bit faster. &nbsp;I don't like the new Expose arrangement where all the mini windows are scaled to the same size, and arranged in a grid rather than in their approximate positions as used to be the case. &nbsp;I've always thought that people remember sizes and locations well - such as looking back through a newspaper for an article you've read, and remembering about where on the page it was. &nbsp;The new Expose behavior removes these visual cues. &nbsp;Hopefully they'll make it an option to turn off the new look.</div><div><br /></div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.idoimaging.com/blog/blogimages/macintosh.html" onclick="window.open('http://www.idoimaging.com/blog/blogimages/macintosh.html','popup','width=400,height=452,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.idoimaging.com/blog/assets_c/2009/10/macintosh-thumb-250x282.jpg" alt="macintosh.jpg" class="mt-image-left" style="margin: 0pt 20px 20px 0pt; float: left;" height="282" width="250" /></a></span><div>Windows 7 was a bit harder to install. &nbsp;Though I've had a Mac since 1985 I don't knock Windows, it's a good operating system. &nbsp;Neither do I disparage Vista which I've been running since it came out, with no problems, and find it better in every way to XP. &nbsp;I did have problems installing Windows 7 though. &nbsp;I did a fresh install, which I consider essential when upgrading Windows. &nbsp;In fact, once a year I reformat and reinstall, just to get rid of the detritus that has&nbsp;accumulated in the interim and is bogging the system down (this is one aspect of Windows I don't defend). &nbsp;</div><div><br /></div><div>In this case I had trouble getting the installation to start at all, the installer kept quitting. &nbsp;Once I got the install running, it would proceed to the final stage then freeze at "Completing Installation". &nbsp;I'd leave it there for an hour and nothing would happen. &nbsp;This seems to be a common problem as there were lots of accounts of it in Google. &nbsp;There were various suggestions to work around this problem:</div><div><br /></div><div><ul><li>Unplug USB devices</li><li>Disable USB in BIOS</li><li>Turn on SATA AHCI in BIOS</li><li>Reduce RAM to below 4 GB</li><li>Burn the installation DVD at lowest speed</li><li>Remove option cards</li><li>Upgrade BIOS</li></ul><div><br /></div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.idoimaging.com/blog/blogimages/time-machine.html" onclick="window.open('http://www.idoimaging.com/blog/blogimages/time-machine.html','popup','width=400,height=322,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.idoimaging.com/blog/assets_c/2009/10/time-machine-thumb-250x201.jpg" alt="time-machine.jpg" class="mt-image-right" style="margin: 0pt 0pt 20px 20px; float: right;" height="201" width="250" /></a></span><div>Of these the consensus seemed to be that Windows 7 can't handle USB keyboards during installation, and you have to find and use a PS/2 keyboard. &nbsp;What decade is this again? &nbsp;Fortunately I have a Napolen Dynamite time machine and was able to go back to 1982 and find a PS/2 keyboard. &nbsp;I don't know how people without a computer museum will cope.</div><div><br /></div><div>Since each installation attempt was taking over an hour, I performed all the recommended hacks and left the installation running overnight. &nbsp;Whether it was the 1980's keyboard or the leaving it for 12 hours, it eventually ground through the process.</div><div><br /></div><div>On the surface, Windows 7 looks and behaves a lot like Vista. &nbsp;It seems a little faster. &nbsp;It has the same insanely complex file protection labyrinth and kept insisting that I, the sole user and installer of the computer, "do not have permission" to delete my own files. &nbsp;And when I used Internet Explorer once, as I always do, to download Firefox, double-clicking on the file I just downloaded gives me the message "Windows cannot access the specified file. &nbsp;You may not have the appropriate permissions". &nbsp;I don't know why I defend Windows sometimes, I think it's more that I've lowered my expectations as to what it can do.<br /><br />Tracked that problem down eventually.&nbsp; I hadn't actually reformatted the disk as I should have, and while Windows put in a new copy of the Windows and Program Files directories, it kept my existing directories on C such as 'tmp' and 'cygwin', both of which I'd be using again.&nbsp; But these directories now belong to an unknown user despite being in my home directory.&nbsp; There is a very lengthy procedure I got through to reset the directorry ownership, and file permissions, and 'effective file permissions' because file permissions in Windows can mean almost anything, and whether this directory should inherit properties from its parents, and whether its subdirectories should inherit from it...and it gets more complex from there.&nbsp; After messing with this for an hour I did what I should have done initially, plug in the 1982 keyboard, boot from DVD, and this time delete and recreate the disk partition to be sure all my old files are dead and buried.&nbsp; I'm used to this sort of awfulness as a result of running Windows Server, but now it's made its way to desktop Windows.<br /></div></div>]]></description>
            <link>http://www.idoimaging.com/blog/2009/10/mac-os-106-and-windows-7.html</link>
            <guid>http://www.idoimaging.com/blog/2009/10/mac-os-106-and-windows-7.html</guid>
            
            
            <pubDate>Fri, 23 Oct 2009 08:40:42 -0500</pubDate>
        </item>
        
        <item>
            <title>Big Numbers in Perl</title>
            <description><![CDATA[A simple numerical overflow had been causing an error in my code for ages, and I just found it.  The problem arose from using numbers greater than 2^32 in Perl. I've become so used to 64-bit systems that I'd forgotten to check for it.<div><br /><div>I use powers of 2 to encode values such as file formats into a single numerical field in MySQL (which briefly was SunSQL and is now OracleSQL?).  So I have code that looks like:</div>
<div><br /></div><div><span class="Apple-style-span" style="font-family: 'Courier New'; "><span class="Apple-style-span" style="color: rgb(0, 64, 128);">our %cat_formats = (</span></span></div><div><div><span class="Apple-style-span" style="font-family: 'Courier New';"><span class="Apple-style-span" style="color: rgb(0, 64, 128);">  2**1  => ['DICOM'],</span></span></div><div><span class="Apple-style-span" style="font-family: 'Courier New';"><span class="Apple-style-span" style="color: rgb(0, 64, 128);">  2**2  => ['NEMA'],</span></span></div><div><span class="Apple-style-span" style="font-family: 'Courier New';"><span class="Apple-style-span" style="color: rgb(0, 64, 128);">  2**3  => ['Analyze'],</span></span></div><div><br /></div><div>and so on, adding the numbers together gives me a unique value, encoding combinations of values, which I can store in a BIGINT field in MySQL.  This was fine while I was listing 32 file formats or less, but I now list 36.  The test I had been using for matching a format-encoding value against the stored MySQL value is something like this, if I were testing for a value of 2.</div><div><br /></div><div><span class="Apple-style-span" style="font-family: 'Courier New';"><span class="Apple-style-span" style="color: rgb(0, 64, 128);">  $ret = (($readfmt * 1) &amp; 2) ? 1 : 0;</span></span></div><div><div><br /></div><div>I multiply the value by 1 to be sure it's in a numerical context, and I pedantically set the return value to 1 or 0 for consistency with cases where I might want to set it to something else. </div><div><br /></div><div>Problem was, this was returning true whenever the stored value was greater than 2^32, and I use the value 2^34 to denote NIFTI format.  So whenever I was testing for a value of 2 (denoting DICOM, common), I was returning true for any program that could read NIFTI format (somewhat rarer).  Which lead to the <a href="http://www.idoimaging.com/cgi-sys/cgiwrap/acrabb/imaging/program.pl?ident=164">FSL</a> program being listed as the second highest ranked DICOM viewing program.  Now FSL is a fine program, but sadly it cannot read DICOM.</div><div><br /></div><div>All I had to do to fix it was enable big numbers, and all was well.</div><div><br /></div><div><span class="Apple-style-span" style="font-family: 'Courier New';"><span class="Apple-style-span" style="color: rgb(0, 64, 128);">use bignum;</span></span></div><div><br /></div></div></div></div>]]></description>
            <link>http://www.idoimaging.com/blog/2009/04/big-numbers-in-perl.html</link>
            <guid>http://www.idoimaging.com/blog/2009/04/big-numbers-in-perl.html</guid>
            
                <category domain="http://www.sixapart.com/ns/types#category">Programming</category>
            
            
            <pubDate>Mon, 20 Apr 2009 23:54:09 -0500</pubDate>
        </item>
        
        <item>
            <title>Conflicting Reports on IE Market Share</title>
            <description><![CDATA[Internet Explorer 8 came out today, I've been using the beta a bit and it's actually pretty good.  I've never used IE routinely but as it renders pages differently <a href="http://www.answers.com/topic/different">from</a> other browsers, I use it for compatibility testing.  Come to that, I use lots of Microsoft products, I don't disparage them just because they're Microsoft.  I do prefer alternatives though, if they do what I need.<div><br /></div><div>So the news sites have the obligatory stories on IE's declining browser market share.  I came across <a href="http://www.wired.com/techbiz/it/news/2009/03/reuters_us_microsoft">this</a> gem of misinformation on Wired, from Reuters: </div><div><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: georgia; font-size: 14px; line-height: 17px; "></span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: georgia; font-size: 14px; line-height: 17px;"><br /></span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 0); line-height: 17px; "><span class="Apple-style-span" style="font-family: HelveticaNeue-LightItalic; font-size: 12px; font-style: italic;">According to a recent survey by IT consultants Janco Associates Inc, Internet explorer has a 72.2 percent market share, ahead of the Mozilla Foundation's Firefox browser with 17.2 percent. Google Inc's new Chrome browser has only 2.8 percent of the market, while Apple Inc's Safari has less than 1 percent.</span></span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: georgia; font-size: 14px; "><div><span class="Apple-style-span" style="line-height: 17px;"><br /></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: arial; font-size: 13px;">Not quite sure what they mean by 'recent', perhaps five years ago?  OK Chrome wasn't out then, but, still.  So I did a little survey of my own website stats going back to September 2007, when I switched to Google stats.</span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: arial; font-size: 13px;"><br /></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: arial; font-size: 13px;"><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.idoimaging.com/blog/blogimages/browser_share_sm.html" onclick="window.open('http://www.idoimaging.com/blog/blogimages/browser_share_sm.html','popup','width=1089,height=660,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.idoimaging.com/blog/blogimages/browser_share_sm-thumb-500x303.png" width="500" height="303" alt="browser_share_sm.png" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></a></span></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: arial; font-size: 13px;">So in 2007, IE's share was just under 60%, now it's just under 50%.  Firefox is up from 32% to almost 40%, Safari and Opera are trucking along at 4-5% each (though some stats sites have Safari at 8-9%), and Chrome is 3% and growing.</span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: arial; font-size: 13px;"><br /></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: arial; font-size: 13px;">I think it's safe to say my site does not attract a broad cross-section of society, which would explain why it leads the way in embracing the values of Anything But Microsoft.</span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: arial; font-size: 13px;"><br /></span></div></span></div><div><br /></div>]]></description>
            <link>http://www.idoimaging.com/blog/2009/03/conflicting-reports-on-ie-mark.html</link>
            <guid>http://www.idoimaging.com/blog/2009/03/conflicting-reports-on-ie-mark.html</guid>
            
            
            <pubDate>Thu, 19 Mar 2009 12:19:27 -0500</pubDate>
        </item>
        
        <item>
            <title>Lots of Screen Captures</title>
            <description><![CDATA[Recently I got around to another thing I've been meaning to do, which is to allow more than one screen capture per program.  I was getting pretty tired of seeing the same pictures, and plenty of programs have lots of sample images up on their web sites.  Part of the reason was laziness on my part, and part was poor software design.  I'm not sure which of these I feel better about.<div><br /></div><div>The software design aspect was something that has bitten me before, and I haven't learned. </div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="prog_208_anatomist_0_200_197.jpg" src="http://www.idoimaging.com/blog/blogimages/prog_208_anatomist_0_200_197.jpg" width="200" height="197" class="mt-image-right" style="float: right; margin: 0 0 20px 20px;" /></span><div> In my haste to get the screen captures feature implemented, I made 'screencap' a field of the 'program' table in the database.  This is easy: it only requires adding one field to the database and then remembering to extract the name of the screen capture image file when I retrieve the program's name, URL and so forth.  Of course, the limitation here is that there is only one field for a screen capture file so it doesn't scale nicely,  or at all.</div><div><br /></div><div>So I went back in recently and as usual improving the design took no time at all.  I made a new database table called 'image', which will be used to store the details of all images.  There's a field in the table that links back to the 'program' table, so with one more MySQL call I can get all the screen captures that relate to a program.  I should have done it this way to start with.</div><div><br /></div><div>Of course, once I started with the database table for the image files, new improvements suggested themselves.  The biggest gain is that I can now quickly pull up the exact size of an image and include this as part of the img tag in the HTML.  This should help the pages load faster as the browser now knows exact image sizes in advance, instead of having to load the images to determine their size.</div><div><br /></div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="prog_109_isosurf_0_109_200.jpg" src="http://www.idoimaging.com/blog/blogimages/prog_109_isosurf_0_109_200.jpg" width="109" height="200" class="mt-image-left" style="float: left; margin: 0 20px 20px 0;" /></span><div>The other improvement was to pre-calculate reduced size versions of each image capture file.  I use three sizes: full sized, for the popup screen captures, 320 pixel width for the pages of just screen caps, and 200 pixel width for the screen cap tooltip popup.  I have to admit that previously I'd been loading the entire image file even when it was just displayed at 320 pixel width.  With the reduced image files, the 320-width version can be 10 times smaller than the full size.  Needless to say I used <a href="http://www.imagemagick.org/script/perl-magick.php">PerlMagick</a>, the Perl API to ImageMagick, as I have hundreds of image files to process and am not fond of doing things by hand (I characterize this as Actual Work whereas programming is more along the lines of recreation).  The image-creating program got a bit involved, as it has to check for database duplicates, come up with unique image file names and so forth.  But the gist of the work is done in just a few lines:</div><div><br /></div><div><div><span class="Apple-style-span" style="font-family: 'Courier New';"><span class="Apple-style-span" style="font-size: 12px;"><span class="Apple-style-span" style="color: rgb(0, 64, 128);">        $image->Scale(width  => $newwidth,</span></span></span></div><div><span class="Apple-style-span" style="font-family: 'Courier New';"><span class="Apple-style-span" style="font-size: 12px;"><span class="Apple-style-span" style="color: rgb(0, 64, 128);">                      height => $newheight);</span></span></span></div><div><span class="Apple-style-span" style="font-family: 'Courier New';"><span class="Apple-style-span" style="font-size: 12px;"><span class="Apple-style-span" style="color: rgb(0, 64, 128);">        $image->Composite(image   => $magimage,</span></span></span></div><div><span class="Apple-style-span" style="font-family: 'Courier New';"><span class="Apple-style-span" style="font-size: 12px;"><span class="Apple-style-span" style="color: rgb(0, 64, 128);">                          compose => 'Atop',</span></span></span></div><div><span class="Apple-style-span" style="font-family: 'Courier New';"><span class="Apple-style-span" style="font-size: 12px;"><span class="Apple-style-span" style="color: rgb(0, 64, 128);">                          gravity => 'SouthEast');</span></span></span></div><div> </div>

<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="prog_276_mevis_3_320_236.jpg" src="http://www.idoimaging.com/blog/blogimages/prog_276_mevis_3_320_236.jpg" width="320" height="236" class="mt-image-right" style="float: right; margin: 0 0 20px 20px;" /></span>

<div>
The first bit does the scaling, obviously, and the second adds the little magnifying glass icon to the bottom right corner.  I'd pre-calculated this to be 40% transparent so it doesn't overpower the screen cap image.  Now that I've put the work into writing a program to create the reduced size image files, I can easily change their size or add a new size.  Should have done it this way the first time.</div><div><br /></div><div>The screen caps on this page are largely gratuitous.  And they're all volume renderings because they just look good.  All the programs that do volume renderings do a lightbox view as well, but for the purposes of general illustration the volume renderings work well.  And I have plenty of images to use, I just added 170 so now have just over 300 screen caps.  I started with the most active programs and now slowly I'm working my way through all the programs, visiting their websites and capturing images (I'm up to 'D').  Programs that I have personally used often have a capture of my own MRI.</div><div><br /></div><div><br /></div><div><br /></div></div>]]></description>
            <link>http://www.idoimaging.com/blog/2009/03/lots-of-screen-captures.html</link>
            <guid>http://www.idoimaging.com/blog/2009/03/lots-of-screen-captures.html</guid>
            
            
            <pubDate>Wed, 18 Mar 2009 21:40:44 -0500</pubDate>
        </item>
        
        <item>
            <title>Icons Worth One Word Each</title>
            <description><![CDATA[A month ago I added icons to most program names and listings, to show the platform the program runs on, and its user interface.  I used to have this information only listed on each program's page but I'd like to make it more obvious before you click on a program, what it runs on, and whether it's GUI or not.  I try not to use images where words can work, but words like 'Windows' take up a lot of horizontal space. <br /><br />


So this guy and its permutations are for the operating systems.  To get them to line up
 
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="plat_win_mac_linux.png" src="http://www.idoimaging.com/blog/blogimages/plat_win_mac_linux.png" class="mt-image-left" style="margin: 10px; float: left;" height="16" width="54" /></span>

when stacked above each other in a table, I made all the constituent icons 16 pixels wide 
with a 1-pixel space either side.  So the 3-wide icon group is always 54 pixels wide.  The icons themselves I made up myself just by shrinking logos and then cleaning them up a bit with a graphics program.  I put them together along with 16-pixel wide transparent spacers using the amazing <a href="http://www.imagemagick.org/">ImageMagick</a>.  They're actually 50% transparent as with so many of them on a page, they were looking a bit overpowering, particularly the Apple icon.  <br /><br />

The interface icons are a bit less intuitive, and I debated whether to include them.  I have hover-text explanations on them so after reading that once or twice I hope it'll be 

<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="interface_gui_cmd_lib.png" src="http://www.idoimaging.com/blog/blogimages/interface_gui_cmd_lib.png" class="mt-image-right" style="margin: 10px; float: right;" height="16" width="54" /></span>

clear what they mean (they are 'GUI', 'Command Line', and 'Library', in that order).  They're also 16 pixels wide; I got them from <a href="http://www.famfamfam.com/lab/icons/silk/">famfamfam's</a> beautiful 'Silk' icon set.  Categorizing by interface probably isn't as important to a lot of users, particularly as most Windows programs are GUI, but for Linux (and hence Mac) power users, it's nice to be able to find the command line programs.  And for super users, programs that provide programming libraries or APIs are just wonderful.<br /><div><br />The name of the icon group is systematic so I can create it in the CGI programs, the image files are named like <span class="Apple-style-span" style="font-family: 'Courier New';">plat_win_mac_linux.png</span> for all 3 platforms as above, or <span class="Apple-style-span" style="font-family: 'Courier New';">plat__mac_.png</span> for just Macintosh.   I put them into groups of 3 to avoid lots of little sub-tables, or tables with dozens of columns, and yet still get them nicely aligned horizontally.  They seem to load pretty quickly despite the front page having 68 of the platform and interface icons.  They're only about 2 kB each (ImageMagick is frugal with bytes) and the browser will cache them, so they each should only need to be loaded once.  <br /><br />The tip text Javascript comes from <a href="http://dyn-web.com/">Dynamic Web Coding's</a> 'Tooltip' library.  This is a really nicely designed and implemented library with all sorts of features.  I felt guilty for not learning Javascript and doing it myself, but this passed in about 10 seconds.  This is a good library and I'm fine with licensing someone else's code.  I next want to incorporate their 'Scrolling Divs' library for the screen capture images. <br /></div>]]></description>
            <link>http://www.idoimaging.com/blog/2009/03/icons-worth-one-word-each.html</link>
            <guid>http://www.idoimaging.com/blog/2009/03/icons-worth-one-word-each.html</guid>
            
                <category domain="http://www.sixapart.com/ns/types#category">idoimaging.com</category>
            
            
            <pubDate>Wed, 18 Mar 2009 20:43:25 -0500</pubDate>
        </item>
        
        <item>
            <title>February Updates</title>
            <description><![CDATA[I've recently added a number of version updates after a delay of a month.&nbsp; I was working on changing the data structures I use within the CGI programs, so that I could easily pass around more information about each program.&nbsp; I want to include with the internal object I pass around, such peripheral information as the name of the screen capture and thumbnail image files, and their sizes.&nbsp; That's done now, so I have caught up with some new versions, some of which are listed here.<br /><br />&nbsp;<a href="http://www.idoimaging.com/cgi-sys/cgiwrap/acrabb/imaging/program.pl?ident=334">Vinci</a> is a remarkable program from Stefan Vollmar and group at the Max Planck Institute for Neurological Research, in Cologne.&nbsp; It is an extremely advanced analysis tool for neurological images, particularly PET.&nbsp; I use this program daily and still am discovering functions and features I didn't know were in the program.&nbsp; That said, it would also be possible to use it simply for image viewing; it handles a wide range of input formats, and also conversions.&nbsp; In the area of functional analysis, it has few peers.<br /><br /><a href="http://www.idoimaging.com/cgi-sys/cgiwrap/acrabb/imaging/program.pl?ident=283">Loni Debabler</a> is another huge program from the extremely prolific LONI group at UCLA.&nbsp; It takes an ambitious and interesting approach to image file conversion, providing a specialized programming environment for reading, manipulating and writing image files.&nbsp; This is all controlled through a graphical programming environment, and processing schemas are stored as XML files.&nbsp; Sample conversion programs are provided for the most usual image formats, or you can develop your own.&nbsp; This is a program I've not yet used as much as I want to, its internals are complex but it's tackling a difficult job.&nbsp; I have to admit I've only used and modified the pre-programmed sample files.<br /><br /><div><a href="http://www.idoimaging.com/cgi-sys/cgiwrap/acrabb/imaging/program.pl?ident=137"> PixelMed Java DICOM Toolkit</a> is another advanced project, providing an extremely comprehensive implementation of DICOM tools.&nbsp; It comes from David Clunie, a name familiar to everyone who has done any work at all in the field of DICOM programming.&nbsp; This toolkit will provide more functionality than most people can utilize and comes from the foremost authority.&nbsp; It is updated extremely frequently, such that version numbers are not used.&nbsp; It's difficult to convey on my site how frequently it is released, as almost all other projects release versions on a monthly to annual basis.&nbsp; This software is revised almost weekly.&nbsp; Perhaps I should make it a 'sticky' at the top of the 'New Releases' list.<br /><br />Another very comprehensive library, in C++ this time, is <a href="http://www.idoimaging.com/cgi-sys/cgiwrap/acrabb/imaging/program.pl?ident=340">Imebra</a> from Paolo Brandoli, of PuntoExe software.&nbsp; Here is another true open source program, where the free version is identical to the commercial, and source code is provided in both cases.&nbsp; This project has recently gained its own website (imebra.com), and related projects based on the library are at the Puntoexe website.<br /><br /><a href="http://www.idoimaging.com/cgi-sys/cgiwrap/acrabb/imaging/program.pl?ident=299">DP Tools</a>, from Denis Ducreux, is another active program.&nbsp; It specializes in the field of functional MRI and MR Diffusion.&nbsp; I know nothing about this field but have seen an increasing amount of excellent software emerging.&nbsp; It's written in Delphi, in common with some of <a href="http://www.idoimaging.com/cgi-sys/cgiwrap/acrabb/imaging/people.pl?ident=15">Chris Rorden's</a> very widely used imaging software.&nbsp; I am also profoundly ignorant of Delphi, I seem to be exposing my weaknesses here.<br /><br /><a href="http://www.idoimaging.com/cgi-sys/cgiwrap/acrabb/imaging/program.pl?ident=300">ITK-SNAP</a> is another specialized neuro program, this time for segmenting brain images.&nbsp; It incorporates elements of the NLM <a href="http://www.idoimaging.com/cgi-sys/cgiwrap/acrabb/imaging/program.pl?ident=193">Insight Segmentation and Registration Toolkit</a>, hence the name.&nbsp; Formerly developed at UNC-Chapel Hill and now at Penn, this project provides automatic and manual brain segmentation methods.&nbsp; It's cross-platform. <br /><br /><a href="http://www.idoimaging.com/cgi-sys/cgiwrap/acrabb/imaging/program.pl?ident=198">TomoVision</a> is a little program that displays DICOM images and doesn't do much else.&nbsp; And, the free version is limited to 5 images.<br /><br /><a href="http://www.idoimaging.com/cgi-sys/cgiwrap/acrabb/imaging/program.pl?ident=309">MedImaView</a> has a new version out.&nbsp; It's another small DICOM viewer, when I tried it just now I could only open multiple files via drag and drop, and when I dropped a 192-frame MRI sequence I got: 192 windows.&nbsp; Hmmm.<br /><br /><br /></div><div><br /></div>]]></description>
            <link>http://www.idoimaging.com/blog/2009/02/february-updates.html</link>
            <guid>http://www.idoimaging.com/blog/2009/02/february-updates.html</guid>
            
            
            <pubDate>Thu, 26 Feb 2009 21:51:05 -0500</pubDate>
        </item>
        
        <item>
            <title>Sed Cleverness</title>
            <description><![CDATA[I got <span class="Apple-style-span" style="font-weight: bold;">sed</span> to do something clever today, though sadly the cleverness was not mine.  I tried to solve the problem myself and although in the process I learned a great deal about sed, I had to resort to copying the answer.<div><br /></div><div>I want to add Google Analytics code to my sister's <a href="http://www.careme.co.nz">website</a>, which she's writing using iWeb.  Analytics is enabled by including in your HTML a javascript snippet that Google gives you.  iWeb does a really nice job, but you have to do things their way, and that means no javascript.  Fair enough, I guess, Apple want to be ensure that websites produced using their software will always work, and introducing a programming language pretty much ensures that things frequently won't work.</div><div><br /></div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.idoimaging.com/blog/blogimages/cyberduck.png"><img alt="cyberduck.png" src="http://www.idoimaging.com/blog/assets_c/2009/02/cyberduck-thumb-110x108.png" width="110" height="108" class="mt-image-left" style="float: left; margin: 0 20px 20px 0;" /></a></span><div>The website is hosted on a Linux server, not an Apple account, so to publish the site we export its contents to a directory, then FTP the directory contents to the server.  Initially we used Filezilla but it does not have incremental directory synchronization, so we switched to the awesome <a href="http://cyberduck.ch/">Cyberduck</a>.</div><div><br /></div><div>So my first thought was, well perhaps we can modify the HTML files before they leave her Mac.  There are a couple of approaches available, one is an iWeb add-on which looked more complex than needed, and you have to buy it.  Another was an Automator action you can download that will insert the Google javascript into the HTML files.  That sounded good but was one more action to perform, and I've never used Automator.</div><div><br /></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="sedawk.gif" src="http://www.idoimaging.com/blog/blogimages/sedawk.gif" width="145" height="190" class="mt-image-right" style="float: right; margin: 0 0 20px 20px;" /></span></div><div>So I thought, I'll knock up a little script that the web server can run as an hourly cron job, and edit any HTML files that don't contain the Google code.  Ha!  Little script though it is, it took a while.  I got a lot of help from <a href="http://www.grymoire.com/Unix/Sed.html">Bruce Barnett's sed guide</a>, as I don't have a good shell book with me right now.  I should buy O'Reilly's 'Sed &amp; Awk' book, a classic if ever there was one, and I believe may even have been their first ever book published. I remember it in print in the early 90's, and they even had a T shirt of the cover, which I dearly wish I'd bought.</div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><br /></span><div>The tricky part was, the Google code is supposed to be included immediately before the <span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 12px;">&lt;/body></span> tag in each HTML page.  Two problems: I couldn't be sure that the <span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 12px;">&lt;/body></span> tag would be on a line by itself, and sed file inclusion acts after the matched pattern, not before.</div><div><br /></div><div>Problem 1 was addressed using a simple substitution with newlines:</div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New'; "><span class="Apple-style-span" style="color: rgb(0, 64, 128);"><span class="Apple-style-span" style="font-size: 12px;">sed -e '</span></span></span><span class="Apple-style-span" style="font-family: 'Courier New'; "><span class="Apple-style-span" style="color: rgb(0, 64, 128);"><span class="Apple-style-span" style="font-size: 12px;"></span></span></span></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New'; "><span class="Apple-style-span" style="color: rgb(0, 64, 128);"><span class="Apple-style-span" style="font-size: 12px;">s|&lt;\/body>|\</span></span></span><span class="Apple-style-span" style="font-family: 'Courier New'; "><span class="Apple-style-span" style="color: rgb(0, 64, 128);"><span class="Apple-style-span" style="font-size: 12px;"></span></span></span></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New'; "><span class="Apple-style-span" style="color: rgb(0, 64, 128);"><span class="Apple-style-span" style="font-size: 12px;">&amp;\</span></span></span><span class="Apple-style-span" style="font-family: 'Courier New'; "><span class="Apple-style-span" style="color: rgb(0, 64, 128);"><span class="Apple-style-span" style="font-size: 12px;"></span></span></span></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New'; "><span class="Apple-style-span" style="color: rgb(0, 64, 128);"><span class="Apple-style-span" style="font-size: 12px;">|</span></span></span><span class="Apple-style-span" style="color: rgb(63, 118, 216); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;"></span></span></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="color: rgb(63, 118, 216); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">' </span></span><span class="Apple-style-span" style="font-size: 12px;"><br /></span></blockquote><div><div>I used pipe-character delimiters.  The substitution is of the string <span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 12px;">&lt;/body></span>, and the newlines are inserted literally.  So the line-continuation backslashes continue the substitution pattern.  The ampersand is the matched string, so this substitution puts a newline before and after the <span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 12px;">&lt;/body></span> tag, to ensure it's on its own line.</div><div><br /></div><div>Problem 2 was harder.  I didn't know about the file-insertion operator till today, though I figured that sed would have one.  It does, but it inserts after the matched pattern.  My initial approach to insert the file Google Analytics Javascript code, <span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 12px;">ga.js</span> was:</div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">sed -e '                                                                                       </span></span><span class="Apple-style-span" style="font-size: 12px;"><br /></span><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">/&lt;\/body>/ {                                                                                       </span></span></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">r ga.js'</span></span></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">}   </span></span><span class="Apple-style-span" style="font-size: 12px;"><br /></span></blockquote><div><div><div>But this inserted the file after the <span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 12px;">&lt;/body></span> tag, which wasn't allowed.  </div><div><br /></div><div>Next thought was to take a two-way approach.  I'd print every line not matching the <span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 12px;">&lt;/body></span> pattern, and in a separate rule matching the <span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 12px;">&lt;/body></span> pattern, delete the pattern, insert the file, then print the pattern.</div></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">sed -e '</span></span></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">/&lt;\/body>/ !{</span></span><span class="Apple-style-span" style="font-size: 12px;"><br /></span><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">p</span></span><span class="Apple-style-span" style="font-size: 12px;"><br /></span><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">}</span></span><span class="Apple-style-span" style="font-size: 12px;"><br /></span><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">/&lt;\/body>/ {</span></span><span class="Apple-style-span" style="font-size: 12px;"><br /></span><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">r ga.js</span></span></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">d<br /></span></span><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">p</span></span><span class="Apple-style-span" style="font-size: 12px;"><br /></span><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">}'                                                                                                 </span></span></blockquote><div><div><div><div>Not to be.  The pattern matching quits at the delete as explained by Barnett, so the print command is never executed.</div><div><br /></div><div>At this point after some hours of learning sed, I looked for an answer to inserting a file before a sed pattern, and found one.  At least by this point I knew enough to understand it (sort of).  This <a href="http://www.usenet-forums.com/linux-general/74791-sed-insert-file-current-line.html">post</a> by <span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; ">Tapani Tarvainen gave me a very succinct answer for the second pattern action:</span></div><div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;"><br /></span></div></div></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">/&lt;\/body>/ {</span></span></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">r ga.js</span></span></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; "><span class="Apple-style-span" style="font-size: 12px;">' -e N -e '}'</span></span></blockquote><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;"><br /></span></blockquote><div>OK I wouldn't have thought of that one.  As he explains,</div><div> </div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; "><span class="Apple-style-span" style="font-style: italic;">The 'r' command actually outputs the file just before reading<span class="Apple-style-span" style="font-family: arial; font-size: 13px;"> </span></span></span><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; "><span class="Apple-style-span" style="font-style: italic;">a new line to the pattern buffer (or at EOF). That can be forced<span class="Apple-style-span" style="font-family: arial; font-size: 13px;"> </span></span></span><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; "><span class="Apple-style-span" style="font-style: italic;">in mid-script by 'n' or 'N', and while 'n' will also print the</span></span><span class="Apple-style-span" style="font-style: italic;"><br /></span><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; "><span class="Apple-style-span" style="font-style: italic;">buffer before 'r' does its thing.</span></span></blockquote><div><br /></div><div>He goes on to cover more general cases.  There is also another approach described in the same forum which employs use of the hold command, h, and the swap operator, x.</div><div><br /></div><div>Having tested the code that does the file insertion, I put it into a shell script that finds all *.html files, checks to see if they have the GA code in them already (you're only allowed to put it in once), and if not, performs the insertion.</div><div><br /></div><div>Next problem...the ISP's server doesn't offer cron!  I need this to run the sed script on the HTML files without having to ssh in to run it.  Aargh.  Neither can I execute an arbitrary command on the server using my FTP client.  I might try making a passwordless ssh script (using id_rsa.pub keys) and then see if I can get Cyberduck (FTP client) to run that after it performs the transfer.</div><div><br /></div><div>That's enough for one day, though.  I learned a lot about sed, and a lot about how much I don't know.</div><div><br /></div>]]></description>
            <link>http://www.idoimaging.com/blog/2009/02/sed-cleverness.html</link>
            <guid>http://www.idoimaging.com/blog/2009/02/sed-cleverness.html</guid>
            
                <category domain="http://www.sixapart.com/ns/types#category">Programming</category>
            
            
            <pubDate>Sun, 08 Feb 2009 00:24:24 -0500</pubDate>
        </item>
        
        <item>
            <title>Mathematical Cluelessness in the Media</title>
            <description><![CDATA[It can be hard to find an error-free article that involves any use of ratios, units, or simple mathematics (if you can call adding and multiplying numbers, mathematics).  The use of numbers seems to cause writers to abandon any attempts at checking, despite the skills involved being high school level or below.  I think I'll start collecting them.<div><br /></div><div>Today's entry, that all-time classic, confusing power with energy.  There's an article in <a href="http://blog.wired.com/wiredscience/2009/01/vegawatt.html">Wired</a> today about a device that burns waste restaurant oil (though the writer incorrectly calls it 'grease').  </div><div><br /></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: georgia; font-size: 14px; line-height: 17px; ">"Put 80 gallons of grease into the Vegawatt each week, and its creators promise it will generate about 5 kilowatts of power."</span></blockquote><div><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: georgia; font-size: 14px; "><div><span class="Apple-style-span" style="line-height: 17px;"><span class="Apple-style-span" style="line-height: normal; "><div><span class="Apple-style-span" style="line-height: 17px;"><br /></span></div></span></span></div></span></div><div>Only, a gallon of oil is a measure of energy, but a kilowatt is a measure of power.  Energy is measured in joules (or any other energy unit, calories, BTUs, whatever).  A joule is a watt-seconds, watts times seconds.  Watts (power) are joules per second, the amount of work done per time, or the rate of energy conversion.  The key being, energy is a scalar, power is a rate.</div><div><br /></div><div>So does this thing produce 5 kilowatts for the full 168 hours of the week, or some lesser period?    The writer doesn't say and probably doesn't know.  Assuming it produces the 5 kW continuously, it would then do 5 x 168 = 840 kilowatt-hours (kWh) of work per week.  840kWh is worth about $126, with power costing about 15c per kWh.  So 80 gallons is supposed to generate $126 worth of electricity, say $1.50 per gallon.</div><div><br /></div><div>The writer goes on: </div><div><br /></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: georgia; font-size: 14px; line-height: 17px; ">At New England electricity rates, the system offsets about $2.50 worth of electricity with each gallon of waste oil poured into it.</span></blockquote><div><br /></div><div></div><div>So now he's saying a gallon of waste oil generates 25 kWh of electricity, or $2.50 worth of electricity per gallon.  Wait, didn't he just say $1.50 per gallon?</div><div><br /></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">Vegawatt's founder and inventor, James Peret, estimates that restaurants purchasing the $22,000 machine will save about $1,000 per month in electricity costs, for a payback time of two years.</blockquote><div><br /></div><div>OK so they're claiming $1,000 a month, or 10,000 kWh of electricity, or about 14 kW continuous (hey it might be a 24 hour restaurant...).   Depending on which of his numbers you go with ($2.50 or $1.50 of electricity per gallon of oil), that's between 400 and 660 gallons of oil a month.  The only number he gives though is 80 gallons a week or about 330 a month.  These numbers are not astonishingly out, only a factor of 2, not bad for general writing.</div><div><br /></div><div>I just saw this <a href="http://en.wikipedia.org/wiki/Watt#Confusion_of_watts_and_watt-hours">article on the Watt</a> in Wikipedia which has a section 'Confusion of watts and watt-hours'.  "Power and energy are frequently confused in the media", it says.  No kidding.</div><div><br /></div>]]></description>
            <link>http://www.idoimaging.com/blog/2009/01/mathematical-cluelessness-in-t.html</link>
            <guid>http://www.idoimaging.com/blog/2009/01/mathematical-cluelessness-in-t.html</guid>
            
            
            <pubDate>Thu, 08 Jan 2009 09:13:50 -0500</pubDate>
        </item>
        
        <item>
            <title>Perl Hashes Ate My Workstation</title>
            <description><![CDATA[Perl is not noted for its leanness but today I finally ran some little tests to see just how much memory it was devouring.  I use some OO Perl code to process image files, there is a base class Image::Med from which are derived Image::Med::DICOM, Image::Med::Analyze, and a few others.  I store each DICOM element in an object instantiated as a hash; it's of class Image::Med::DICOM::DICOM_element which is derived from a base class Image::Med::Med_element.  The inheritance works quite well and I'm able to move most of the functionality into the base classes, so adding new subclasses for different file formats is reasonably easy.<div><br /></div><div>Perl hashes are seductive, it's so easy to add elements and things tend to just work.  So my derived DICOM element class ends up having 13 elements in its hash, of which 10 are in the base class ('name', 'parent', 'length', 'offset' and so on) and three are added in the derived class ('code', 'group', 'element') as being DICOM-specific.</div><div><br /></div><div>As mentioned, I never claim Perl is svelte (or fast) but today I was sorting about 2,000 DICOM files.  I like to keep them all in memory, for convenience and sorting, before writing or moving to disk.  Heck we're only talking about a few thousand things here and computers work in the billions...all too easy to forget about memory usage.</div><div><br /></div><div>I was unpleasantly surprised to find that each time I read in a DICOM file of just over 32 kB (PET scans are small, 128 x 128 x 2 bytes), I was consuming over 300 kB of memory.  So my full dataset of only 70 MB was using up almost a GB of RAM.  And that was for only 2,100 files, whereas I have one scanner that generates over 6,500 DICOM files per study.  I have the RAM to handle it, but my inner CS grad has a problem with a tenfold usage of memory.</div><div><br /></div><div>I used the Perl module Devel::Size to measure the size of hashes and the answers aren't pretty: on my 64-bit Linux workstation each hash element is consuming 64 bytes in overhead.  Crikey!  So 64 bytes, times 13 fields per DICOM element, times 200-odd DICOM elements per object, that's over 200 kB per DICOM object before I even put any data into it.</div><div><br /></div><div>On my 64-bit Mac with perl 5.8.8 it's not much better at 39 bytes per minimal element.  I compared it with an array, which turned out to use 16 bytes per minimal element.</div><div><br /></div><div><div><span class="Apple-style-span" style="color: rgb(0, 64, 128); font-family: 'Courier New'; font-size: 11px;"><div>#! /usr/local/bin/perl -w                                                                                                      </div><div><br /></div><div>use Devel::Size 'total_size';</div><div><br /></div><div>my %h = ();</div><div>print "0 hash elements, size = " . total_size(\%h) . "\n";</div><div>$h{'a'} = 1;</div><div>print "1 hash elements, size = " . total_size(\%h) . "\n";</div><div>$h{'b'} = 2;</div><div>print "2 hash elements, size = " . total_size(\%h) . "\n";</div><div><br /></div><div>my @a = ();</div><div>print "0 array elements, size = " . total_size(\@a) . "\n";</div><div>$a[0] =<span class="Apple-tab-span" style="white-space:pre">	</span>1;</div><div>print "1 array elements, size = " . total_size(\@a) . "\n";</div><div>$a[1] =<span class="Apple-tab-span" style="white-space:pre">	</span>2;</div><div>print "2 array elements, size = " . total_size(\@a) . "\n";</div></span></div><div><br /></div><div><div><span class="Apple-style-span" style="color: rgb(64, 128, 0); font-family: 'Courier New'; font-size: 11px;"><div>[widget icon] 167% ~/tmp/hashsize.pl</div><div>0 hash elements, size = 92</div><div>1 hash elements, size = 131</div><div>2 hash elements, size = 170</div><div>0 array elements, size = 56</div><div>1 array elements, size = 88</div><div>2 array elements, size = 104</div><div><br /></div></span></div><div>I know the answer is, don't use giant hashes in Perl, or perhaps it is, don't use Perl when you're manipulating 2,000 x 200 x 13 elements.  But I like Perl, it's so convenient.  Perhaps I'll reimplement the whole thing as an array (ugh), and/or cut down the number of elements per DICOM field (indexing a 13-element array, not fun).</div></div><div><br /></div></div>]]></description>
            <link>http://www.idoimaging.com/blog/2009/01/perl-hashes-ate-my-workstation.html</link>
            <guid>http://www.idoimaging.com/blog/2009/01/perl-hashes-ate-my-workstation.html</guid>
            
                <category domain="http://www.sixapart.com/ns/types#category">Programming</category>
            
            
            <pubDate>Wed, 07 Jan 2009 21:36:15 -0500</pubDate>
        </item>
        
        <item>
            <title>72,000 visitors in 2008</title>
            <description><![CDATA[Well I didn't make 100,000 visits as I hoped but I got close.  As of yesterday's stats I had 98,517 visits from 71,701 visitors according to Google Analytics, plus today will be 300 or so.  Other stats: busiest day (4 March) 403 visits from 348 people, quietest day (28 December) 101 visits from a mere 88 people.<div><br /></div><div>The average visit is 4 pages in about 4 minutes.  An ad gets clicked on 2% of the time it's shown, so roughly 8% or one visitor in 12 clicks on an ad, which indicates they're pretty well targeted.  Just under half the people (46%) leave in under 10 seconds, but some of these might very well be people who immediately clicked on the site they were looking for.  So I'm going to count some of them as satisfied customers (Google rather disparagingly calls this the 'Bounce Rate').  </div><div><br /><div>You can see Internet Explorer's market share slipping before your eyes: in the first three months of 2008 it was 55% IE, 33% Firefox, in the last three months it was 49% IE, 38% Firefox, while Safari and Opera had about 5% each, and Chrome, 2%.  And I'm pleased to see the Macintosh market share increase over the same period, from 7.1% to 8.9%.  Even a few iPhones in there, including mine.</div><div><br /></div><div>Goals for 2009:</div><div><br /></div><div><ol><li>100,000 visitors</li><li>5 minutes and 5 pages per visit</li><li>Less than 40% bounce rate</li></ol></div><div>These are ambitious goals but I'll try to make them happen.  I made a start this September when I redid the site design and colors.  I hadn't changed anything since 2002 and it was showing - for the first time, I had fewer same-month visits, by 13%, than the previous year. </div><div><br /></div><div style="text-align: center;"><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><form mt:asset-id="15" class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.idoimaging.com/blog/blogimages/visits080815.png"><img alt="visits080815.png" src="http://www.idoimaging.com/blog/blogimages/visits080815-thumb-500x143.png" width="500" height="143" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></a></span></form></div><div style="text-align: center;"><div style="text-align: left;">After  making the changes, over the past month I have 6% more visitors than the same period last year.</div><div style="text-align: left;"><br /></div></div><div style="text-align: center;"><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.idoimaging.com/blog/blogimages/visits081115.png"><img alt="visits081115.png" src="http://www.idoimaging.com/blog/blogimages/visits081115-thumb-500x141.png" width="500" height="141" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></a></span></div></div><div>Hopefully this indicates I'm on the right track.</div><div><br /></div>]]></description>
            <link>http://www.idoimaging.com/blog/2008/12/72000-visitors-in-2008.html</link>
            <guid>http://www.idoimaging.com/blog/2008/12/72000-visitors-in-2008.html</guid>
            
                <category domain="http://www.sixapart.com/ns/types#category">idoimaging.com</category>
            
            
            <pubDate>Wed, 31 Dec 2008 17:09:21 -0500</pubDate>
        </item>
        
        <item>
            <title>Wider Pages, Immediately Filled</title>
            <description><![CDATA[I've widened the page layout to 920 pixels, from the previous 728 pixels which is the width of a Google ad block (seemed as good a width as any to choose). &nbsp;However some pages, particularly the 'Programs' page, were looking squashed. &nbsp;I looked at a few high volume sites (New York Times, Facebook, EBay) and they seem to have settled on 1000 pixels as the default width - any less than that and you get horizontal&nbsp;scroll bars. &nbsp;My website stats tell me that 98% of visitors have a horizontal screen resolution of greater than 1000 (though 20% are just over, at 1024 x 768, boy it's been a while since I saw a screen that size).
<div><br /></div>
<div>So 920 is the new width, though using the awesome 'Inspect Element' tag in&nbsp;<a href="http://www.google.com/chrome">Google Chrome</a>, I can see that some pages appear to spill over a little.</div>
<div><br /></div>
<div style="TEXT-ALIGN: center"><span class="Apple-style-span" style="COLOR: rgb(0,0,238); TEXT-DECORATION: underline">
<span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline"><a href="http://www.idoimaging.com/blog/blogimages/Capture.PNG"><img class="mt-image-center" style="DISPLAY: block; MARGIN: 0px auto 20px; TEXT-ALIGN: center" height="370" alt="Capture.PNG" src="http://www.idoimaging.com/blog/assets_c/2008/12/Capture-thumb-500x370.png" width="500" /></a></span></span></div>

<div>(In the course of this, I&nbsp;<a href="http://windowshelp.microsoft.com/Windows/en-US/Help/1337cdba-52a2-4704-ad4d-2d7bace605b41033.mspx">read</a>&nbsp;how to simulate the missing 'delayed capture' feature in the otherwise great Vista 'Snipping Tool'. &nbsp;Open Snipping Tool, press Esc, compose your picture, press Ctrl-PrintScreen to freeze as-is, drag over the now-frozen screen to capture).</span></form></span></div>

<div><br /></div>

<div>Now that I have additional width, I immediately filled half the new space with icons. &nbsp;I've resisted using them to now, partly to get more information in per line, and partly because I think that a textual interface is more efficient. &nbsp;But I have to admit that well-designed sites that use icons well, do look better (and now I'm half-way there, in that I use icons. &nbsp;Now I just have to get a good design). &nbsp;I used the beautiful 'Silk' icons from <a href="http://www.famfamfam.com/">Mark James's famfamfam.com</a>, a lovely set of exactly 1,000 icons in 16x16 pixel PNG format. &nbsp;They are, as he says, "strokably soft".</div>
<div><br /></div>
<div>Not every idea I wanted to convey had an exactly-matching icon, so I chose those I thought best fitting. &nbsp;So for program interfaces now I have&nbsp;<img class="mt-image-none" height="16" alt="image.png" src="http://www.idoimaging.com/blog/blogimages/image.png" width="16" />&nbsp;for 'GUI',&nbsp;<img class="mt-image-none" height="16" alt="application_osx_terminal.png" src="http://www.idoimaging.com/blog/blogimages/application_osx_terminal.png" width="16" />&nbsp;for 'Command Line', and&nbsp;<img class="mt-image-none" height="16" alt="application_edit.png" src="http://www.idoimaging.com/blog/blogimages/application_edit.png" width="16" />&nbsp;for 'API/Programming'. &nbsp;Hopefully they get the idea across, and I added tool tips for clarification. &nbsp;They are very pretty, but do take up some of my precious horizontal width. &nbsp;</div>
<div><br /></div>
<div>
<span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline"><a href="http://www.idoimaging.com/blog/blogimages/Capture2.PNG"><img class="mt-image-center" style="DISPLAY: block; MARGIN: 0px auto 20px; TEXT-ALIGN: center" height="124" alt="Capture2.PNG" src="http://www.idoimaging.com/blog/blogimages/Capture2-thumb-500x124.png" width="500" /></a></span></div>
<div>
<span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline">The other icons I use are&nbsp;<img class="mt-image-none" height="16" alt="arrow_right.png" src="http://www.idoimaging.com/blog/blogimages/arrow_right.png" width="16" />&nbsp;for 'Link to site',&nbsp;<img class="mt-image-none" height="16" alt="error_go.png" src="http://www.idoimaging.com/blog/blogimages/error_go.png" width="16" />&nbsp;for 'Site link down' (though it still will link through),&nbsp;<img class="mt-image-none" height="16" alt="add.png" src="http://www.idoimaging.com/blog/blogimages/add.png" width="16" />&nbsp;for 'Add monitor' (email notification), and&nbsp;<img class="mt-image-none" height="16" alt="error_add.png" src="http://www.idoimaging.com/blog/blogimages/error_add.png" width="16" />&nbsp;for 'Unable to add monitor'. &nbsp;The last is for websites where there is no revision number or release date listed, so I'm unable to provide update information. &nbsp;This affects about 20% of the projects, though usually the less-active one.&nbsp;</span></div>
<div><br /></div>
<div>I like to get the program interface icons to line up nicely in columns ('column up'? &nbsp;Is there a verb meaning 'align in columns'?). &nbsp;I used to do this with an internal HTML table within the TD cell for each entry. &nbsp;This is pretty wasteful and slow - the browser has to set up a table for each line, calculate its width, and so on. &nbsp;So I made up composite icons of the eight permutations of the three individual icons each in their 'on' and 'off' states. &nbsp;For this as with most of my graphical editing needs I use the amazing&nbsp;<a href="http://www.imagemagick.org/script/index.php">ImageMagick</a>&nbsp;command line tools. &nbsp;The 'montage' command allows you to combine multiple pictures into one, in a definable grid geometry, and furthermore can create blank spacing elements, and a transparent background. &nbsp;Simple.</div>
<div><br /></div>
<div>I want to add icons to denote the platform or operating system of each program, which would be very useful though using up still more width. &nbsp;The problem has been finding the icons for Mac, Windows, and Linux in a suitable size (16x16). &nbsp;You'd think the Web would be swimming in them, and you'd be wrong. &nbsp;Probably due to copyright, none of the dozens of icon collections I squinted through had them. &nbsp;The hunt continues.</div>
<div><br /></div>]]></description>
            <link>http://www.idoimaging.com/blog/2008/12/wider-pages-immediately-filled.html</link>
            <guid>http://www.idoimaging.com/blog/2008/12/wider-pages-immediately-filled.html</guid>
            
                <category domain="http://www.sixapart.com/ns/types#category">idoimaging.com</category>
            
            
            <pubDate>Tue, 30 Dec 2008 10:06:59 -0500</pubDate>
        </item>
        
        <item>
            <title>Javascript and Apache</title>
            <description><![CDATA[I'm testing out Walter Zorn's very cool <a href="http://www.walterzorn.com/tooltip/tooltip_e.htm">Javascript Tooltips</a> for possible inclusion.  I want to use tooltips on the dropdown elements of the 'Search' page, since I am finally rationalizing the search categories and I'd like to be able to add some descriptive text to each element.<div><br /></div><div>I run everything from Perl, so I made a little test program and included a call to his Javascript libraries:<br /><div><br /></div><div><span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 11px;"><span class="Apple-style-span" style="color: rgb(0, 64, 128);">print "&lt;script type='text/javascript' src='wz_tooltip.js'>&lt;/script>\n";</span></span></div><div><br /></div><div>No go, and I get error messages in the local httpd log files like this:</div><div><br /></div><div><span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 11px;"><span class="Apple-style-span" style="color: rgb(64, 128, 0);">Permission denied: exec of '/Users/ahc/public_html/cgi-bin/wz_tooltip.js' failed</span></span></div><div><br /></div><div>Hmmm I think, that's funny, I didn't know Javascript files needed to be executable.  But it's late and I'm not thinking too clearly, so I make the js file executable 755.  Now I get a different error message:</div><div><br /></div><div><span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 11px;"><span class="Apple-style-span" style="color: rgb(64, 128, 0);">Exec format error: exec of '/Users/ahc/public_html/cgi-bin/wz_tooltip.js' failed</span></span></div><div><br /></div><div>OK someone's trying to tell me something about how I shouldn't be executing that file.  I resort to reading the manual.  Apache httpd Dynamic Content <a href="http://httpd.apache.org/docs/1.3/misc/FAQ-F.html#CGIoutsideScriptAlias">FAQ</a> number 1, sentence number 1 begins:</div><div><br /></div><div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">"Apache recognizes all files in a directory named as a ScriptAlias  as being eligible for execution rather than processing as normal documents. This applies regardless of the file name..."</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">A dim light comes on.  httpd has been trying to execute the js file, because I told it to, with the ScriptAlias directive in my httpd.conf file, which says that everything in cgi-bin is a script:</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><br /></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 11px;"><span class="Apple-style-span" style="color: rgb(0, 64, 128);">   ScriptAlias /cgi-bin/ "/Users/ahc/public_html/cgi-bin/"</span></span></p><div><br /></div><div>Dummy.  I moved the js file out of my cgi-bin directory and into the http document root, and changed the line to specify the file is in the root:</div><div><br /></div><div><span class="Apple-style-span" style="font-family: arial; font-size: 13px; "><div><span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 11px; "><span class="Apple-style-span" style="color: rgb(0, 64, 128); ">print "&lt;script type='text/javascript' src='/wz_tooltip.js'>&lt;/script>\n";</span></span></div><div><br /></div><div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;">Probably a well-known trap but at least I found it eventually.</span></div><div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;"><br /></span></div></span></div></p></div></div>]]></description>
            <link>http://www.idoimaging.com/blog/2008/12/javascript-and-apache.html</link>
            <guid>http://www.idoimaging.com/blog/2008/12/javascript-and-apache.html</guid>
            
                <category domain="http://www.sixapart.com/ns/types#category">Programming</category>
            
            
            <pubDate>Thu, 25 Dec 2008 01:42:17 -0500</pubDate>
        </item>
        
    </channel>
</rss>
