Python power-up: new image tool visualizes complex data – Nature.com

Npressfetimg 762.png

Josh Dorrington has become adept at viewing the jet streams. He plots fast-moving rivers of air at different atmospheric altitudes and positions the charts side by side. “You get pretty good at looking at all these cross-sections and working out what it implies,” says Dorrington, an atmospheric physicist at the University of Oxford, UK. But compared with computerized visualizations, this ‘manual’ method is slower and “it’s not as interactive”.

So when it came to visualizing atmospheric blocking events, in which stationary air masses of high pressure deflect the jet stream and lead to extreme weather events, Dorrington tried an alternative approach. Using the image viewer napari, he animated the streams in 3D as they flowed over the Northern Hemisphere — usually, but not always, in sync with each other. “One afternoon spent hacking stuff together and I already have a short visualisation of the lower and upper level Atlantic jet streams!” he tweeted in August.

napari is a free, open-source and extensible image viewer for arbitrarily complex (‘n-dimensional’) data that is tightly coupled to the Python programming language (see napari.org). It is the brainchild of microscopist Loïc Royer, at the Chan Zuckerberg Biohub in San Francisco, California; Juan Nuñez-Iglesias, who develops image analysis at Monash University in Melbourne, Australia; and Nicholas Sofroniew, who leads the imaging-technology team at the Chan Zuckerberg Initiative (CZI) in Redwood City, California.

The team created the software in 2018 to fill a gap in the Python scientific ecosystem. Although Python is the lingua franca of scientific computing, it had no visualization tools that could handle n-dimensional data sets. As a result, data analysis usually required a tedious back and forth between Python and other tools (such as the Java-based image-analysis package ImageJ) as researchers alternately manipulated their data and then visualized them to see what had happened.

napari — the name refers to a Pacific island village midway between the developers’ bases in San Francisco and Melbourne — features a simple graphical interface with a built-in Python console in which images can be rendered, rotated and manipulated in 2D or 3D, with additional dimensions, such as the succession of temporal ‘slices’ in a time series, accessible using sliders beneath the image window. If available, graphics-processing units can be used to accelerate the software. “We make sure that we actually use the computer to its full capacity,” Royer explains. (ImageJ users can also work in Python using PyImageJ; see pypi.org/project/pyimagej).

Adobe Photoshop-like layers allow users to overlay points, vectors, tracks, surfaces, polygons, annotations or other images. A researcher could, for instance, open an image of a tissue in napari, identify cell nuclei with a click of the mouse, retrieve those points in Python and use them to ‘seed’ a cell-segmentation algorithm, which identifies cell boundaries. By then pushing the results to napari as a new layer on the original image, they can assess how well the segmentation process worked.

Xavier Casas Moreno, an applied physicist at the Royal Institute of Technology in Stockholm, has embedded napari in an instrument-control system, called ImSwitch, that he built to control his lab’s super-resolution microscopes. Using layers, researchers can overlay images taken from different angles by multiple cameras and sensors. “That’s a challenge that we couldn’t solve before,” Moreno says. A custom napari control panel, or ‘widget’, built into ImSwitch, allows users to move one image relative to the other to align them.

Users can also extend napari using plug-ins: more than 100 are …….

Source: https://www.nature.com/articles/d41586-021-03628-7


Leave a Reply

Your email address will not be published. Required fields are marked *