

computer programs
MARTApp: software for the processing and reconstruction of synchrotron-radiation-based magnetic tomographies
aALBA Synchrotron Light Source, CELLS, Cerdanyola del Valles, 08290 Barcelona, Spain, bDepartamento de Física, Universidad de Oviedo, 33007 Oviedo, Spain, cCINN (CSIC – Universidad de Oviedo), 33940 El Entrego, Spain, and dSynchrotron SOLEIL, L'Orme des Merisiers Départementale 128, 91190 Saint-Aubin, France
*Correspondence e-mail: [email protected], [email protected], [email protected]
Magnetic vector tomography allows for visualizing the 3D magnetization vector of magnetic nanostructures and multilayers with nanometric resolution. In this work, we present MARTApp (Magnetic Analysis and Reconstruction of Tomographies Application), a software designed to analyze the images obtained from a full-field or scanning transmission X-ray microscope and reconstruct the 3D magnetization of the sample. Here, its workflow and main features are described. Moreover, a synthetic test sample consisting of a hopfion is used to exemplify the workflow from raw images to the final 3D magnetization reconstruction.
Keywords: TXM; STXM; XMCD; magnetic vector tomography; GUI.
1. Introduction
In recent years, magnetic vector tomography (MVT) has emerged as a powerful imaging technique to reveal the 3D magnetization from 2D images or projections of a sample under different orientations (Phatak et al., 2010; Donnelly et al., 2017
; Hierro-Rodriguez et al., 2020
; Di Pietro Martínez et al., 2023
). This technique has gained popularity due to its ability to visualize complex 3D magnetic configurations at the nanoscale, which could serve as information carriers in magnetic sensing and data storage devices (Fernández-Pacheco et al., 2017
; Dieny et al., 2020
; Wolf et al., 2022
).
X-rays (either soft, tender or hard with energies of the order of 0.1–100 keV) allow to directly probe the magnetization with element sensitivity by exploiting the interaction between the magnetization and circularly polarized photons (Chen et al., 1990; Fischer et al., 1997
), achieving lateral resolutions down to tens of nanometres for samples with thickness up to 2 µm depending on the energy range and/or technique employed (Otón et al., 2015
; Neethirajan et al., 2024
). Additionally, transmission X-ray microscopy, as a photon-in/photon-out technique, is insensitive to external magnetic fields, allowing for a great variety of sample environments (Sorrentino et al., 2015
). For instance, pump–probe experiments using a 500 MHz RF magnetic field combined with laminography was used to study the magnetization dynamics in a GdCo microdisk revealing the movement of the vortex domain wall (Donnelly et al., 2020
). The implementation of MVT has been used to reconstruct and analyze 3D magnetic textures. For example, Bloch points were identified in Py microstructures and the emergent field connecting the topological charges was computed (Hermosa et al., 2023
). Moreover, using hard X-ray nanotomography, the magnetization of cylinders of GdCo2 showing vorticity loops containing vortex–antivortex pairs or Bloch points were imaged (Donnelly et al., 2021
).
Despite the MVT uniqueness as an experimental tool to observe the 3D magnetization vector, the analysis of the high amount of data acquired in order to perform the reconstruction is a major drawback for the inexperienced user community. Note that, to obtain the magnetization vector field in the axial tomography configuration, it is necessary to acquire two orthogonal tilt series (TS) to access the three components of the magnetization. In addition, each one of these TS must be recorded with circular right (C+) and left (C−) polarizations in order to obtain the magnetic signal through the X-ray ). Moreover, to increase the signal-to-noise ratio, multiple projections per angle are often recorded under the same polarization to perform their average. Overall, a typical MVT experiment implies the acquisition of thousands of images (considering several repetitions per projection, two TS, and two polarizations; this for both sample and flat field images of the incoming beam) (Hierro-Rodriguez et al., 2020
). Altogether, the data processing needs to deal with a large number of images and the use of accurate alignment methods prior to vector field reconstruction algorithms.
To the best of our knowledge, there are no open-source tools available for MVT that cover from the acquisition to the magnetic reconstruction although several graphical user interfaces (GUIs) have been implemented to process images from transmission X-ray microscopy (TXM) (Liu et al., 2012; Welborn et al., 2024
; Xiao et al., 2022
). In order to address this absence of applications and make this technique approachable to non-expert users, we introduce MARTApp, a suite of pipelines accompanied by an intuitive GUI that processes recorded projections and enables the recovery of the magnetic signal in 3D. The software has been particularly designed to process images acquired using the MISTRAL transmission X-ray microscope at the ALBA Synchrotron (Sorrentino et al., 2015
) but it can be extended to any beamline where a transmission scheme applies (i.e. scanning-TXM12 and TXM). In the following sections, we describe the workflow of MVT in a TXM, the software design, the use cases providing a concrete example, and finally the features that MARTApp provides to the user community.
2. Magnetic vector tomography
The TXM allows imaging magnetic materials with a spatial resolution down to 30 nm depending on the Fresnel zone plate used and element sensitivity (Fischer et al., 2001). As depicted in Fig. 1
, the sample is illuminated either with C+ or C− polarized X-rays coming from the condenser. The Fresnel zone plate lens collects the transmitted photons to form an image on a 2D detector. The incidence angle can be modified by rotating the sample around the vertical axis to a specific tilt angle (θ). Additionally, it is possible to rotate the sample around its normal at θ = 0° by φ = 90°.
![]() | Figure 1 Experimental scheme of the TXM. |
During tomography, multiple repetitions of images or projections (P) are acquired to maximize the signal-to-noise ratio. For normalization, it is mandatory to measure images of the incoming beam without the sample, the so-called flat field (FF), analogous to the incident intensity in 2D. For samples with high absorbance, background images (BG) are also recorded. These BG images are measured by blocking the incident light with a specific highly absorbent sample and are employed to compensate for any possible stray light reaching the detector that could overcome the signal from very absorptive areas of the sample. Then, the transmittance (T) is calculated as follows,
where all the used images (P, FF, BG) have been normalized to the electron current value in the storage ring, the exposure time, and the dark noise of the detector (Otón et al., 2015). Transmittance projections are aligned to correct for drifts during acquisition and averaged to generate a single image for the same θ, φ and polarization.
The value of T through a magnetic sample can be related to the sample properties by the Beer–Lambert equation taking advantage of the XMCD (Stöhr & Siegmann, 2006),
where L(t) is the attenuation length of the X-rays in the sample, δ is the dichroic coefficient, and k · m is the dot product between the X-ray wavevector and the magnetization. The transmittance is thus sensitive to the magnetization component parallel or anti-parallel to the X-ray beam direction. To recover the magnetization, projections are collected at different tilt angles (θ in Fig. 1) using both circular polarizations.
The magnetic signal can be obtained by operating with the transmittance for each polarization (C+ and C−) through the XMCD mechanism. Absorbance and XMCD images for each tilt angle θ are computed as
The absorbance provides information about the morphology of the sample while the XMCD is proportional only to the magnetization of the specific element resonant with the photon energy. Due to this resonant effect, MVT represents the magnetization of a single element or phase in the sample. Before computing them, transmittance images of polarization C+ must be correctly aligned with their analogs of polarization C− to avoid artifacts in the XMCD signal and, hence, in the 3D reconstruction of the magnetization.
The absorbance and XMCD images are both introduced as an input to the magnetic reconstruction algorithm. The algorithm chosen for this task depends on the dimensions of the sample. For a quasi-2D material, where its thickness is less than the axial resolution of the microscope (∼60 nm), the algorithm detailed by Herguedas-Alonso et al. (2023) can be used. It takes advantage of the small sample thickness to reduce the necessary number of angular projections (e.g. six) and exposure time/number of images per angle and polarization. This decreases the acquisition time by a factor of 10 to 100 compared with standard 3D magnetic samples.
For thicker 3D systems, to achieve good resolution many more angular projections are required, as the in-depth resolution is directly related to the number of projections and the maximum tilt angle (Kak & Slaney, 2001) [e.g. angular projections ranging from −55° to 55° in 87 steps (Hierro-Rodriguez et al., 2020
)] and the images have to be tilt aligned to a common rotation axis before using the reconstruction algorithm. Iterative reconstruction algorithms based on X-ray tracing with gradient descent optimization (Donnelly et al., 2018
; Pham et al., 2024
) or algebraic methods (Hierro-Rodriguez et al., 2018
) can be used to recover the 3D magnetic configuration. In these algorithms, a guess object is created, which for the initialization could be a 3D matrix of zeros or a random magnetization. For each iteration, calculated projections from the guess object are compared with the measured ones in order to obtain an error, which is then used to update the guess object.
Furthermore, due to the XMCD contrast mechanism, a single TS allows two magnetization components to be recovered, the out-of-plane (mz in the frame of reference of the sample in Fig. 1) and one of the in-plane (mx in Fig. 1
). The other in-plane component (my) is obtained by rotating the sample around φ, as shown in Fig. 1
, providing an orthogonal TS. Once the absorbance and magnetic reconstructions are obtained for both TS (TS1 with φ = 0° and TS2 with φ = 90°), they are merged to obtain the three components of the magnetization vector. From the 3D reconstructed absorbance, a 3D mask is created for each TS to obtain the geometrical transformation between both to a common coordinate system. This transformation is then applied to my, which is reconstructed from TS2. Finally, the three components of the magnetization, mx, my and mz, are obtained.
3. Software structure
MARTApp consists of four main data treatment steps developed using Python (Python Software Foundation, 2024) and two iterative reconstruction algorithms implemented using MATLAB (Natick, 2024
; Hierro-Rodriguez et al., 2018
; Herguedas-Alonso et al., 2023
) but compiled to be distributed together with the application. The GUI has been built using the PyQt5 library (Riverbank Computing, 2024
) and Qt designer (The Qt Company Ltd, 2024
). For its distribution, it comes in two flavors within two different docker images: a native one that uses a Debian–Linux base image as the operative system and needs package X11, and another one that includes noVNC (Martin, 2024
) to work directly in the browser without needing graphic interface forwarding. Both docker images allow the user to be able to use Windows, Mac, or Linux. For expert users or developers, we provide the source code for installation, use, inspection, and modification.
The GUI presents a main window or widget (see Fig. 2) where the two required TS may be processed in parallel, allocating each one to a different directory.
![]() | Figure 2 Main screen of MARTApp. |
Once both TS are selected, we can start the processing pipeline which has consecutive steps ending with the absorbance and magnetic 3D reconstructions. MARTApp follows the workflow described above for MVT and includes the following modules: (1) pre-processing (data reading and transmittance computation from single raw images), (2) absorbance and XMCD signal (image alignment for each polarization, absorbance and XMCD computation), and (3) magnetic reconstruction of quasi-2D or -3D samples. Additionally, it also includes a module for manually correcting or improving the automatic 2D alignment of the images. Finally, every module allows the user to inspect the intermediate and final results using Matplotlib (Hunter, 2007) or Napari (Chiu & Clack, 2022
). Moreover, the different step modules of the GUI can be used independently.
The analysis workflow may start with the preprocessing module using as input XRM files from Zeiss-Xradia (format of the MISTRAL-TXM software) or with HDF5 files. Nevertheless, the GUI is designed to work from the preprocessing stage onward using HDF5 files as inputs. The format of the input files is described in the GitHub repository (https://github.com/ALBA-Synchrotron/MARTApp).
In the following, the modules are described in detail.
3.1. Pre-processing
The pre-processing module allows the raw images of a TS obtained from the microscope to be read and outputs the transmittance images. Fig. 3 shows the interface and the workflow of the module. The raw transmission images and metadata are read from the HDF5 files and the different projections are grouped by tilt angle and polarization in two corresponding stacks C+ and C−. In the case of using the images in the XRM format, the GUI first converts them into HDF5 files. Then, each group of J projections is normalized using equation (1)
.
![]() | Figure 3 Interface and workflow of the pre-processing module. |
For those cases where FF have not been acquired for each angular projection, this module includes an option that allows interpolating the measured FFs to estimate the missing ones. Note that for long acquisition times of several hours the incident
and its spatial distribution may vary and an accurate normalization is needed.For the 2D alignment step of the J normalized projections, the module includes four different alignment algorithms allowing for pixel-wise or subpixel registration:
(i) Cross-correlation in real space: template matching-based algorithm using OpenCV and cross-correlation in real space (Culjak et al., 2012; Zhao et al., 2006
).
(ii) Cross-correlation in Fourier: Scikit-image implementation of the cross-correlation alignment in Fourier space (Guizar-Sicairos et al., 2008; Van der Walt et al., 2014
).
(iii) Optical flow in Fourier: optical flow-based alignment algorithm in Fourier space from the Artis Tomo package (Beauchemin & Barron, 1995; Otón, 2025
).
(iv) PyStackReg: Python/C++ port of the ImageJ extension TurboReg/StackReg (Thévenaz et al., 1998), a pyramid subpixel registration based on intensity, widely used in time-resolved fluorescence and wide-field microscopy.
After the 2D alignment, angular projections are averaged, resulting in one transmittance image per tilt angle and polarization. The results are saved in two different HDF5 files, one per polarization C+ and C−, containing datasets with the transmittance, the FF and BG, the angles, and other metadata. Each dataset is stored as a 3D tensor of the 2D images of the tilt series stacked along the first dimension, having sizes of [number of angles, width, height].
3.2. Absorbance and XMCD signals
The second module, shown in Fig. 4, allows the computation of the absorbance and XMCD images from the normalized images of both polarizations contained in the HDF5 files. Firstly, it allows pixels to be cropped from the border of the images to remove empty pixels generated by the precedent 2D alignment procedure. Moreover, it is possible to exclude angular projections from the workflow that might have poor quality due to punctual vibrations, injections, shadow effects due to rotation, etc.
![]() | Figure 4 Interface and workflow of the absorbance and XMCD signals module. |
Then, angular projection series with the same tilt angle from C− polarization are aligned with their corresponding C+ ones. Here, in addition to the above-mentioned 2D alignment algorithms, the alignment includes an option to select a region of interest (ROI) and/or the creation of a binary mask to suppress the magnetic signal of the images which could, otherwise, affect the alignment process due to the opposite contrast of C+ and C− polarizations. Again, images can be cropped or filled with a certain value after the 2D alignment in order to remove shift artifacts. Moreover, since the polarization fraction between C+ and C− reaching the sample might not be strictly equivalent, an intensity correction factor can be applied between opposite polarization images by selecting a ROI where no magnetic contrast is present. This factor is then applied to the C− polarization images to ensure that the average intensity within the field of view is the same for both polarizations. Then, the absorbance and XMCD stacks are computed by equations (3) and (4)
, respectively.
Before the 3D magnetic reconstruction, it is mandatory to align the images to a common rotation axis, and MARTApp includes three algorithms for this task:
(i) CT align: fiducial-based tilt alignment pipeline using IMOD's tilt alignment algorithm (Kremer et al., 1996; Mastronarde, 1997
).
(ii) Optical flow in Fourier: same algorithm as for 2D alignment but performing a subsequent alignment, i.e. each angle is aligned to the previous one.
(iii) PyStackReg: same algorithm as for 2D alignment but enabling the tilt alignment option.
It is important to note that the Optical flow in Fourier and PyStackReg algorithms rely on nominal tilt angles due to the absence of computed tilt angles. Usually, the alignment is performed on the absorbance stack and the same shifts are then applied to the XMCD one. To facilitate this step, more options have been included, such as the creation of a mask from the absorbance series to isolate the sample from the rest of the field of view or the use of the XMCD stack when the magnetization is mainly out-of-plane and the contrast does not change when rotating. The output HDF5 file contains the original and the 2D-aligned transmittance images for each polarization, the XMCD and absorbance signal, and, if selected, the tilt-aligned datasets, stored as in the previous module in a 3D stack where the first dimension refers to the number of angles measured.
As a guide for the user, included in the supporting information are the run times of the alignment between polarizations and the tilt series registration for the tomographic reconstruction using the PyStackReg algorithm as a function of the input image size.
3.3. Manual image alignment
Due to the different types of samples and their structural complexity, automatic 2D algorithms may not perfectly align the images with the needed accuracy to compute the absorbance and XMCD signal stacks. In order to solve this problem, MARTApp includes a module to manually align the two polarization stacks (or any set of images in a HDF5 file). In this module, the user selects the reference and it applies translations, rotations, scaling, and intensity factors to the other image. Both the overlap and the difference of the two images are shown to evaluate the applied alignment. Once the user checks the alignment is correct, the transformed image or stack is exported into an HDF5 file with their corresponding absorbance and XMCD signals. Afterwards, the tilt alignment can be performed returning to the XMCD module.
3.4. Magnetic reconstruction of quasi-2D samples
This module implements the reconstruction algorithm described by Herguedas-Alonso et al. (2023) for quasi-2D samples or thin films (thickness ≤ 60 nm). After obtaining the tilt-aligned absorbance and XMCD stacks, MARTApp applies affine transformations to the images to correct the cosine stretching. This step is necessary to have all images aligned to a reference one to further use the specific reconstruction algorithm. The computation of the transformation is done by registering the absorbance of the angular projections with the one at normal incidence. An initial transformation can be obtained by selecting points manually on the absorbance image at normal incidence and using the nominal tilt angle. Then, both TS are merged and the rotation angle φ is computed using again the absorbance images of each TS at normal incidence. The same transformations are applied to the XMCD stack. In the case of quasi-2D multilayers, an additional translation of the magnetic signal along the sample depth, proportional to the tilt angle and the distance between the absorbance layer and the magnetic one, can be performed. This is included for a correct alignment in a continuous film, where it is mandatory to have landmarks for the alignment. Finally, the magnetic signal is introduced in the reconstruction algorithm and the output is an HDF5 file containing the 3D magnetization vector of the quasi-2D system under study. The three components of the magnetization are saved in three different datasets with dimensions [width, height].
3.5. Absorbance and magnetic reconstruction of 3D samples
This last module is divided into two parts – absorbance and magnetic reconstruction of 3D samples – and uses the algorithm described by Hierro-Rodriguez et al. (2018). The interface and scheme of the first part can be found in Fig. 5
. First, the 3D absorbance reconstruction is obtained from the corresponding tilt-aligned images of each TS. This allows us to obtain the sample morphology, i.e. the 3D map of the non-magnetic term of the in equation (2)
. To run this reconstruction algorithm, several input parameters are required: the size of the reconstructed volume, the pixel size of the images, the number of iterations, the rotation axis orientation, and whether the sample is a continuous film or not. The continuous film flag extends the reconstruction model horizontally (vertically) for TS where the rotation axis is around the Y (X) axis (see Fig. 1
), simulating an infinite film to minimize edge artifacts. The time to perform the reconstruction may vary according to the input parameters. In the supporting information this run time is studied for different reconstructed volume sizes. After the absorbance reconstruction, a segmentation is performed to create a 3D mask which will be used later to find the geometrical transformation between TS1 and TS2. Three options related to the type of sample have been included for segmentation: a threshold for general systems, the application of a 2D mask for nanostructures with 2D symmetry, and the creation of a mask for continuous films from Au nanoparticles deposited on top of the magnetic film for alignment purposes (Hierro-Rodriguez et al., 2020
). For each one, the mask can be generated using different automatic thresholding methods: Otsu (Otsu, 1975
), Huang (Huang & Wang, 1995
), MaxEntropy (Kapur et al., 1985
), or Triangle (Zack et al., 1977
); or by manual selection in a reconstructed signal intensity histogram. The output of each TS segmentation is two binary masks, one to be used as a constraint in the magnetic reconstruction (optional), and another one to find the geometric transformation between the reconstructed volumes of both TS to obtain the three magnetization components on the same reference frame. The volumes are stored in a HDF5 independently for each TS where they are indexed as [depth, width, height].
![]() | Figure 5 Interface and workflow of the absorbance reconstruction module for 3D magnetic materials. |
In the second part, shown in Fig. 6, the magnetization for each TS is reconstructed from the XMCD tilt-aligned stack. The same parameters mentioned above (size of the reconstructed volume, pixel size, etc.) must be introduced in the algorithm. The magnetic reconstruction of TS1 outputs mx and mz, whilst TS2 reconstruction outputs my′ and mz′. Then the geometrical transformation between both TS is computed with the binary 3D mask obtained from the previous step as already mentioned. An initial estimation of the transformation can be obtained by selecting three points in the reconstructed absorbance space or introducing a rotation angle around the X-ray direction of propagation (see Fig. 1
). Finally, the transformation is then applied to my′ to obtain my in the same reference system. For consistency between the components reconstructed from TS1 and TS2, mz is used as a normalization parameter as it must be equal for both TS. After applying this correction, the 3D magnetization vector is obtained, where mx and mz are reconstructed from TS1 and my is computed by rotating TS2. The components of the magnetization mx, my and mz as well as the magnetic mask (if used) are saved in different datasets inside a unique HDF5 file, stored with dimensions of [depth, width, height].
![]() | Figure 6 Interface and workflow of the magnetic reconstruction module for 3D materials. |
The HDF5 file can be read with Python or MATLAB and converted for 3D vector visualization with Paraview (Ahrens et al., 2005) or PyVista (Sullivan & Kaszynski, 2019
). These open source softwares allow, for instance, the emergent field (Donnelly et al., 2021
) or the topological charge (Hierro-Rodriguez et al., 2020
) to be computed.
4. Use cases
MARTApp can be used and has been tested at the MISTRAL beamline at ALBA with different kinds of samples, e.g. quasi-2D systems, thin and continuous films or nanostructures. We foresee that any possible magnetic sample system that can be described by the Beer–Lambert equation [equation (2)] can be analyzed with MARTApp. The set of 2D and rotation alignment algorithms, helping features (e.g. intensity correction between polarization), and reconstruction algorithms provide adaptability and make MARTApp highly beneficial for the user community.
With the aim of demonstrating MARTApp capabilities, we present a practical example in the following.
4.1. Simulation of a magnetic vectorial tomography
Herein, we have simulated a magnetic hopfion within a continuous film as a model system. The hopfion can be described as a generalization of a skyrmion in the 3D space where the magnetization forms twisted loops around the center (Rybakov et al., 2022; Voinescu et al., 2020
). Although the hopfion is of significant interest to the nanomagnetism and spintronics community due to its unique properties and potential applications in data storage devices (Wang et al., 2019
), it is chosen here primarily for its complex 3D character. This allows us to demonstrate the capabilities of MARTApp in recovering arbitrary three-dimensional magnetization configurations. The analytical expression used for the simulation was extracted from Sutcliffe (2018
). The hopfion has been computed in a cylinder with a height of 170 nm and a diameter 510 nm surrounded by homogeneous out-of-plane magnetization within a continuous film of thickness 200 nm. Spheres that act as Au fiducial markers of 100 nm diameter have been introduced in the simulated space. A scheme of the cylinder containing the hopfion and the fiducials in the simulation space can be found in Fig. 7
.
![]() | Figure 7 Scheme of the simulation volume. The hopfion is contained in the cylinder. In the rest of the space the magnetization is along the Z direction, shown by red arrows. Black spheres represent the Au fiducial markers. Right panels show the top and side views. |
From the simulated magnetization, we have obtained the projections by calculating the trajectory of the X-ray beam through the space and applied the Beer–Lambert equation [equation (2)] to calculate the intensity at each pixel of the detector. The number of cells is 1200 × 1200 × 250 with a voxel size of 2.5 nm and the was set to 4 µm−1, similar to the Fe, and δ = 1. Projections have been computed for different tilt angles, ranging from −65° to 65° in steps of 2° to simulate the constraint of having a missing wedge in a continuous film system. Two orthogonal TS have been simulated for which the sample has been rotated φ = 90°.
Then, to mimic the experimental transmission images that can be obtained from the microscope, each projection has been convolved with a Gaussian function (e.g. standard deviation of 5) to take into account the dispersion caused by the lens. The projections were then resized to a match the pixel size of the experimental data (e.g. 10 nm). The angular projections were obtained by averaging 20 projections with Poisson noise. Finally, random shifts have been added to generate misalignment and drift effects between different tilt angles.
4.2. Processing and reconstruction of the hopfion
In the following, we describe the processing, analysis, and reconstruction of the simulated hopfion tomography. The workflows of Figs. 4, 5
and 6
display the process and output images or volumes obtained at each step.
Transmittance images for polarization stacks C+ and C− are introduced in the computation of the XMCD and absorbance module. For both TS this step is the same: 20 pixels were cropped from the borders and the algorithm chosen to perform the 2D alignment is sub-pixel cross-correlation in Fourier space, with an ROI size from the center of 80% of the field of view. The raised cosine radial mask specific to this algorithm is set to default values to avoid artifacts. No intensity correction factor has been applied between polarizations, as no difference between the polarization intensity C+ and C− has been introduced in the simulated images. After the alignment, the size of the image is trimmed by 25% to avoid edge displacements. The absorbance and XMCD signals are computed and used for the tilt alignment, performed with the CT align algorithm.
Once the absorbance and XMCD stacks are tilt aligned, the 3D reconstructions (absorbance and magnetic) are performed in a space of 440 × 440 × 250 voxels of 10 nm size with the option for reconstructing continuous film activated. The rotation is performed around the Y axis, i.e. the vertical direction of the image (see Fig. 7). The reconstruction algorithm runs for 50 iterations. Once the 3D absorbance reconstruction is obtained, it is manually (histogram) thresholded to obtain a mask of the fiducial markers for each TS. With these masks, the transformation between TS1 and TS2 reconstructed volumes is computed. Finally, the magnetic reconstruction is performed with the same parameters as the absorbance one and the GUI outputs the magnetization vector.
The results of the reconstructed magnetization of the hopfion can be found at the end of the workflow in Fig. 6. It has a toroidal shape where the magnetization at its center is oriented along the Z direction. Around this toroidal region, the magnetization is twisting. Fig. 8
shows a comparison between (a) the ground truth and (b) the reconstruction. The first row of the images presents the in-plane components of the magnetization of the XY plane, showing the rotation of the magnetization. The other three rows represent the three components of the magnetization, mx, my and mz, for the XZ plane. The reconstruction of the hopfion in this plane is affected by the missing wedge configuration, leading to the introduction of a magnetic signal at the borders of the hopfion. A more detailed discussion on how the noise or the missing angle ranges affect the magnetic reconstruction can be found in the supporting information. However, the characteristics of the magnetization texture are clearly recovered with the use of MARTApp.
![]() | Figure 8 (a) Ground truth. (b) 3D reconstructed hopfion from the simulated transmission images of the ground truth. The first row shows the in-plane orientation of the magnetization in the middle layer of the XY plane. Each row represents the magnetization mx, my and mz, for the XZ plane. |
5. Conclusions and future work
Herein we have presented MARTApp, an open-source cross-platform application that allows processing, analyzing, and reconstructing the magnetic tomographic data from transmission X-ray microscopy experiments. The four different available modules to process magnetic tomography have been described. They involve normalization, computation of the absorbance and XMCD signals, and reconstruction of the magnetization. They have been designed to work with different kinds of samples, from quasi-2D systems to 3D nanostructures including continuous films. Finally, a synthetic system consisting of a hopfion in a continuous film has been used to demonstrate the utilization of the application. This tool is well suited to help expert and non-expert users in the analysis of MVT and it provides an easy and fast way to obtain 3D magnetization vector reconstructions.
In the future, MARTApp will be adapted to work with other data standards such as NeXus data format (Könnecke et al., 2015). In addition, more features specific to other types of user samples will be continously added as they are being analyzed and new requirements will emerge. MARTApp is highly flexible and can be adapted easily making it a valuable tool to perform MVT for the magnetism community.
6. Software and data availability
MARTApp is available to download, accompanied by manuals, instructions and data formats explanations at the GitHub repository (https://github.com/ALBA-Synchrotron/MARTApp). It is distributed in its two flavors (native and web-based GUIs) through two Docker images that can be pulled from the GitHub registry. For expert users or developers, we provide the source code for installation, use, inspection, and modification. The data used to demonstrate the software functionality for this work are open source and are available in Zenodo (Herguedas-Alonso & Gomez Sanchez, 2024).
Supporting information
Link https://doi.org/10.5281/zenodo.14094130
Simulated transmission images of a hopfion for testing MARTApp, an application developed in ALBA for the analysis and reconstruction of magnetic tomographies performed at BL09 MISTRAL beamline.
Supporting Information file. DOI: https://doi.org/10.1107/S1600577525004485/gy5075sup1.pdf
Acknowledgements
The authors would like to thank the ALBA IT section for the support provided in hardware infrastructure and all those involved in the operation of ALBA.
Funding information
ALBA Synchrotron Light Source is funded by the Ministry of Science, Innovation and Universities of Spain, by the Generalitat de Catalunya, and by European FEDER funds. This work has been supported by Spanish MICINN under grant PID2022-136784NB/AEI/10.13039/501100011033, and by Agencia SEKUENS (Asturias) under grant UONANO IDE/2024/000678 with the support of FEDER funds. AEH-A acknowledges the support from the Severo Ochoa Predoctoral Fellowship Program (Nos. PA-23-BP22-093) from the Government of the Principality of Asturias (Spain).
References
Ahrens, J., Geveci, B. & Law, C. (2005). The Visualization Handbook, ch. 36, pp. 717–731. Academic Press. Google Scholar
Beauchemin, S. S. & Barron, J. L. (1995). ACM Comput. Surv. 27, 433–466. CrossRef Google Scholar
Chen, C. T., Sette, F., Ma, Y. & Modesti, S. (1990). Phys. Rev. B 42, 7262–7265. CAS Google Scholar
Chiu, C.-L. & Clack, N. (2022). Microsc. Microanal. 28, 1576–1577. Google Scholar
Culjak, I., Abram, D., Pribanic, T., Dzapo, H. & Cifrek, M. (2012). Proceedings of the 35th International Convention (MIPRO2012), 21–25 May 2012, Opatija, Croatia, pp. 1725–1730. Google Scholar
Dieny, B., Prejbeanu, I. L., Garello, K., Gambardella, P., Freitas, P., Lehndorff, R., Raberg, W., Ebels, U., Demokritov, S. O., Akerman, J., Deac, A., Pirro, P., Adelmann, C., Anane, A., Chumak, A. V., Hirohata, A., Mangin, S., Valenzuela, S. O., Onbaşlı, M. C., d'Aquino, M., Prenat, G., Finocchio, G., Lopez-Diaz, L., Chantrell, R., Chubykalo-Fesenko, O. & Bortolotti, P. (2020). Nat. Electron. 3, 446–459. Google Scholar
Di Pietro Martínez, M., Wartelle, A., Herrero Martínez, C., Fettar, F., Blondelle, F., Motte, J.-F., Donnelly, C., Turnbull, L., Ogrin, F., van der Laan, G., Popescu, H., Jaouen, N., Yakhou-Harris, F. & Beutier, G. (2023). Phys. Rev. B 107, 094425. Google Scholar
Donnelly, C., Finizio, S., Gliga, S., Holler, M., Hrabec, A., Odstrčil, M., Mayr, S., Scagnoli, V., Heyderman, L. J., Guizar-Sicairos, M. & Raabe, J. (2020). Nat. Nanotechnol. 15, 356–360. Web of Science CrossRef CAS PubMed Google Scholar
Donnelly, C., Gliga, S., Scagnoli, V., Holler, M., Raabe, J., Heyderman, L. J. & Guizar-Sicairos, M. (2018). New J. Phys. 20, 083009. Web of Science CrossRef Google Scholar
Donnelly, C., Guizar-Sicairos, M., Scagnoli, V., Gliga, S., Holler, M., Raabe, J. & Heyderman, L. J. (2017). Nature 547, 328–331. CAS PubMed Google Scholar
Donnelly, C., Metlov, K. L., Scagnoli, V., Guizar-Sicairos, M., Holler, M., Bingham, N. S., Raabe, J., Heyderman, L. J., Cooper, N. R. & Gliga, S. (2021). Nat. Phys. 17, 316–321. CAS Google Scholar
Donnelly, C., Scagnoli, V., Guizar-Sicairos, M., Holler, M., Wilhelm, F., Guillou, F., Rogalev, A., Detlefs, C., Menzel, A., Raabe, J. & Heyderman, L. J. (2016). Phys. Rev. B 94, 064421. Google Scholar
Fernández-Pacheco, A., Streubel, R., Fruchart, O., Hertel, R., Fischer, P. & Cowburn, R. P. (2017). Nat. Commun. 8, 15756. Web of Science PubMed Google Scholar
Fischer, P., Eimüller, T., Schütz, G., Denbeaux, G., Pearson, A., Johnson, L., Attwood, D., Tsunashima, S., Kumazawa, M., Takagi, N., Köhler, M. & Bayreuther, G. (2001). Rev. Sci. Instrum. 72, 2322–2324. CAS Google Scholar
Fischer, P., Schütz, G., Schmahl, G., Guttmann, P. & Raasch, D. (1997). Z. Phys. B 101, 313–316. Google Scholar
Guizar-Sicairos, M., Thurman, S. T. & Fienup, J. R. (2008). Opt. Lett. 33, 156–158. Web of Science PubMed Google Scholar
Herguedas-Alonso, A. E., Aballe, L., Fullerton, J., Vélez, M., Martín, J. I., Sorrentino, A., Pereiro, E., Ferrer, S., Quirós, C. & Hierro-Rodriguez, A. (2023). Sci. Rep. 13, 9639. Web of Science PubMed Google Scholar
Herguedas-Alonso, A. E. & Gomez Sanchez, J. (2024). Simulated transmission images of a hopfion for martapp testing, https://doi.org/10.5281/zenodo.14094129. Google Scholar
Hermosa, J., Hierro-Rodríguez, A., Quirós, A., Martín, J. I., Sorrentino, A., Aballe, L., Pereiro, E., Vélez, M. & Ferrer, S. (2023). Commun. Phys. 6, 49. Google Scholar
Hierro-Rodriguez, A., Gürsoy, D., Phatak, C., Quirós, C., Sorrentino, A., Álvarez-Prado, L. M., Vélez, M., Martín, J. I., Alameda, J. M., Pereiro, E. & Ferrer, S. (2018). J. Synchrotron Rad. 25, 1144–1152. Web of Science CrossRef IUCr Journals Google Scholar
Hierro-Rodriguez, A., Quirós, C., Sorrentino, A., Alvarez-Prado, L. M., Martín, J. I., Alameda, J. M., McVitie, S., Pereiro, E., Vélez, M. & Ferrer, S. (2020). Nat. Commun. 11, 6382. PubMed Google Scholar
Huang, L.-K. & Wang, M.-J. J. (1995). Pattern Recognit. 28, 41–51. Google Scholar
Hunter, J. D. (2007). Comput. Sci. Eng. 9, 90–95. Web of Science CrossRef Google Scholar
Kak, A. C. & Slaney, M. (2001). Principles of Computerized Tomographic Imaging, Classics in Applied Mathematics Series. Society for Industrial and Applied Mathematics Philadelphia (https://epubs.siam.org/doi/abs/10.1137/1.9780898719277). Google Scholar
Kapur, J., Sahoo, P. & Wong, A. (1985). Comput. Vis. Graph. Image Process. 29, 273–285. Google Scholar
Könnecke, M., Akeroyd, F. A., Bernstein, H. J., Brewster, A. S., Campbell, S. I., Clausen, B., Cottrell, S., Hoffmann, J. U., Jemian, P. R., Männicke, D., Osborn, R., Peterson, P. F., Richter, T., Suzuki, J., Watts, B., Wintersberger, E. & Wuttke, J. (2015). J. Appl. Cryst. 48, 301–305. Web of Science CrossRef IUCr Journals Google Scholar
Kremer, J. R., Mastronarde, D. N. & McIntosh, J. R. (1996). J. Struct. Biol. 116, 71–76. CrossRef CAS PubMed Web of Science Google Scholar
Liu, Y., Meirer, F., Williams, P. A., Wang, J., Andrews, J. C. & Pianetta, P. (2012). J. Synchrotron Rad. 19, 281–287. Web of Science CrossRef CAS IUCr Journals Google Scholar
Martin, J. (2024). noVNC, Version 1.5. https://novnc.com/info.html. Google Scholar
Mastronarde, D. N. (1997). J. Struct. Biol. 120, 343–352. Web of Science CrossRef CAS PubMed Google Scholar
Natick, M. T. M. I. (2024). Matlab, Version R2024a, https://www.mathworks.com. Google Scholar
Neethirajan, J., Daurer, B. J., Martínez, M. D. P., Hrabec, A., Turnbull, L., Yamamoto, R., Ferreira, M. R., Štefančič, A., Mayoh, D. A., Balakrishnan, G., Pei, Z., Xue, P., Chang, L., Ringe, E., Harrison, R., Valencia, S., Kazemian, M., Kaulich, B. & Donnelly, C. (2024). Phys. Rev. X, 14, 031028. Google Scholar
Otón, J. (2025). Artis tomo, https://github.com/ALBA-Synchrotron-Methodology/artis_tomo. Google Scholar
Otón, J., Sorzano, C. O. S., Marabini, R., Pereiro, E. & Carazo, J. M. (2015). Opt. Express 23, 9567–9572. PubMed Google Scholar
Otsu, N. (1975). Automatica 11, 23–27. Google Scholar
Pham, M., Lu, X., Rana, A., Osher, S. & Miao, J. (2024). Sci. Rep. 14, 9541. PubMed Google Scholar
Phatak, C., Petford-Long, A. K. & De Graef, M. (2010). Phys. Rev. Lett. 104, 253901. Web of Science CrossRef PubMed Google Scholar
Python Software Foundation (2024). Python language reference, Version 3.11, https://www.python.org. Google Scholar
Riverbank Computing (2024). Pyqt5, https://www.riverbankcomputing.com/software/pyqt/. Google Scholar
Rybakov, F. N., Kiselev, N. S., Borisov, A. B., Döring, L., Melcher, C. & Blügel, S. (2022). APL Mater. 10, 111113. Google Scholar
Sorrentino, A., Nicolás, J., Valcárcel, R., Chichón, F. J., Rosanes, M., Avila, J., Tkachuk, A., Irwin, J., Ferrer, S. & Pereiro, E. (2015). J. Synchrotron Rad. 22, 1112–1117. Web of Science CrossRef CAS IUCr Journals Google Scholar
Stöhr, J. & Siegmann, H. (2006). Magnetism: From Fundamentals to Nanoscale Dynamics, Vol. 152 of Springer Series in Solid-State Sciences. Springer. Google Scholar
Sullivan, C. B. & Kaszynski, A. (2019). J. Open Source Software 4, 1450.https://doi.org/10.21105/joss.01450. Google Scholar
Sutcliffe, P. (2018). J. Phys. A: Math. Theor. 51, 375401. Google Scholar
The Qt Company Ltd (2024). Qt, Version 5.15, https://doc.qt.io/qt-5/. Google Scholar
Thévenaz, P., Ruttimann, U. E. & Unser, M. (1998). IEEE Trans. Image Process. 7, 27–41. Web of Science PubMed Google Scholar
Van der Walt, S., Schönberger, J. L., Nunez-Iglesias, J., Boulogne, F., Warner, J. D., Yager, N., Gouillart, E. & Yu, T. (2014). PeerJ 2, e453. PubMed Google Scholar
Voinescu, R., Tai, J. B. & Smalyukh, I. I. (2020). Phys. Rev. Lett. 125, 057201. PubMed Google Scholar
Wang, X. S., Qaiumzadeh, A. & Brataas, A. (2019). Phys. Rev. Lett. 123, 147203. PubMed Google Scholar
Welborn, S. S., Preefer, M. B. & Nelson Weker, J. (2024). J. Synchrotron Rad. 31, 979–986. Web of Science CrossRef IUCr Journals Google Scholar
Wolf, D., Schneider, S., Rößler, U. K., Kovács, A., Schmidt, M., Dunin-Borkowski, R. E., Büchner, B., Rellinghaus, B. & Lubk, A. (2022). Nat. Nanotechnol. 17, 250–255. Web of Science CrossRef CAS PubMed Google Scholar
Xiao, X., Xu, Z., Lin, F. & Lee, W.-K. (2022). J. Synchrotron Rad. 29, 266–275. Web of Science CrossRef CAS IUCr Journals Google Scholar
Zack, G. W., Rogers, W. E. & Latt, S. A. (1977). J. Histochem. Cytochem. 25, 741–753. CrossRef CAS PubMed Google Scholar
Zhao, F., Huang, Q. & Gao, W. (2006). 2006 IEEE International Conference on Acoustics Speech and Signal Processing (ICASSP) Proceedings, 14–19 May 2006, Toulouse, France. Google Scholar
This is an open-access article distributed under the terms of the Creative Commons Attribution (CC-BY) Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original authors and source are cited.