file format .pvl.nc - nci/drishti GitHub Wiki
This document describes the .pvl.nc formatted files generated by drishti's importer
When a volume data is imported using the importer utility, it is converted into unsigned char if necessary. The drishti volume renderer uses this unsigned char data for visualization. The importer provides tools to increase the contrast of the data. The information generated from importer is written to .pvl.nc file which has xml format. This file saves the following information :
rawfile | name of the raw file for which the .pvl.nc file is generated. |
description | information regarding the data. |
voxeltype | unsigned char, char, unsigned short, short, int, float |
voxelunit | no unit, angstrom, nanometer, micron, millimeter, centimeter, meter, kilometer, parsec, kiloparsec |
voxelsize | three floats |
gridsize | three integers |
slabsize | number of slices per volume data file .pvl.nc.001, .pvl.nc.002 and so on. Currently the number of slices per file is such that each file is no bigger then 1Gb. This allows handling of large data sets even on 32-bit systems. |
rawmap | list of raw values |
pvlmap | list of unsigned char values |
Following is an example of a typical .pvl.nc file.
<!DOCTYPE Drishti_Header>
<PvlDotNcFileHeader>
<rawfile>test.raw</rawfile>
<voxeltype>unsigned char</voxeltype>
<gridsize>161 108 115</gridsize>
<voxelunit>micron</voxelunit>
<voxelsize>1 1 1</voxelsize>
<description>Information about volume</description>
<slabsize>115</slabsize>
<rawmap>703 5000 12242 </rawmap>
<pvlmap>0 128 255 </pvlmap>
</PvlDotNcFileHeader>
The actual volume data is stored in multiple files .pvl.nc.001, .pvl.nc.002 and so on. Each .pvl.nc.* file has a 13 byte header - first byte is 0 followed by three integers specifying number of slices in that file, width and height of slices. The volume data which follows has 1-byte per voxel - i.e. the raw-to-uchar mapped data.
The user is also asked whether to save .raw files while importing the data. If the .raw files are stored then these files also have a similar 13 byte header. The raw data which follows is the same from the original files.
Users do not have to go through the importer to create .pvl.nc files. It is not necessary to have the .pvl.nc.001, .pvl.nc.002, ... files. The files can have any names. These names though have to be provided via the .pvl.nc file. In that case the following tag mays be present in the .pvl.nc file :
rawnames | names of raw files |
rawheadersize | size of header (in bytes) in the raw file/s. Default is 13 bytes |
pvlnames | names of .pvl.nc files |
pvlheadersize | size of header (in bytes) in the pvl file/s. Default is 13 bytes |
Following is an example of a .pvl.nc file which uses the same set of files as rawnames as well as pvlnames. Note that the headersize is 0 for both raw as well as pvl.:
<!DOCTYPE Drishti_Header>
<PvlDotNcFileHeader>
<rawfile></rawfile>
<rawnames>vg1_8mm_0001.raw
vg1_8mm_0002.raw
vg1_8mm_0003.raw
vg1_8mm_0004.raw
vg1_8mm_0005.raw </rawnames>
<pvlnames>vg1_8mm_0001.raw
vg1_8mm_0002.raw
vg1_8mm_0003.raw
vg1_8mm_0004.raw
vg1_8mm_0005.raw </pvlnames>
<pvlheadersize>0</pvlheadersize>
<rawheadersize>0</rawheadersize>
<voxeltype>unsigned char</voxeltype>
<gridsize>1420 2043 1760</gridsize>
<voxelunit>no units</voxelunit>
<voxelsize>1 1 1</voxelsize>
<description>Information about volume</description>
<slabsize>298</slabsize>
<rawmap>0 255 </rawmap>
<pvlmap>0 255 </pvlmap>
</PvlDotNcFileHeader>