Convert from Priism's Native Format to Spider's Native Format

Overview

This application takes a Priism file and converts it into one or more files in Spider's native format. The conversion is direct: no scaling or transformation of the data values occurs.

mrc2spi has the standard set of Priism controls for selecting a subset of the Priism file to convert. For the conversion, the key choice that has to be made is whether to convert each section in the input into a separate file or to place the sections one after the other in one file. When you want to generate multiple output files, the "Prefix" and "Extension" fields control the output file names. When you want to generate a single output file, the name in the "Output file" field will be the name of the file generated. By default, mrc2spi will generate a file using the native byte ordering for the operating system and machine where you run mrc2spi. To generate a file with the non-native byte ordering, turn on the "swap bytes" toggle button.

The current version of mrc2spi has several limitations:

Topics

Overview | Region processing | Single file | Swap bytes | Output file | Prefix | Extension | Command line

Related Priism Topics

Priism


Single File

The output of mrc2spi can be a single file with the sections appearing one after the other or multiple files with one section per file. To generate one file with mrc2spi, turn on the "Single file" toggle button and enter the name of the file to generate in the "Output file" field. To generate multiple files, turn off the "Single file" toggle button, enter the file name prefix (the directory name and leading part of the file name) in the "Prefix" field, and enter the file name extension (by default it is .spi) in the "Extension" field. The names of the files will consist of the prefix followed by the section number written as a base ten integer with a fixed number of digits and then the extension. The section numbers will range from one to the number of sections selected. If the number of sections selected is less than 1000, the section number will be written as three digits. If the number of sections selected is greater than or equal to 1000, the section number will be written as n digits where n is the number of digits necessary to express the number of selected sections as a base 10 integer.

Return to overview


Swap Bytes

By default, mrc2spi generates Spider files in the native byte ordering for the machine and operating system where you run mrc2spi. To generate a file with the non-native byte ordering, turn on the "swap bytes" toggle button.

Return to overview


Output File

When the "Single file" toggle button is on, mrc2spi converts the input file to a single Spider file whose name is shown in the "Output file" field.

Return to overview


Prefix

When the "Single file" toggle button is off, mrc2spi converts the input file to a numbered series of Spider files. The file names for the numbered series will all start with whatever is entered in the "Prefix" field. Normally, the prefix would be something like /home/eric/data/cent_2005_10_12_a_: it would contain the directory where the files would be written, /home/eric/data/, followed by something to identify the data set, cent_2005_10_12_a.

Return to overview


Extension

When the "Single file" toggle button is off, mrc2spi converts the input file to a numbered series of Spider files. The file names for the number series will all end with whatever is entered in the "Extension" field. By default, the extension is .spi.

Return to overview


Command Line

mrc2spi accepts the command-line arguments described in Region.html. In addition, it has the following options:

-out=n
Causes mrc2spi to generate a single Spider file named n. If you specify both -out and -prefix options on the command line, whichever such option that appears last takes precedence.
-prefix=p
Causes mrc2spi to generate a numbered series of Spider files. The file names for the numbered series will all start with the prefix, p. If you specify both -out and -prefix options on the command line, whichever such option that appears last takes precedence.
-ext=e
Sets the extension mrc2spi will use when generating file names in a numbered series. By default, mrc2spi uses .spi as the extension.
-swab
Causes mrc2spi to generate files with the non-native byte ordering. By default, mrc2spi generates files with the native byte ordering.

The example below extracts a 160 x 160 x 160 region from a.dat and writes it to a.spi in the non-native byte ordering.

    mrc2spi a.dat -x=0:159 -y=0:159 -z=0:159 -out=a.spi -swab

The example below saves the data from b.dat as a numbered series of Spider files.

    mrc2spi /home/eric/data/b.dat -prefix=/home/eric/data/b_ -ext=.spi

Return to overview