MRC files are read in flipped in Y

I am the principal developer of the IMOD package, which uses MRC format. ImageJ is reading these files in inverted in Y, unless they are read in through the Bioformats plugin. The MRC format is defined as a right-handed coordinate system with the first pixel in the file corresponding to the lower left corner of the image. This is not a recent “clarification” but has been in the MRC documentation at least since 2000, with the statement then being “In general, the X-Y origin is taken as 0,0 being in the lower-left corner of the image AND the first data point in the file”.

Selecting a file with extension .mrc or .st or .rec with File-Open makes it read in inverted. Selecting MRC files with other extensions like .ali makes it go through the BioFormats importer and they read correctly. Reading a file with any extension through Plugins-BioFormats-Importer works correctly.
The example file from my other issue will illustrate this:

Hi @David_Mastronarde,

thank you for reporting this issue with the MRC formats.

The reader that is used for MRC format when opening via File > Open does not take into account the location of the coordinate system’s origin. I have created a really dirty quick fix (see that flips the images after loading so you don’t have to do it.

If, as you say, the Bio-Formats support is better (what about metadata etc?), one could argue for dropping the aforementioned reader in favor of Bio-Formats. Do you have an idea how widely it is still used @albertcardona?


I don’t know how used is the MRC reader that I wrote, but I use it. It is simple and fast, unlike other options. Indeed it does not consider all possible options for the MRC format.