Convert from Priism's Native Format to TIFF

Overview

This application takes a Priism file and converts it into one or more TIFF files. The conversion is direct: unlike the output of TiffMovie, the representation of each pixel value does not change. A drawback with the direct conversion is that the output will usually be 16-bit signed integers or 32-bit floating-point values (the exact format will depend on the format of the Priism file) and will not be readable by another application that only supports the baseline TIFF formats (1-, 4-, and 8-bit unsigned integers). To work around that problem, you could use Image Arithmetic or Copy Region to scale and convert the data so that each pixel is represented in a format that the TIFF reader can understand and then use Mrc2tiff to do the conversion to TIFF.

Mrc2tiff 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 page in a multipage TIFF file or to convert each section into a separate TIFF file. For multipage output, 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 multiple TIFF files, the important controls affect the generation of the output file names: the "Name format" menu, Directory field, Prefix field, and Template field.

Mrc2tiff is not able to convert complex-valued data.

Topics

Overview | Region processing | Multipage | Interleaving | Name format | Directory | Prefix | Template

Related Priism Topics

TiffMovie | Tiff2mrc | Image Arithmetic | CopyRegion | Priism


Multipage

The output of Mrc2tiff can be a single TIFF file which has multiple pages, each page has the data for one section, or can be multiple TIFF files, each TIFF file has the data for one section. Choose the format to match what your TIFF reader expects; beware that some TIFF readers may only be able to access the first page in a TIFF file with multiple pages.

To have Mrc2tiff generate a TIFF file with multiple pages, turn on the Multipage 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 numbering of the pages reflects the z, wavelength, and time point indices for each section.

To have Mrc2tiff generate multiple TIFF files, turn off the Multipage 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.

Topics

Overview | Region processing | Multipage | Interleaving | Name format | Directory | Prefix | Template


Interleaving

Interleaving specifies how the z, wavelength, and time point indices map to the page number for multiple page output and how output section numbers are computed for custom filename templates. 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 page number (or output section number), p, with the different interleaving options is:

twz
it+nt*(iw+nw*iz)
tzw
it+nt*(iz+nz*iw)
wtz
iw+nw*(it+nt*iz)
wzt
iw+nw*(iz+nz*it)
ztw
iz+nz*(it+nt*iw)
zwt
iz+nz*(iw+nw*it)

Topics

Overview | Region processing | Multipage | Interleaving | Name format | Directory | Prefix | Template


Name Format

When multiple TIFF 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#.tif", 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#.tif" 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.tif.

Topics

Overview | Region processing | Multipage | Interleaving | Name format | Directory | Prefix | Template


Directory

When multiple TIFF 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.

Topics

Overview | Region processing | Multipage | Interleaving | Name format | Directory | Prefix | Template


Prefix

When multiple TIFF 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.

Topics

Overview | Region processing | Multipage | Interleaving | Name format | Directory | Prefix | Template


Template

The file name generation mechanism for multiple TIFF 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#.tif", is equivalent to the custom template, %d/%p_w%aw_z%az_t%at.tif. The custom template, /var/tmp/%2iz_%2iw_%2it.tif, 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.

Topics

Overview | Region processing | Multipage | Interleaving | Name format | Directory | Prefix | Template