KEYWORD column_delimiter section_header single_page interleaving name_format output_directory output_prefix template DESCRIPTION mrc2txt 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. mrc2txt accepts the command-line arguments described in Region.hlp. In addition, it has the following options (parts in brackets are optional): -delimiter=delim Sets how columns are separated in the output file. delim can be either space, tab, or newline. By default, mrc2txt uses tabs. -dir=dir Sets the name of the directory to use in the file name template when mrc2txt generates multiple output files from the input file. If you use the -single option to force mrc2txt to generate one output file, the -dir option has no effect. By default, the directory name is an empty string. -header=template Sets the template for the text mrc2txt prints before the data for each section. By default, mrc2txt does not print anything to introduce the data for a section. -interleave=arrangement Sets the interleaving to use when writing multiple sections to a single text file or for calculating output section indices for custom file name templates. Allowed values for arrangement are twz, tzw, wtz, wzt, ztw, or zwt; ztw is the default. -out=name or -out=name_format If you use the -single option, use -out to set the name of the file to generate. If you do not use the -single option, you can use -out to select one of the predefined output file name templates. The allowed values for name_format when you do not use the -single option are: prefix+wzt Causes mrc2txt to generate output file names as if "prefix_w#_z#_t#.txt" had been selected from the user interface. This is the default. prefix+wz Causes mrc2txt to generate output file names as if "prefix_w#_z#.txt" had been selected from the user interface. prefix+wt Causes mrc2txt to generate output file names as if "prefix_w#_t#.txt" had been selected from the user interface. prefix+zt Causes mrc2txt to generate output file names as if "prefix_z#_t#.txt" had been selected from the user interface. prefix+w Causes mrc2txt to generate output file names as if "prefix_w#.txt" had been selected from the user interface. prefix+z Causes mrc2txt to generate output file names as if "prefix_z#.txt" had been selected from the user interface. prefix+t Causes mrc2txt to generate output file names as if "prefix_t#.txt" had been selected from the user interface. When you do not use the -single option, the -template option will override the -out option. -prefix=pref Sets the prefix to use in the file name template when mrc2txt generates multiple output files from the input file. If you use the -single option to force mrc2txt to generate one output file, the -prefix option has no effect. By default, the prefix is an empty string. -single If you use this option, mrc2txt will generate a single output file (whose name is controlled by the -out option). If you do not use this option, mrc2txt will generate one file for each section drawn from the input file. -template=custom_template Sets the file name template mrc2txt will use when generating one file per section in the MRC file. This option has no effect if you use the -single option and overrides the -out option when you do not use the -single option. By default, the prefix is an empty string. 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 column_delimiter Use the "Column Delimiter" menu to select what is used to separate columns in the output. The available choices for the column delimiter are: space Each column is separated from the next by a single space. tab Each column is separated from the next by a tab. newline Forces the output to have a single column. section_header 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: % Causes a percent sign to be inserted. z This conversion code is replaced with the z index for the section. w This conversion code is replaced with the wavelength index for the section. t This conversion code is replaced with the time point index for the section. s This conversion code is replaced with the section number for the section. 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. single_file 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. interleaving 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 file 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: twz p = it + nt * (iw + nw * iz) tzw p = it + nt * (iz + nz * iw) wtz p = iw + nw * (it + nt * iz) wzt p = iw + nw * (iz + nz * it) ztw p = iz + nz * (it + nt * iw) zwt p = iz + nz * (iw + nw * it) name_format 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 output_directory 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. output_prefix 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. template 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: % Causes a percent sign to be inserted in the file name. d This conversion code is replaced with the contents of the Directory field. p This conversion code is replaced with the contents of the Prefix field. z This conversion code is replaced with the z index for the section stored in the file. w This conversion code is replaced with the wavelength index for the section stored in the file. t This conversion code is replaced with the time point index for the section stored in the file. s This conversion code is replaced with the section number for the section stored in the file. 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.