Reads a Bio-Rad PIC file and outputs the dimensions and data array.
module Read_PIC_core<data_import_module=1> { file+IPort2 &FILE; int bytes[6] => cache(file_obj_bin(.FILE,0,0)); int+OPort2 dims[3] => { (bytes[0] + bytes[1]*256), (bytes[2] + bytes[3]*256), (bytes[4] + bytes[5]*256) }; byte+OPort2 data[prod(dims)] => cache(file_obj_bin(.FILE,76,0)); };
This module reads a Bio-Rad PIC file and outputs its dimensions and field data. Bio-Rad PIC files contain 3D confocal microscope images, i.e. 3D scalar uniform fields. read_PIC outputs the dimensions of the field as an array of integers and the values of the field as an array of bytes. The outputs can be combined using uniform_scalar_field to produce a 3D uniform scalar field that can be visualized. This is done in the Read_Biorad_PIC functional macro.
This module performs the byte reordering necessary for it to work correctly on either big or little endian platforms.
FILE
The file object corresponding to the Bio-Rad PIC file that should be read.
dims
An array of three integers corresponding to the x-, y- and z-dimensions of the field.
data
An array of bytes corresponding to the field values.
read_PIC_core is used in the Functional Macro, Read_BioRad_PIC. This macro is in turn used by the User Macro, read_Biorad_PIC.
An example application Read_BioRad_PIC_Eg is provided that reads a Bio-Rad PIC file and produces a maximum intensity projection. A sample Bio-Rad PIC file, flea3.pic, is provided with the distribution of this module.
iac_proj/picio/pio_mods.v contains the read_PIC_core module V definition.
This module does not check that the file specified by the user is a valid Bio-Rad PIC file. If it is not then errors can occur.
Notes, which are sometimes appended to PIC files, are ignored.
This module will only handle 8-bit images. 16-bit and 24-bit images are not handled correctly.
The AVS5 module read_BioRad_PIC (available from the IAC) can also be used to read Bio-Rad PIC files.
This module does not contain any C or Fortran code and hence does not need to be compiled.
<A HREF="http://www.cs.uwa.edu.au/~chrisp">Chris Pudney</A> Biomedical Confocal Microscopy Research Centre <A HREF="http://www.pharm.uwa.edu.au">Department of Pharmacology</A> <A HREF="http://www.uwa.edu.au">The University of Western Australia</A> Nedlands, W.A. 6907 AUSTRALIA E-mail:<A HREF="mailto:cpudney@alphapharm.pharm.uwa.edu.au">cpudney@alphapharm.pharm.uwa.edu.au</A> Phone, Fax: (+61 8) 9346 4571, (+618) 9346 3469
Rob Fletcher, Andrew Dodd
International AVS Centre Manchester Visualization Centre Manchester Computing University of Manchester Oxford Road Manchester United Kingdom M13 9PL
read_BioRad_PIC, read_BioRad_PIC (AVS5 IAC module)