SoVRVolFileReader(3)
π SoVRVolFileReader β the VOL file loader bestie π
okay so. this is SoVRVolFileReader(3), from the Library Functions Manual, and it's literally the loader for files in the VOL data format. she's a SoVolumeReader subclass and she eats .vol files for breakfast, no cap. π₯£β¨
πΈ NAME πΈ
SoVRVolFileReader β Loader for files in the VOL data format.
β¨ SYNOPSIS β¨
#include <VolumeViz/readers/SoVRVolFileReader.h>
Inherits SoVolumeReader. π
π Public Member Functions
void setUserData (void *data)
void getDataChar (SbBox3f &size, SoVolumeData::DataType &type, SbVec3s &dim)
virtual void getSubSlice (SbBox2s &subslice, int slicenumber, void *data)
π Public Member Functions inherited from SoVolumeReader
virtual int getNumSignificantBits (void)
virtual SbBool getSubVolume (SbBox3s &volume, void *voxels)
virtual SbBool getSubVolume (const SbBox3s &volume, const SbVec3s subsamplelevel, void *&voxels)
virtual SbBool getSubVolumeInfo (SbBox3s &volume, SbVec3s reqsubsamplelevel, SbVec3s &subsamplelevel, SoVolumeReader::CopyPolicy &policy)
SbVec3s getNumVoxels (SbVec3s realsize, SbVec3s subsamplinglevel) const
SbVec3s getSizeToAllocate (SbVec3s realsize, SbVec3s subsamplinglevel) const
int setFilename (const char *filename)
π¦ Friends
class SoVRVolFileReaderP
π Additional Inherited Members
Public Types inherited from SoVolumeReader
enum CopyPolicy { COPY, NO_COPY, NO_COPY_AND_DELETE }
Protected Member Functions inherited from SoVolumeReader
void * getBuffer (int64_t offset, unsigned int size)
int bytesToInt (unsigned char *ptr, int sizeBytes)
void swapBytes (int *intPtr, int sizeBytes)
int64_t fileSize (void)
Protected Attributes inherited from SoVolumeReader
void * m_data
π Detailed Description π
Loader for files in the VOL data format. periodt.
This class reads volume data from files in the data format used in the book Β«Introduction To Volume RenderingΒ», by Lichtenbelt, Crane and Naqvi (Hewlett-Packard / Prentice Hall), ISBN 0-13-861683-3. yes she's book-accurate, we stan an academically sourced queen πβ¨
The format is just a simple header, before the voxel values are laid out in raw, uncompressed form. like, it's giving "no thoughts, just bytes":
struct vol_header {
uint32_t magic_number;
uint32_t header_length;
uint32_t width;
uint32_t height;
uint32_t images;
uint32_t bits_per_voxel;
uint32_t index_bits;
float scaleX, scaleY, scaleZ;
float rotX, rotY, rotZ;
};
Volume data will by default be normalized to be within a 2x2x2 unit dimensions cube. so as an example, if you set up a voxel data set of dimensions 100x400x200, this will be rendered within a bounding box of <-0.25, -1, -0.5> to <0.25, 1, 0.5>. notice that the largest dimension (the Y dimension in this example) will be made to fit within unit size 2, and the other dimensions will be scaled accordingly. the biggest one is the main character, everybody else follows. π
The scale vector (if present in the header) will subsequently be used on the resulting normalized volume dimensions. slay, the header really said "let me scale that for you" π
You may use SoVolumeData::setVolumeSize() to force a different unit size box around the volume, or you can simply use the standard Coin transformation nodes, like e.g. SoScale, to accomplish this. your volume, your rules, bestie.
For more information about how the data will be mapped to the world coordinate system, see the documentation of SoVolumeData::setVolumeData(). π«Ά
πΈ Member Function Documentation πΈ
void SoVRVolFileReader::setUserData (void * data) [virtual]
data should be a pointer to a character string with the full filename of a file in VOL-format. just hand her the path and she'll handle it, fr fr.
Reimplemented from SoVolumeReader.
void SoVRVolFileReader::getDataChar (SbBox3f & size, SoVolumeData::DataType & type, SbVec3s & dim) [virtual]
Returns information about the volume data contained in a volume reader. Sub-classes, i.e. the non-abstract readers, needs to implement this function. (yes that's the original wording, she's very particular about it π)
size is set to the "world size" of the volume, in unit coordinates.
type is set to either SoVolumeData::UNSIGNED_BYTE or SoVolumeData::UNSIGNED_SHORT, to signify that the voxel values are either 8-bit or 16-bit, respectively. so like, pick a lane: 8-bit or 16-bit, no in-between.
dim gives the volume dimensions in voxel coordinates, i.e. the number of rows, columns and stacks of voxels along the internal 3 coordinate axes of the volume. three whole axes, very demure, very mindful π
Implements SoVolumeReader.
void SoVRVolFileReader::getSubSlice (SbBox2s & subslice, int slicenumber, void * data) [virtual]
Extract a subslice from the volume (which may still reside solely on disk). Sub-classes, i.e. the non-abstract readers, needs to implement this function.
Implements SoVolumeReader.
π Author π
Generated automatically by Doxygen for SIMVoleon from the source code.
and that's the whole page, bestie π«Ά this was SIMVoleon, Version 2.1.0, and the date is baked right into that SoVRVolFileReader(3) footer energy β so yeah, go read your VOL files, you got this. πβ¨ππ¦πΈπ
π¦ where this page comes from
- fedora 43: SIMVoleon-devel 2.1.0-9.fc43 Β· BSD-3-Clause
- fedora 43: SIMVoleon-devel 2.1.0-9.fc43 Β· BSD-3-Clause
- fedora 44: SIMVoleon-devel 2.1.0-11.fc44 Β· BSD-3-Clause
- fedora 44: SIMVoleon-devel 2.1.0-11.fc44 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms