LinuxCommandLibrary

bioradtopgm

Convert Bio-Rad gels to PGM/PPM images

TLDR

Read a Biorad confocal file and store the n'th image contained in it to as a PGM file

$ bioradtopgm -[n] [path/to/file.pic] > [path/to/file.pgm]
copy

Read a Biorad confocal file and print the number of images it contains
$ bioradtopgm [path/to/file.pic]
copy

Display version
$ bioradtopgm [[-v|-version]]
copy

SYNOPSIS

bioradtopgm [options] [bioradfile]

PARAMETERS

-flip
    Flips the image rows (vertically) before outputting the PGM/PPM.

-flop
    Flips the image columns (horizontally) before outputting the PGM/PPM.

-rotate
    Rotates the image 90 degrees clockwise before outputting.

-verbose
    Prints detailed debugging or informational messages to standard error during processing.

-info
    Parses the input Bio-Rad file and prints its metadata (dimensions, channels, slices, etc.) to standard error, then exits without generating an image.

-truegrayscale
    Prevents the default scaling of grayscale values to the full 0-255 range. The original pixel intensity values are preserved without contrast enhancement.

-color
    Forces the output to be a PPM (Portable Pixmap) color image, even if the Bio-Rad file might otherwise be interpreted as grayscale. This is particularly useful for older files where color information might be present but not immediately obvious.

-min
    Sets the minimum intensity value for image scaling. Pixels with intensity less than N will be clamped to N during conversion.

-max
    Sets the maximum intensity value for image scaling. Pixels with intensity greater than N will be clamped to N during conversion.

-z
    Specifies which Z-axis slice number (0-indexed) to extract from a 3D Bio-Rad dataset. Default is 0.

-t
    Specifies which T-axis (time series) slice number (0-indexed) to extract from a time-lapse Bio-Rad dataset. Default is 0.

-channel
    Specifies which channel number (0-indexed) to extract from a multi-channel Bio-Rad image. Default is 0.

-image
    Specifies which image number (0-indexed) to extract from a Bio-Rad file containing multiple distinct images. Default is 0.

DESCRIPTION

The bioradtopgm command is a specialized utility included in the extensive Netpbm toolkit, which provides a comprehensive set of tools for image format conversion and manipulation. Its primary function is to convert proprietary image files generated by Bio-Rad confocal microscopes, specifically those in the PIC format, into open, portable image formats: PGM (Portable Graymap) for grayscale images or PPM (Portable Pixmap) for color images.

By default, if the Bio-Rad file is grayscale, bioradtopgm will output a PGM file. However, if the source file contains color information and the -color option is specified, it will produce a PPM file. This conversion capability is crucial for researchers and users who need to process, analyze, or integrate Bio-Rad microscopy data with standard image processing software or custom scripts that are compatible with Netpbm formats.

CAVEATS

The bioradtopgm command is tightly integrated into the Netpbm ecosystem. This means its direct output is typically a PGM or PPM stream to standard output, not a common format like JPEG or PNG. Users will often need to pipe the output to another Netpbm utility (e.g., pnmtojpeg or pnmtopng) for conversion to more widely used image formats.

The command is specifically designed for Bio-Rad PIC format files and will not recognize or process other image formats. When dealing with multi-dimensional (Z, T, channel) or multi-image Bio-Rad files, bioradtopgm extracts only one specified slice/channel/image per invocation. Batch processing of such files typically requires scripting multiple command calls.

INPUT AND OUTPUT HANDLING

If no bioradfile argument is provided, bioradtopgm will read the Bio-Rad PIC data from standard input (stdin). The resulting PGM or PPM image is always written to standard output (stdout). This design philosophy is central to Netpbm's Unix-like pipe-oriented operation, allowing for efficient chaining of commands, for example: cat bioimage.pic | bioradtopgm -z 5 | pnmtojpeg > slice5.jpg.

INTENSITY SCALING AND SCIENTIFIC DATA

By default, bioradtopgm scales the intensity values of the Bio-Rad image to span the full 0-255 range of the PGM or PPM format. While this often improves visual contrast, it may alter the original quantitative intensity relationships. For scientific applications where absolute photometric values are critical and should not be modified, it is essential to use the -truegrayscale option to preserve the original intensity values without scaling.

HISTORY

bioradtopgm is an integral part of the venerable Netpbm collection of graphics utilities. The Netpbm project, originating from the PBMPLUS toolkit developed by Jef Poskanzer in the late 1980s, is renowned for its modular design, allowing users to chain simple commands together via pipes to achieve complex image manipulations. bioradtopgm was developed to fill a specific niche: enabling the conversion of proprietary Bio-Rad confocal microscope image data into Netpbm's open, interchangeable formats. This allows scientific and medical researchers to seamlessly integrate their Bio-Rad data into open-source workflows, facilitating further analysis and visualization with the rich set of tools available in Netpbm and beyond.

SEE ALSO

pgm(5), ppm(5), netpbm(1), anytopnm(1), pnmtopng(1), pnmtojpeg(1), pamflip(1)

Copied to clipboard