Fast code gets faster, costs go lower, creativity is unlocked, and freedom rings.

Increases in performance over time by version and month/year for the connected components library I’ve spent a few years working on. Horizontal axis is millions of 3d pixels (“voxels”) per second. Vertical axis is measured peak RAM usage. There are faster algorithms available, but not for 3D multi-label images to my knowledge. License: Image by Author

In the public sphere if not behind every closed door, the software community preempts any suggestion of a focus on performance with an ubiquitous and misunderstood quote by Donald Knuth: “Premature optimization is the root of all evil.” While I have as little love for speculative micro-optimizations as Knuth, careful attention to software performance comes with significant benefits and is subject to feedback loops that can radically improve a project on several levels.

My own experience has been accrued in the field of 3D image processing, where the data are very large. A typical input image is a 512³ voxel

In an attempt to get ahead of the awful civil liberties shredding direction the media and politicians will inevitably take the discourse post-coup, I will offer my thoughts. You can take them, leave them, or otherwise criticize them. Without a set of popular demands to fill the space, the discourse will only get worse. Fortunately, several representatives such as Ilhan Omar, Ayanna Pressley, Ed Markey, and Cori Bush have already started talking about concrete things that can be done.

Here’s my current list of suggested demands that includes each of theirs, expands on them, and discusses why each demand is…

The following advice is for software developers on Mac OS or Linux computers.

When I have a video I’d like to turn into a GIF, I haven’t found an obvious way to do it that doesn’t involve submitting it to one of the many sketchy converters online. If you’d like to perform the conversion on your own machine on your own terms, the below bash script is for you.

You’ll need to install ffmpeg, which is a command line video conversion tool, Imagemagick, and this version of gifsicle with lossy compression to reduce the size of a fat gif to…

Original COUNTLESS erodes sparse data on a black field. Note that the field labeled “Original COUNTLESS” is pure black while the faint points are retained in the Stippled COUNTLESS field.

From time to time a scientific Python user will tell me that they’d like to use COUNTLESS 2D, but they’re working with a sparse dataset. For instance, they might have a volume of cells and they’d like to paint a dot over each cell body’s center of mass. However, if they were to use COUNTLESS 2D, the surrounding numerous black pixels would erase the small dots within a small number of downsamples, leaving the canvas entirely black when zoomed out.

If the dot size is a single pixel and will never be adjacent to another pixel (even when downsampled), then…

Easily build Python C extensions using wheels on multiple architectures (Linux, MacOS, Windows) from an existing PyPI package.

The Problem

If you’re developing a Python package and need to develop a C extension, it’s confusing to figure out how to bundle and distribute it on PyPI. If your build step requires numpy or another package to be installed before runs, it becomes messy to provide your users with a single familiar command that will install your package.

You might be the developer of that package or you might be trying to pre-compile C extensions for an existing package.

A Potential Solution

Python wheels are…

A visualization of a 2x2x2 downsample of a labeled dataset. This is what COUNTLESS 3D does.

Previously, I demonstrated a fully vectorized algorithm, COUNTLESS, that downsampled labeled images by finding the mode of 2x2 patches without counting pixel value frequencies. Here, I generalize COUNTLESS to 3D images using a 2x2x2 patch and to arbitrary downsample factors. COUNTLESS 2D worked by finding a majority pixel without computing its total frequency. This was determined by finding the presence or absence of two matching pixels within a 2x2 image patch. COUNTLESS 3D extends this logic by searching among eight voxels (three dimensional pixels) for matches of four pixels, then of three, and finally of two. COUNTLESS N generalizes this…

The crater left by the Castle Bravo nuclear test on Bikini Atoll. It is well over a mile wide and 250 feet deep. Note the scale bar on the right. Sources: Google Maps (11°41'49.4"N 165°16'21.0" E), Brookings

Blazing in the Ring of Fire

On Bikini Atoll lies the mile and a quarter wide crater left by the infamous March 1, 1954 CASTLE BRAVO superweapons test. It was the beginning of Operation CASTLE, a series of atomic tests in the Pacific Proving Grounds located in the Marshall Islands. Ivy Mike, the first fusion bomb tested, was not technically workable as a weapon. Bravo had that potential, and it was big, bad, and ecologically disastrous.

Slightly north-west of the middle of the Pacific Ocean and well over a thousand miles away from any large land mass, the Marshall Islands are an isolated series of atolls…


(1b) The term “restricted data” as used in this section means all data concerning the manufacture or utilization of atomic weapons, the production of fissionable material, or the use of fissionable material in the production of power, but shall not include any data which the Commission from time to time determines may be published without adversely affecting the common defense and security.

The Atomic Energy Act of 1946 (emphasis mine)

Up until the late seventies, the basic workings of thermonuclear weapons were a closely guarded secret. Outside of government agencies, where employees agree to be…

An unarmed Minuteman III Intercontinental Ballistic Missile (ICBM) launches during an April 26, 2017 test from Vandenberg AFB, California. Source: U.S. Air Force / Sr. Airman Ian Dudley (news article)

“We knew the world would not be the same. A few people laughed, a few people cried. Most people were silent. I remembered the line from the Hindu scripture, the Bhagavad Gita; Vishnu is trying to persuade the Prince that he should do his duty and, to impress him, takes on his multi-armed form and says, ‘Now I am become Death, the destroyer of worlds.’ I suppose we all thought that, one way or another.”

J. Robert Oppenheimer, The Decision to Drop the Bomb (1965)

Civilized life on Earth will not survive the reckless manufacture and lethal distribution of…

The Black Sun Rises

In The Dark Knight, the 2008 epic co-written and directed by Christopher Nolan, Batman battled with the psychopathic Joker. Soon after making his entrance, Joker set fire to a towering green pile of cash, demonstrating convincingly that he was not motivated by simple rationales like greed; he just wanted to watch the world burn. In the infamous ferry scene, Joker sprung a wily trap.

William Silversmith

Writing on image processing and social topics.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store