dataesr/scientific-paragraphs-categorization huggingface dataset:
Pandita et al. (Pandita et al. 2015)  approached the problem of library migration by analysing textual similarity of documentation from different libraries. Alrubaye et al. (Alrubaye et al. 2020)  proposed a novel machine learning approach that inferred the mapping between the API elements of two different library by extracting various features from library documentation and solving a classification problem. Meng et al. (N. Meng et al. 2013 ) help developers apply systematic edits (similar, but not identical, changes to many locations in source code) by learning from examples to find the correct location and apply the correct change. They present a tool called LASE that creates a context-aware edit script from two or more examples provided by developers and uses the script to automatically identify other edit locations and to transform the code.
Conclusion This article presented a solution developed in joint work with the Pharo consortium to support deprecation for API changes within a dynamically-typed language and its ecosystem. The maintainer of a library annotates the changed method with a transformation rule. During client program execution, DEPREWRITER uses the annotation to find the call site of the deprecated method, and using the transformation rule, it rewrites and recompiles on the fly the method calling the deprecated method. Client programmers can then assess the produced changes and version their migrated code. We presented an analysis of the 367 deprecations available in Pharo 8. Among them, we analyzed 218 rewriting deprecations to understand how they were used. Finally, we performed a user survey to understand the use pattern among developers programming in Pharo.
We collected information from 46 software developers: Some knew DEPREWRITER and executed it on their code, some others were writers of rewriting deprecations, and finally, some developers were not aware of DEPREWRITER. 28 of 46 (60%) reported that the rewriting deprecations helped them, while 10 stated the inverse and 8 were uncertain. DEPREWRITER only supports the deprecation of methods, and in the future, we would like to propose a solution for classes but also instance variables as well as offer solutions for the limitations of the approach we identified in Section 9.
Despite collecting a larger dataset from Java ecosystem, authors report similar results to those of Pharo. Hora et al. (Hora et al. 2015(Hora et al. , 2018) )complemented the previous studies by analysing the impact of API evolution on the Pharo ecosystem, but focusing only on those changes which are not related to deprecations. They claim that API changes have large impact on the ecosystem and most of the changes that they found can be implemented as rules in static analysis tools. Several authors have also explored the effectiveness of the replacement messages in deprecations. Users of Reflectivity use it for building debuggers, AOP systems, before/after methods, or program spies. Reflectivity offers AST transformation and decoration at the AST node level granularity. However, it does not offer a DSL to express transformations, and, from that perspective, it is more low-level for end-users.
Increased static field inhomogeneities are a burden for human brain MRI at Ultra-High-Field. In particular they cause enhanced Echo-Planar image distortions and signal losses due to magnetic susceptibility gradients at air-tissue interfaces in the subject's head. In the past decade, Multi-Coil Arrays (MCA) have been proposed to shim the field in the brain better than the 2nd or 3rd order Spherical Harmonic (SH) coils usually offered by MRI manufacturers. Here we present a novel MCA, named SCOTCH, optimized for whole brain shimming. Based on a cylindrical structure, it features several layers of small coils whose shape, size and location are found from a principal component analysis of ideal stream functions computed from an internal 100-brain fieldmap database. From an Open-Access external database of 126 brains, our SCOTCH implementation is shown to be equivalent to a partial 7th-order SH system with unlimited power, outperforming all known existing MCA prototypes.
We therefore developed an original MCA design methodology for judicious placement and geometry of each δB 0 -compensating coil  20  to improve performance for whole-brain shimming, based on Stream-Functions Singular Value Decomposition (SF-SVD) from a large database of δB 0 fieldmaps. We first presented 13-channel  21  and 36-channel  22  SF-SVD-based MCA prototypes at ISMRM conferences, where in-vivo preliminary results were acquired at 7T from a simple Tx/Rx RF loop coil placed on the subject's forehead  22. Here a 48-channel shim prototype was built and evaluated in-vivo at 7T with a parallel transmit coil designed for insertion in the shim setup. In the meantime, Aghaeifar et al. also started working on the optimization of MCA coil position and geometry, although their work has been limited to rectangular coil geometries  23.
| METHODS To design an MCA adapted to the inhomogeneous field patterns encountered in the human brain, a semi-heuristic approach was employed for optimization of channels' geometry and position. It is based on the principal components of a database of Subject-Optimal Stream-Functions (SO-SFs), which provide indications of where electric current is most demanded for B 0 shimming of the human brain. The following steps were performed for design and validation of the optimized MCA: (1) a 100-subject database of δB 0 brain fieldmaps was acquired, covering all kinds of human head morphometries; (2) cylindrical SO-SFs were computed for each subject in the database, and SVD was performed on the SO-SF set; (3) from the first SF-SVD modes, indication of where electric current is most demanded for human brain shimming was obtained; then an MCA was designed based on this indication; (4) shimming simulations with the obtained design were performed on the in-house database (IHD) and on an external open-access database (OAD) for performance assessment and validation; (5) a prototype was built, characterized and tested in-vivo.
| Ideal System Characteristics and Simulation To characterize and simulate the shimming performance of an optimized MCA composed of channels defined by W, magnetic field, resistance and inductance should be estimated for each channel. In the SLM, for field assessment, it will be considered that each channel is composed of N turns of wire of infinitesimal thickness. From the Biot-Savart law, the magnetic field along z per unit current for the j -th channel in W can be computed as B j z (x) = N ẑ • µ 0 4π ∮ w j d x × x -x |x -x | 3. (2) Given the wire section A w and material conductivity κ, the wire bundle resistance is r j = N (w j ) κA w. (3) where (w j ) is the length of the single loop wirepath w j. The optimized MCA shimming performance can then be simulated on the fieldmap database. For a subject brain fieldmap b s to be shimmed, the contribution per unit current of each channel on the magnetic field can be calculated from eq.
2, and the inverse problem of obtaining optimal currents to minimize the inhomogeneity in the brain is posed as: i = argmin i∈ N ch σ (b s + B s i) , s. t. i j ≤ I max , 1 ≤ j ≤ N ch , (4) with σ (. ) the standard deviation across brain voxels, B s ∈ Ks ×N ch the magnetic-field matrix of elements B j z (x k ), and I max the maximum current constraint. This problem was solved with MATLAB's fmincon function. Power dissipation resulting from the optimal currents is P s = N ch j =1 r j i 2 j. (5) From eq. 4, the final inhomogeneity achieved by the shim system under particular constraints can be obtained and compared, for instance, with SH-based systems for benchmark. To find an adequate number of turns N per winding, we first set N = 1, simulate system performance and power dissipation for a given I max.
| Human Brain B0-map Collection To design an SF-SVD-based MCA, an in-house (IH) database of 3D δB 0 fieldmaps of 100 subject brains was assembled. Fieldmaps were acquired on a MAGNETOM Prisma 3 T imager (Siemens Healthcare GmbH, Erlangen, Germany) with 1. 7 mm isotropic resolution; this acquisition followed a 2 nd order SH shimming performed by the scanner based on a bounding box of the brain manually defined by the MR technician from the three-plane localizer. FSL's brain extraction tool  32  was later used for masking and restricting our analysis to the human brain voxels. Fieldmap acquisitions were performed with two consecutive 3D gradient-echo sequences, one with 2 distant echoes TE 1 = 1. 88 ms and TE 3 = 4. 9 ms, and one with a single echo at TE 2 = TE 1 + 0. 7 ms. We assume TE 1 and TE 2 are close enough so that no phase excursion occurs in the brain beyond ±π during that 0.
7 ms interval (underlying assumption: δB 0 does not exceed ±714 Hz in the brain at 3 T). Then for each voxel, a double-point linear fit of the phase evolution between TE 1 and TE 2 is first performed to potentially infer temporal phase unwrapping of the TE 3 echo; then a triple-point linear fit of the phase evolution is performed for δB 0 estimation. The resulting δB 0 maps were cleaned with an outlier filter to avoid singularities, especially at the edge of the brain. It was then scaled up by 7/3 for investigation at 7 T. Baseline inhomogeneity of the 2 nd order SH shimmed database at 7 T is 65. 7 Hz (SD: 11. 4 Hz) (where SD is the standard deviation across different subject field maps, here and elsewhere).
A 3D model of the shim system formers around the AVANTI2 coil is shown in Fig. 2. Under the described configuration, the SF-SVD mode calculation was performed using the 2 nd -order-shimmed database as baseline (online shim as described in section 2. 4. 1). The first three SF-SVD modes were calculated on coil formers of radii a 1 = 141 mm, a 2 = 149. 5 mm and a 3 = 158 mm. The length of the cylindrical surfaces for SF calculation was L = 300 mm. Cylinders were assumed to be centered at the MRI isocenter. Noticing a tendency for SF symmetry with respect to the central sagittal plane on the first three SVD-modes, they were forced to symmetry before channel extraction, by taking the average of the SF found on either side (cf. eq. 1). A total of 48 channels were defined from the symmetrized modes, with 24 channels obtained from the first SF-SVD mode, placed on the first layer of radius a 1 , 12 channels from the second one (at radius a 2 ), and 12 other channels from the third (at radius a 3 ).
| Computational Design Method and Building Process Magnetic field, resistance and inductance of the SCOTCH coils were obtained from SLM simulations in Ansys® Electronics Desktop. Shimming simulations on the human brain database are performed for different maximum electric current constraints: 1 A, 3 A, 5 A, 10 A, and unconstrained. The average final inhomogeneity across the database after shimming with the SLM is compared to unconstrained SH shimming systems of increasing order. A balance between performance and power dissipation is studied to define the ideal operation point of the optimized MCA. For construction of a prototype, cylinders with the previously defined dimensions were fabricated using grade 5 Flame Retardant (FR-5) Fiberglass Epoxy. Circular holes of 2 mm diameter were punched through for cable-ties passage for holding the wire bundles of each channel.
| Current-Driving Source and System Calibration One important aspect of MCA design is its current driver. It should provide a stable current of at least 1 A (used in  7  ), must be able to switch rapidly from one current configuration to the next for dynamic shimming, and finally be robust to gradient-induced voltages. Our SCOTCH system is controlled, via an Arduino board, by an open-source multi-channel feedback-controlled current driver  34  , theoretically capable of delivering up to 8 A per channel. Nevertheless, for this work, power supplies were dimensioned to deliver up to 3 A per channel, which seemed sufficient for shimming at 7T (cf. Results). A control interface (cf. Fig. 6 ) was designed in MATLAB to communicate with the Arduino board and transfer ideal current setpoints to the current driver.
For fieldmap estimation per 1A unit current in each channel, a triple-echo GRE sequence was repeatedly played on our 7 T MAGNETOM scanner (Siemens Healthcare GmbH, Erlangen, Germany), using a 180 mm-diameter spherical oil phantom. Sequence parameters were TR = 10 ms, TE 1 = 1. 6 ms, TE 2 = 4. 3 ms and TE 3 = 7 ms, 2 mm isotropic resolution, and 1860 Hz pixel bandwidth. For each channel, three acquisitions were performed: at -1 A, 0 A and 1 A. For each measurement, the TE2-TE1 phase difference images are first spatially unwrapped using SEGUE  35  ; then in each voxel, as for the human database acquired at 3T, the third echo phase is potentially temporally unwrapped based on the phase evolution trend given by the first two echoes, and a triple point linear fit of that evolution is performed to estimate the fieldmap in the characterization volume.
The three fieldmaps for each channel are finally used in a An important step in the calibration phase was to precisely record the position of the shim insert to ensure it will always be identically positioned when performing in-vivo measurements. To do so, once aligned with the MRI scanner laser used for patient positioning, reference points along the SCOTCH cover cylindrical surface coinciding with the laser were marked with a permanent marker pen. After characterization, shimming performance was assessed on the database by inputting the measured fields per unit current as shimming basis for the inverse problem in eq. 4. It is then compared to expected performance obtained from SLM simulations.
| Validation with External Open-Access Fieldmap Database and Spherical Harmonic Rating Hold-out cross-validation of the proposed design method has been presented in a preliminary study  36. So in the current work, it was decided to employ the entire database of 100 subjects for SCOTCH design. Nonetheless, an OAD composed of 126 brain fieldmaps at 7 T with 4 mm isotropic resolution has been made available  37  ; so shimming brains from that alternative database acquired at a different research site would increase confidence in the proposed design. No information on the FOV center coordinates of the OAD fieldmaps was made available. Therefore, a preliminary verification was performed to determine if the OAD fieldmaps would fit in our RF coil of 210 mm internal diameter. In order for the brains to fit, each one must lie within a range defined by the RF coil radius minus the distances between dimensions from each volunteer are readily available, the distances between brain extremities and head extremities in the posterior-anterior (PA) direction are not.
An average for those distances was then estimated by measurements performed on 10 IHD subjects (where DICOM images are available). Average thicknesses are d back = 13. 6 mm and d front = 18. 0 mm. It was initially assumed that the center of the 3D matrices containing the fieldmap data is coincident with the MRI isocenter. Under this assumption, the spread of voxels in space is shown in Figure  7a , with RF coil limits and allowed brain voxel limits displayed for reference. We observe that the OAD fieldmaps need to be translated in the PA direction in order to fit within our AVANTI2/SCOTCH setup and respect the estimated allowed region for the brain. This translation is performed on the entire database such that the back of each brain is located at the lower limit, providing a voxel position distribution as depicted in 7b.
| Quantitative Analysis with B0-map improvement The 3D non-selective rS-GRE was then employed for fieldmap estimation by means of a triple-echo acquisition with TE 1 = 2 ms, TE 2 = 3. 6 ms, TE 3 = 6 ms and TR = 100 ms. Short k T -points pulses  40  were used for excitation homogeneity, earlier computed from previously collected head-like phantom B1-maps. Isotropic resolution of 2. 0 mm was used, which was within recommendations from  41. Bandwidth per pixel was 1313 Hz. Images were reconstructed with the Sum of Squares technique, and the resulting DICOM data was employed for fieldmap estimation. As for the 3T database, the amplitude image was used as input in FSL's BET  32  to create a brain mask, thus limiting the ROI to brain voxels. Then, as for the phantom calibration at 7T, phase images were used to performed spatial unwrapping of the phase difference between the two first echoes within the masked regions using SEGUE  35.
We emphasize that due to the rS constraint, employed sequences were relatively long, with approximately 7 min required for each GRE fieldmap acquisition, and around 1 min for each EPI sequence. This makes the experiment prone to errors caused by patient movement during or in-between acquisitions. Indeed patient motion was observed in the course of the experiment. In order to ensure comparisons between identical anatomic regions, image registration was employed using Matlab to compensate for subject movement. More precisely, a rigid 3D transformation is found between the GRE raw amplitude images acquired at baseline (fixed reference) and during scotch shimming (moved image). Its inverse is applied to the moved B0 map to have it in the baseline reference frame.
| Expected SCOTCH Performance from Simulated Field Basis and Subsequent Choice of Maximum Channel Current SCOTCH shimming simulation results on the 100-subject database at 7 T are shown in Fig. 9 , based on simulated fields. Different electric current constraints were assessed for performance in terms of the resulting inhomogeneity across the database. Average power requirement was also estimated. The results are shown for different shim system configurations as the number of channels and layers increase. In all simulations, improvement of the resulting homogeneity is observed as the number of optimized channels increases. At 3 A, for instance, inhomogeneity drops from a baseline of 65. 7 Hz (SD: 11. 4 Hz) to 47. 6 Hz (SD: 8. 2 Hz), 44. 3 Hz (SD: 7. 4 Hz) and 42. 9 Hz (SD: 7. 2 Hz) as the number of channels is increased from 24 to 36 and 48.
| Performance from Measured Field Basis The SCOTCH prototype was built up to 3 layers and 48 channels. The 3. 48-system was characterized, and measured fieldmaps were used as basis for shimming simulation, first on our IHD. Comparison of inhomogeneity values obtained with simulated and measured fields serves as preliminary validation of the prototype. Results are shown in Fig. 10a  for electric current constrained to 3 A. Inhomogeneity values resulting from simulated matrix-MCA shimming are also provided for comparison. In addition, the performance of joint shimming of the SCOTCH system with the 2nd-order SH system embedded in the 7T scanner is provided, since we were able to characterize the latter with specific B0-field maps of a spherical phantom. From the 100-subject database, a small drop in performance of the prototype is observed relatively to ideal SCOTCH.
| Validation on External Database For further validation purposes, Fig. 10b  shows shimming simulation results on the external 126-fieldmap OAD. The realistic SCOTCH-2. 36 shimming results in an average inhomogeneity of 39. 5 Hz (SD: 6. 7 Hz), close to the 39. 3 Hz (SD: 6. 9 Hz) inhomogeneity stemming from 48-channel m-MCA shimming, but obtained with 12 channels less. SCOTCH's performance in the 2. 36 configuration is still close to the 38. 6 Hz (SD: 6. 4 Hz) inhomogeneity obtained by a 6 th order SH shimming system. For the realistic SCOTCH-3. 48 shimming simulations, resulting inhomogeneity is 38. 1 Hz (SD: 6. 6 Hz), a 2. 9% increase from 37. 0 Hz (SD: 6. 2 Hz) expected from simulated fields. The latter is close to the 36. 4 Hz (SD: 5. 9 Hz) average inhomogeneity achieved with unconstrained 7 th order SH shimming.
The 96-channel MCA slightly outperforms SCOTCH-3. 48 on this particular database. We notice that the OAD absolute average inhomogeneities vary considerably from those obtained when shimming the IHD. The realistic SCOTCH-3. 48 yields a 5. 7 Hz difference when shimming the OAD versus the IHD. Analyzing the relative inhomogeneity reduction from baseline, 41. 1 % (SD: 5. 6 %) and 30. 4 % (SD: 7. 1 %) are obtained for the OA and IH databases, respectively. For m-MCAs, similar large differences in resulting inhomogeneity are also observed. This can be due to differences in the B0 map resolutions, in the way baseline shimming is performed at the scanner, or in the way brain masking is carried out. Nevertheless we can evaluate SCOTCH's robustness from the SHR: for instance the realistic SCOTCH-2. 36 leads to an OAD SHR of 5.
7 (SD: 0. 6 ), versus 6. 0 (SD: 0. 6 ) for the IHD, therefore a OAD/IHD ratio of 0. 95. If robustness performance is measured by such a metric, we can conclude that SCOTCH is robust to new fieldmaps. The SHR was also calculated for the resulting inhomogeneity after 48-channel m-MCA shimming, leading to 5. 7 (SD: 0. 5 ) and 5. 8 Hz (SD: 0. 4 Hz) on the IH and OA databases, respectively, resulting in a 1. 02 OAD/IHD ratio. Since the m-MCA performs similarly on both databases, the SHR is confirmed to be a universal indicator of system performance, regardless of the B0-map database. At last in both Fig. 10a  and 10b , one can appreciate how combined SCOTCH + up to 2nd-order SH shimming improves performance compared to SCOTCH-only shimming (green curves).
| SCOTCH power dissipation Average power dissipation of m-MCAs and SCOTCH constrained to 3 A per channel is estimated from simulated and measured field bases in Fig. 11. It is observed to increase as the number of channels and shimming performance increase. For a given system design, power dissipation is practically the same on both databases. When shimmed Incidentally, increase in power dissipation is yet much more drastic from the 24-channel m-MCA to the 96-channel, The joint SCOTCH + SH shimming reduces the power dissipation drastically (for an even better performance), provided a 0. 1 unit relaxation on the achieved SHR. with power dissipation at 24 channels equal to 0. 3 W (SD: 0. 2 W) and 0. 2 W (SD: 0. 1 W) for the IH and OA databases, respectively. Fig. 12  shows power histograms across the IHD subjects with SCOTCH3.
| Performance Loss from Ideal Single-Loop Model to Realistic Multi-Turn Bundles With the prototype built and characterized, shimming simulations constrained to 3 A (the chosen operation current) could be performed for comparison of realistic versus ideal SCOTCH performances. Resulting inhomogeneity from realistic SCOTCH shimming simulation was greater than expected, on both IH and OA databases. The loss in performance is not surprising since ideal SCOTCH simulations were performed considering the basis field for each channel as the field of a single loop multiplied by the number of turns (twenty); however, realistic wire bundles composing each channel deviate from the ideal SLM. This deviation also causes an increase in power dissipation, as electric currents also become higher. Due to the proximity of some ideal loops to one-another, the thick wire bundles could not always be wound having their geometric center coincident with the ideal loop coordinates, causing some windings to be slightly deformed towards the center of their loop.
| SCOTCH Design Validation and Spherical Harmonic Rating One of the most important aspects of the design was its validation on both internal and external brain B0-map databases, required to guarantee robustness to new fieldmaps and inter-subject variability. However, resulting inhomogeneity after shimming simulations on the IH and OA databases, independently of the shim MCA employed (SCOTCH or matrix-like), was very different from one database to the other, despite baseline inhomogeneity being numerically close. Surprisingly, shimmed inhomogeneity was lower on the external OAD, maybe due to a downgraded image resolution. This suggested that the inhomogeneity metric might not be the ideal for any cross-validation study. Looking at the SH equivalent performance indicated by the dotted lines in Fig.