Converting between file types - cianfrocco-lab/Old-school-processing GitHub Wiki

Home > Getting started > Converting between file types

As you will quickly notice, there are a variety of file types that are used interchangeably within electron microscopy image processing. Many software packages expect specific file formats, which means that you WILL have to be converting your data between different file types.

Scroll down to see an extensive list of possible conversions that you will encounter. Click each link to learn how to convert the file type:

General notes

SPIDER:

  • SPIDER files .spi can be individual 2D images, 2D stacks, or 3D volumes

IMAGIC

  • IMAGIC files are individual 2D images or 2D stacks.
  • IMAGIC files have BOTH .img and .hed files that share the same name base name. For instance, a stack would have two files associated with it: stack.img and stack.hed. The .hed file contains the image parameters, while the .img file contains the actual images.

MRC

  • MRC images .mrc (and .mrcs) can be 2D images, 2D stacks (.mrcs), or 3D volumes.
  • Relion uses .mrc images for all file types: 2D images, stacks, and 3D volumes. Note that Relion uses an extension .mrcs to indicate a stack of .mrc images.

Relion

  • Since Relion using .mrc images, you simply follow the conventions for converting into/outof MRC format.

XMIPP

  • XMIPP reads the same images as SPIDER, except it does NOT read particle stacks. For particle stacks, you must create a folder containing all individual images that would be within a single stack.


Imagic stack (.img/hed) to SPIDER stack (.spi)

$ proc2d [stack].img [stack].spi spiderswap

Imagic/SPIDER stack to Xmipp/Relion

$ ./Convert_stack_to_xmippRelion_format.py
usage: Convert_stack_to_xmippRelion_format.py -i  -o  --num=[number of particles in stack]

options:
  -h, --help  show this help message and exit
  -i FILE     Particle stack in .img or .spi format
  -o FILE     Output folder name for single particles
  --num=INT   Number of particles in stack
  -d          debug

Imagic/SPIDER to EMAN2/Sparx (.hdf)

$ ./Convert_imagicSpider_to_hdf.py -h
Usage: Convert_imagicSpider_to_hdf.py raw_images apix 

Options:
  --version   show program's version number and exit
  -h, --help  show this help message and exit

SPIDER (.spi) stack to Imagic stack (.img/hed)

$ proc2d [stack].spi [stack].img

Xmipp/Relion to SPIDER

$ ./Convert_xmippRelionParticles_to_stack.py 
usage: Convert_xmippRelionParticles_to_stack.py -i  -o  --num=[num. of particles] --name=

options:
  -h, --help  show this help message and exit
  -i FILE     Folder containing the particles for analysis
  -o FILE     Particle stack output name in .spi format
  --num=INT   Number of particles in stack
  --name=STR  Particle basename (e.g. data)
  -d          debug

.dm3 to .mrc

Converting a Gatan formatted image (.dm3) to mrc:

$ proc2d [micro].dm3 [micro].mrc mrc

Conversions to FREALIGN

This is a bit more complicated, please read more under the [Frealign Refinement] site.

⚠️ **GitHub.com Fallback** ⚠️