This application takes a Priism file and converts it into one or more text files. The conversion is direct: no scaling or transformation of the data values occurs.
Mrc2txt 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 multiple output files are to be generated, the important controls affect the generation of the output file names: the "Name format" menu, Directory field, Prefix field, and Template field. When a single output file is to be generated, the controls that are important are the "Output file" button to browse for the output file, the field next to the "Output file" button in which the output file name can be entered directly, and the Interleaving menu which controls the ordering of pages in the output. For both single and multiple file output, use the column delimiter menu to select how columns are separated from on another in the output and the section header field to enter the optional text that is printed before the start of each section's data.
Overview | Region processing | Column delimiter | Section header | Single file | Interleaving | Name format | Directory | Prefix | Template | Command line
Use the "Column Delimiter" menu to select what is used to separate columns in the output. Because the printed values may be padded with spaces to ensure a uniform presentation, there can be additional spaces separating the columns. The available choices for the column delimiter are:
Overview | Region processing | Column delimiter | Section header | Single file | Interleaving | Name format | Directory | Prefix | Template | Command line
Use the "Section Header" field to enter text that will be printed, on a separate line, before the start of each section's data. If nothing is entered in the "Section Header" field, then the rows of text for one section are not separated in any way from the rows of text for the next section.
When the section header is printed, special conversion codes are expanded. The conversion codes have the following general form: %[i]code. Possible values for code are:
If the i modifier is used with the z, w, t, or s codes then the index that replaces the conversion code is computed relative to the dimensions of the input file; otherwise, it is computed relative to the dimensions of the region selected for conversion.
Overview | Region processing | Column delimiter | Section header | Single file | Interleaving | Name format | Directory | Prefix | Template | Command line
The output of Mrc2txt can be a single file with the sections appearing one after the other or multiple files with one section per file.
To have Mrc2txt generate one output file, turn on the "Single file" toggle. The name of the output file can be set with the "Output file" button or adjacent field. Use the Interleaving menu to control how the sections appear within the file.
To have Mrc2txt generate multiple files, turn off the "Single file" toggle. The output file names are generated automatically in a variety of formats which can incorporate a directory name, prefix, and the z, wavelength, or time point indices for the section.
Overview | Region processing | Column delimiter | Section header | Single file | Interleaving | Name format | Directory | Prefix | Template | Command line
Interleaving specifies how the z, wavelength, and time point indices map to the ordering of sections in single file output and how output section numbers are computed for custom filename templates and section headers. If the output has nz z-sections, nw wavelengths, and nt time points, and a given section has a z-section index in the output of iz (0 <= iz < nz), wavelength index in the output of iw (0 <= iw < nw), and time point index in the output of it (0 <= it < nt) then the output section number, p, (i.e. the position the section will appear when a single file is written) with the different interleaving options is:
Overview | Region processing | Column delimiter | Section header | Single file | Interleaving | Name format | Directory | Prefix | Template | Command line
When multiple files are generated, the file names are generated by filling in a template. From the "Name format" menu you may select a standard template or choose the "custom template" option to use the template entered in the Template field. For the standard templates, the generated file names will all start with the contents of the Directory field, followed by a slash, and followed by the contents of the Prefix field. The remainder of the file name depends on which template was chosen: it will be the template name ("prefix_w#_z#_t#.txt", for instance) without the leading "prefix" and with "w#" replaced with a w followed by the output wave index for the section in the file, "t#" replaced with a t followed by the output time index for the section in the file, and "z#" replaced with a z followed by the output z index for the section in the file. The numbers of digits used for an index is the digits needed to represent the largest index in that dimension. As an example, with the "prefix_w#_z#_t#.txt" template, /var/tmp as the output directory, exp12_2002 as the output prefix, and an input region that has 3 wavelengths, 500 time points, and 30 z sections, the file name for the section whose output z, wavelength, and time indices are 1, 2, and 3 respectively would be /var/tmp/exp12_2002_w2_z01_t003.txt.
Overview | Region processing | Column delimiter | Section header | Single file | Interleaving | Name format | Directory | Prefix | Template | Command line
When multiple files are written and one of the standard file name formats is used, the generated file names will start with the contents of the Directory field. The section on name formats has an example of this. For a custom template, the contents of the Directory field are substituted for any %d conversion codes.
Overview | Region processing | Column delimiter | Section header | Single file | Interleaving | Name format | Directory | Prefix | Template | Command line
When multiple files are written and one of the standard file name formats is used, the generated file names will include the contents of the Prefix field. The section on name formats has an example of this. For a custom template, the contents of the Prefix field are substituted for any %p conversion codes.
Overview | Region processing | Column delimiter | Section header | Single file | Interleaving | Name format | Directory | Prefix | Template | Command line
The file name generation mechanism for multiple output files may use a custom file name template. To do so select "custom template" from the "Name format" menu and enter the template in the Template field. When generating file names, special conversion codes are expanded in the template. The conversion codes have the following general form: %[width][modifier]code.
The recognized codes are:
width is optional and may be used with the z, w, t, and s codes to specify the minimum number of digits which are used to display the index value. width may be a positive integer indicating the minimum number of digits to use or the letter a to indicate that the minimum number of digits should be the number of digits in the maximum corresponding index. If an index would have less than the minimum number of digits, leading zeros are added to fill in the missing portion.
modifier is optional and may be used with the z, w, t, and s codes. If modifier is not present, the index generated by those codes is computed for the output file. If modifier is the letter i, then the index is computed relative to the input file.
As an example, the standard name format, "prefix_w#_z#_t#.txt", is equivalent to the custom template, %d/%p_w%aw_z%az_t%at.txt. The custom template, /var/tmp/%2iz_%2iw_%2it.txt, would generate file names which included the input z, wavelength, and time indices of the section in the file. Each index would be displayed with at least two digits.
Overview | Region processing | Column delimiter | Section header | Single file | Interleaving | Name format | Directory | Prefix | Template | Command line
mrc2txt accepts the command-line arguments described in Region.html. In addition, it has the following options (parts in brackets are optional):
-delimiter=delim
-dir=dir
-header=template
-interleave=arrangement
-out=name or -out=name_format
-prefix=pref
-single
-template=custom_template
The following example saves the tenth z section from the first wavelength of fish.dat in section.txt.
mrc2txt fish.dat -z=9:9 -w=0 -single -out=section.txt
Overview | Region processing | Column delimiter | Section header | Single file | Interleaving | Name format | Directory | Prefix | Template | Command line