# Reorient: A Web tool for reorienting and cropping MRI data.

Katja Heuer, Roberto Toro

► To cite this version:

Katja Heuer, Roberto Toro. Reorient: A Web tool for reorienting and cropping MRI data.. Journal of Open Source Software, 2020, 5 (55), pp.2670. 10.21105/joss.02670. hal-03745180

HAL Id: hal-03745180

https://hal.science/hal-03745180v1

Submitted on 3 Aug 2022

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
# Reorient: A Web tool for reorienting and cropping MRI data.

Katja Heuer¹, ² and Roberto Toro¹, ³

1 Center for Research and Interdisciplinarity, University of Paris 2 Max Planck Institute for Human Cognitive and Brain Sciences 3 Institut Pasteur

DOI: 10.21105/joss.02670

Software

- Review ⚙️

<figure><img src="image_2.png" /></figure>

- Repository ⚙️

<figure><img src="image_3.png" /></figure>

- Archive ⚙️

<figure><img src="image_4.png" /></figure>

Editor: Olivia Guest ⚙️

<figure><img src="image_5.png" /></figure>

Reviewers:

- @sneakers-the-rat

- @pauldmccarthy

Submitted: 11 September 2020

Published: 01 November 2020

License

Authors of papers retain copyright and release the work under a Creative Commons Attribution 4.0 International License (CC BY 4.0).

## Summary

Reorient (https://neuroanatomy.github.io/reorient) is an open source Web application for the manual alignment and cropping of MRI nifti volumes in an intuitive way. The MRI data is dragged onto the Web interface and visualised in an interactive stereotaxic viewer. Users can then translate and rotate the brain by simply dragging inside the 3 view planes, and an adjustable selection box allows to define the crop of the image. Users can save the resulting affine matrix, selection box as well as the reoriented and cropped volume. The affine matrix and selection box can be used later within a scripted workflow, able to reproduce the reoriented volume from the original data. Existing rotation matrices can be loaded or appended.

## Statement of need

Having a properly oriented MRI dataset is a fundamental step in any neuroimaging workflow. For example, manual segmentation is greatly simplified by the symmetry obtained by aligning brains with respect to the perpendicular stereotaxic planes. In human neuroimaging MRI orientation is often done automatically, using atlas registration to generate an affine matrix representing the rotation and translation necessary to align the superior/inferior, anterior/posterior and left/right directions. However, this is not always the case in other species, or in developmental data. For most species there is no reference atlas, and especially in ex vivo neuroimaging, brains are often oriented in arbitrary ways with respect to the stereotaxic planes, and may have large non-tissue space surrounding the brain. Manually configuring the affine matrix, although possible, is difficult and time consuming.

Reorient complements existing tools by providing an intuitive approach for manual image reorientation and all components for a fully reproducible workflow. We have used it extensively to reorient >120 different vertebrate species, including to reorient and crop data from >30 different primate species (Heuer et al., 2019). Even for completely arbitrarily oriented brains, with different data encodings and anisotropic voxels, the tool is intuitive to use and provides a fast and precise method to include manual alignment in a reproducible workflow.

## Methods

Reorient was coded in JavaScript and runs as a GitHub Web page. Code style was verified using eslint (https://eslint.org). Unit tests and end-to-end tests were implemented using mocha.js (https://mochajs.org) and puppeteer (https://pptr.dev). Modifications in the code are continuously tested using CircleCI (https://circleci.com).
## Figures

<figure><img src="image_6.png" /><figcaption>**Figure 1:** Reorient. A Web tool for reorienting and cropping MRI data. Top: Reorient interface. Interactive stereotaxic viewers with orientation information panel on the side. Dragging is used to easily translate, rotate and crop the data. Save the reorientation matrix and the crop box along with the reoriented Nifti volume for a reproducible workflow. Middle: Reorientation example using a macaque from Prime-DE site "amu" (Brochier et al., 2019; Milham et al., 2020). Left: Center brain by dragging in the interface. Middle: Rotate brain with respect to the standard view axes. Right: Select brain and crop the surrounding tissue. Bottom: Reorientation result. A reorientation matrix and selection box can be obtained in ~1 min for a typical brain. The image shows the Nifti volume saved by reorient, produced using trilinear interpolation, displayed in FSLeyes.</figcaption></figure>

## Acknowledgements

We thank Chris Klink for kindly testing our tool and giving his feedback.
References

Brochier, T., Belin, P., Chavanne, F., Velly, L., Bodin, C., Renaud, L., Martin, M., et al. (2019, September). Macaca mulatta structural and diffusion weighted mri data. Zenodo. doi:10.5281/ZENODO.3402456

Heuer, K., Gulban, O. F., Bazin, P.-L., Osoianu, A., Valabregue, R., Santin, M., Herbin, M., et al. (2019). Evolution of neocortical folding: A phylogenetic comparative analysis of mri from 34 primate species. *Cortex*, **118**, 275-291. doi:10.1016/j.cortex.2019.04.011

Milham, M., Petkov, C. I., Margulies, D. S., Schroeder, C. E., Basso, M. A., Belin, P., Fair, D. A., et al. (2020). Accelerating the evolution of nonhuman primate neuroimaging. *Neuron*, **105**(4), 600-603. doi:10.1016/j.neuron.2019.12.023