Skip to content

Instrument Viewer in Mantid: Swapping the engine, keeping the car

15 Oct 2026

After nearly 20 years of supporting neutron and muon experiments, Mantid’s Instrument Viewer has been rebuilt from the ground up. The new version retains the functionality researchers have come to rely on while providing a modern, maintainable foundation for future development. It will become the default in Mantid 7.0 from October 2026.

A screenshot of the Instrument Viewer showing an analysis control panel on the left, two purple segmented curved structures in a 3D viewport on the top right, and a bar chart plot on the bottom right that counts versus time-of-flight.

What are Mantid and Instrument Viewer?

Mantid is an international open-source software used to process the raw data from muon and neutron experiments – a process known as data reduction. Mantid is used and developed by research facilities across the globe, including the ISIS Neutron and Muon Source.

One of Mantid’s core features is the Instrument Viewer. It allows users to visualise the neutron and muon instruments and look at the signals recorded during an experiment: the scientist can see which detectors recorded more activity and which detectors did not. This ability to visualise instruments and experiments has been part of Mantid since its inception roughly 20 years ago and has served hundreds of scientists across thousands of experiments using over 30 different instruments.

 

The challenge of maintaining the software

Mantid is constantly being developed, upgraded and maintained to keep it at the cutting edge of neutron and muon science. However, Instrument Viewer remained largely untouched due to its legacy of large, complex and obscure code. Errors and crashes started appearing more frequently, demanding increasingly more attention from Mantid developers. Often these errors showed up erratically, which made fixing them difficult, if not impossible.

 

Deciding for the future

In collaboration with the board of scientists overseeing the project, the Mantid team decided to re-work the foundations of Instrument Viewer, shifting to modern technologies and tools. This provided the opportunity to rethink the interface design, and ensure Instrument Viewer has continued relevance and use into the future.

 

Working towards a new Instrument Viewer

For the following year after this decision, a new Instrument Viewer started to take shape in the background of Mantid: an experimental version was made available alongside the original Instrument Viewer. Users could try the experimental version in their own time without risks and provide suggestions on things to improve. The experimental version is now becoming the default Instrument Viewer.

The Mantid team used an agile approach to develop the new Instrument View. Instead of building the entire interface before asking for feedback, the team divided the work into smaller stages with regular demonstrations to users at the end of each stage. These demonstrations provided opportunities to test ideas against real scientific tasks.

The new Instrument Viewer largely offers the same functionality as before, but its foundations are completely different: instead of relying on deprecated graphics code, the new interface is based on Python, with modern graphical libraries. It also follows modern design principles and is relatively compact. This change is analogous to keeping the car but swapping out the engine (although with a different dashboard and some nice improvements). This is a great achievement for the long term, as the new code for the Instrument Viewer is easy to understand, maintain, and modify, opening the road for many interesting and new features to be implemented in the future.

 

Where we are and next steps

Over the upcoming few months, the team will continue to gather feedback and keep improving the new Instrument Viewer. Once users are reliably using the new Instrument Viewer over the legacy one, the legacy version will be permanently removed, and its replacement will be considered complete. The new Instrument View will become the default in Mantid 7.0, due for release in October 2026. Scientists and developers can read the new Instrument View documentation and explore the Mantid source code on GitHub.

 

Written by James Clarke, STFC Senior Scientific Software Engineer