To quantify the amount of the formed I2 in the nanopores, we first separate the electrolyte/carbon structure factor (high q) and the particle scattering (low q) from the pure nanopore scattering (intermediate q). The separation procedure is described in the Methods and Supplementary Fig. . In a second step, we use the concept of plurigaussian random fields to fit the reduced experimental in situ SAXS curves and generate 3D lattice models of the carbon nanopore structure filled with the solid iodine phase. This involves modeling the empty carbon nanopore structure using a Gaussian random field (GRF) ( ) and the solid I2 via a second Gaussian random field ( ). After the carbon nanopore structure has been obtained from a fit to the SAXS intensity of the empty carbon electrode (Supplementary Fig. and Ref. ), the in situ SAXS data are fitted using the I2 pore occupancy and two structural parameters of the I2 phase as fit parameters. These are the correlation parameter lz of the GRF ( ) and the parameter accounting for carbon-iodine correlations (Supplementary Fig. ). A detailed description of the plurigaussian random field modeling and fitting is given in the Methods.