Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

vlVolume Class Reference

vlVolume class is the central class for a 3D volume. More...

#include <vlvolume.h>

List of all members.

Public Member Functions

 vlVolume (const vlDim &dim=vlDim(1, 1, 1), const vlDataType dataType=UnsignedInt8, const vlUnit &units=vlUnit(1.0, 1.0, 1.0))
 default constructor

 vlVolume (const vlDim &dim, const std::string &layout, const vlDataType dataType=UnsignedInt8, const vlUnit &units=vlUnit(1.0, 1.0, 1.0))
 Constructor where the layout can be specified.

virtual ~vlVolume ()
 default destructor

bool readInfo (const std::string &filename, vlVolInfo &info, bool useFileExt=true)
 Read information stored in file from disk.

bool readInfo (const std::string &filename, vlVolInfo &info, const std::string &fileFormat, bool useFileExt=true)
 Read information stored in file from disk.

bool readSubvolumes (const std::string &imgfilepath, const std::string &imgfilelist, const vlVolInfo &imgInfo, const vlVolInfo &info, const unsigned int nsubVols=0, const unsigned int start=0)
 Read Subvolumes specified by imglist from imgfilepath into a volume file using the given volume info.

bool readSubvolumes (const std::string &imgfilepath, std::vector< std::string >, const vlVolInfo &info, const unsigned int nsubVols=0, const unsigned int start=0)
 Read Subvolumes specified by imglist from imgfilepath into a volume file using the given volume info.

bool readSubvolumes (const std::string &imgfilepath, std::vector< std::string >, const vlVolInfo &imgInfo, const vlVolInfo &info, const unsigned int nsubVols=0, const unsigned int start=0)
 Read Subvolumes specified by imglist from imgfilepath into a volume file using the given volume info.

std::queue< std::string > readImages (const std::string &imgfilepath, const std::string &imgfilelist, const vlVolInfo &imgInfo, const vlVolInfo &info, const unsigned int start=0)
std::queue< std::string > readImages (const std::string &imgfilepath, const std::string &imgfilelist, const vlVolInfo &info, const unsigned int start=0)
 Read images specified by imgfilelist from imgfilepath into a volume file using the given info.

std::queue< std::string > readImages (const std::string &imgfilepath, std::queue< std::string > validImgList, const vlVolInfo &imgInfo, const vlVolInfo &info, const unsigned int start=0)
bool read (const std::string &filename, bool useFileExt=true)
 Read a volume file from disk.

bool read (const std::string &filename, const std::string &fileFormat)
 Read a volume file from disk using the given format.

bool read (const std::string &filename, const vlVolInfo &info, bool useFileExt=true)
 Read a volume file from disk using the given info.

bool read (const std::string &filename, const vlVolInfo &info, const std::string &fileFormat, bool useFileExt=true)
 Read a volume file from disk using the given info and file format.

bool writeSlice (const std::string &filename, const int slice=1) const
 Write volume to a file.

bool writeSlice (const std::string &filename, const std::string &format, const bool appendExtension=false, const int slice=1) const
 Write volume to a file using the given format.

bool write (const std::string &filename) const
 Write volume to a file.

bool write (const std::string &filename, const std::string &format, const bool appendExtension=false) const
 Write volume to a file using the given format.

bool isValid () const
 Checks if this is a valid volume. Returns true of it is valid, else false.

bool resize (vlDim const &newDim, const bool keep=false, const vlPoint3ui cropStart=vlPoint3ui(0, 0, 0))
 Resize the volume.

bool clear (const uint8 data=0x00)
 Clears the volume data with the given data.

vlDim dim () const
 Returns the dimensions of the 3D data.

vlStep stepping () const
 Returns the stepping in voxel distance along x, y and z axis.

vlUnit units () const
 Returns the actual distance between the voxels along x, y and z.

uint16 bitsPerVoxel () const
 Returns the number of bits that form a voxel.

uint16 bytesPerVoxel () const
 Returns the number of bytes that form a voxel.

uint64 voxelCount () const
 Returns the total number of voxels in the volume = XDim x YDim x ZDim.

vlDataType dataType () const
 Returns the type of the data stored.

const char * typeInfo () const
 Returns the type info of the stored data.

vlLayoutType dataLayout () const
 Returns the layout in which data is stored.

std::string dataLayoutName () const
 Returns the name of the layout.

vlVolDataLayoutPlugindataLayoutPlugin () const
 Returns pointer to the plugin which provides the current layout.

bool isDirty () const
 Returns the state of the dirty flag.

void setDirty (bool dirty)
 Set/Reset the dirty flag.

const vlVarListextraInfo () const
 Returns a const pointer to the extra information about the volume.

vlVarListextraInfoRW ()
 Same as the above extraInfo() function except that pointer is non-const.

void * getVoxelVoidPtr (const vlPoint3ui &position) const
 Returns the pointer to the voxel at the given position.

template<class DataType> bool getVoxel (const vlPoint3ui &position, DataType &voxel) const
 Get the voxel value at the given position.

template<class DataType> bool getVoxel (const vlPoint3f &position, DataType &voxel) const
 Get the voxel value at the given position in float.

template<class DataType> bool setVoxel (const vlPoint3ui &position, const DataType voxel)
 Set the voxel value at the given position to 'voxel'.


Protected Member Functions

template<class DataType> bool copyDataT (DataType &dummy, vlVolData *fromData, vlVolData *toData, vlPoint3ui fromPos=vlPoint3ui(0, 0, 0), vlPoint3ui toPos=vlPoint3ui(0, 0, 0))
 Copys data of same DataType from fromData at fromPos to toData at toPos.

template<class DataType> bool cropSliceT (DataType &dummy, const vlPoint3ui slicePos, const vlPoint3ui volPos)
 Copys data of same DataType from slicePos in m_pSliceData to volPos in m_pVolData.

bool cropRGBtoRGBA (const vlPoint3ui slicePos, const vlPoint3ui volPos, uint8 threshold=0)
 Copys RGB data from slicePos in m_pSliceData to RGBA data at volPos in m_pVolData.

bool cropREDtoRGBA (const vlPoint3ui slicePos, const vlPoint3ui volPos, uint8 threshold=0)
 Copys RGB data from slicePos in m_pSliceData to RGBA data at volPos in m_pVolData.

bool cropRGBtoRed (const vlPoint3ui slicePos, const vlPoint3ui volPos, uint8 threshold=0)
 Copys Red channel of RGB data from slicePos in m_pSliceData to raw data at volPos in m_pVolData.

vlVolDatavolDataRW ()
 Returns a RW pointer to the storage of volume data.

vlVolDatavolData () const
 Returns a const pointer to the storage of volume data.

vlVolInfogetVolInfo () const
 Returns the volume information as a vlVolInfo structure.

bool resizeData (const vlDim &newDim, const vlDataType dataType, const vlUnit &units, const std::string &layout)
 Resize the data stored in the volume.

vlVolDatacreateData (const vlDim &newDim, const vlDataType dataType, const vlUnit &units, const std::string &layout)
 This will create a new vlVolData storage buffer for you.


Private Attributes

vlVarListAdmin m_extraInfo
 Stores extra information about the volume like author etc.

vlVolDatam_pVolData
 stores the volume data

vlVolDatam_pSliceData
vlPoint3ui m_origFilePos
vlDim m_origFileDim
vlVolDataLayoutPluginm_layoutPlugin
 Stores the plugin which was used for the current data layout.


Friends

class vlSlice
class vlVolIterBase
class vlVolIterBaseConst


Detailed Description

This class should be used by users to work with 3D volume datasets. The class provides easy to use API for reading/writing volume from/to disk, accessing volumetric data through the use of iterators, accessing volume information etc. This is the volume class of OpenVL visible to the users. This class brings together all the different components : data layouts, iterators, file I/O filters etc.

Author:
Sarang Lakare (lsarang@cs.sunysb.edu)

Definition at line 52 of file vlvolume.h.


Constructor & Destructor Documentation

vlVolume::vlVolume const vlDim dim = vlDim(1,1,1),
const vlDataType  dataType = UnsignedInt8,
const vlUnit units = vlUnit(1.0, 1.0, 1.0)
 

Parameters:
dim dimensions of the volume to create (default = [1,1,1]).
dataType data type of the volume data required.
layout specify the layout in which the volume data is to be stored (defailt = Linear).

Definition at line 51 of file vlvolume.cpp.

References vlVarListAdmin::add(), m_extraInfo, m_layoutPlugin, m_pVolData, name, and resizeData().

vlVolume::vlVolume const vlDim dim,
const std::string &  layout,
const vlDataType  dataType = UnsignedInt8,
const vlUnit units = vlUnit(1.0, 1.0, 1.0)
 

Parameters:
dim dimensions of the volume to create (default = [1,1,1]).
dataType data type of the volume data required.
layout specify the layout in which the volume data is to be stored (defailt = Linear).

Definition at line 74 of file vlvolume.cpp.

References vlVarListAdmin::add(), m_extraInfo, m_layoutPlugin, m_pVolData, name, and resizeData().

vlVolume::~vlVolume  )  [virtual]
 

Definition at line 94 of file vlvolume.cpp.

References m_layoutPlugin, and m_pVolData.


Member Function Documentation

uint16 vlVolume::bitsPerVoxel  )  const
 

Definition at line 1635 of file vlvolume.cpp.

References vlVolData::bitsPerVoxel(), m_pVolData, and uint16.

Referenced by getVolInfo().

uint16 vlVolume::bytesPerVoxel  )  const
 

Definition at line 1644 of file vlvolume.cpp.

References vlVolData::bytesPerVoxel(), m_pVolData, and uint16.

Referenced by getVolInfo(), and vlSlice::getVoxelInfo().

bool vlVolume::clear const uint8  data = 0x00  ) 
 

Definition at line 1599 of file vlvolume.cpp.

References vlVolData::clear(), and m_pVolData.

template<class DataType>
bool vlVolume::copyDataT DataType &  dummy,
vlVolData fromData,
vlVolData toData,
vlPoint3ui  fromPos = vlPoint3ui(0, 0, 0),
vlPoint3ui  toPos = vlPoint3ui(0, 0, 0)
[protected]
 

Definition at line 524 of file vlvolume.cpp.

References vlVolData::dim(), vlVolIterConst< DataType, Layout >::get(), min, vlVolIterConst< DataType, Layout >::moveTo(), vlVolIterConst< DataType, Layout >::nextXYZ(), vlVolIter< DataType, Layout >::set(), vlTriple< uint16 >::x(), vlTriple< uint16 >::y(), and vlTriple< uint16 >::z().

Referenced by readSubvolumes(), and resize().

vlVolData * vlVolume::createData const vlDim newDim,
const vlDataType  dataType,
const vlUnit units,
const std::string &  layout
[protected]
 

Parameters:
newDim 
dataType 
layout 

Todo:
decide whether or not to delete the plugin

Definition at line 1550 of file vlvolume.cpp.

References vlVolDataLayoutPlugin::getLayout(), vlTrader::getPlugin(), vlPlugin::info(), m_layoutPlugin, vlPluginInfo::service(), and vlKernel::trader().

Referenced by readImages(), readSubvolumes(), and resize().

bool vlVolume::cropREDtoRGBA const vlPoint3ui  slicePos,
const vlPoint3ui  volPos,
uint8  threshold = 0
[protected]
 

Definition at line 582 of file vlvolume.cpp.

References dim(), vlVolIterConst< DataType, Layout >::get(), m_pSliceData, m_pVolData, vlVolIterConst< DataType, Layout >::moveTo(), vlVolIterConst< DataType, Layout >::nextXYZ(), vlVolIter< DataType, Layout >::set(), threshold, uint8, vlColorRGBAub, vlTriple< uint16 >::x(), and vlTriple< uint16 >::y().

Referenced by readImages().

bool vlVolume::cropRGBtoRed const vlPoint3ui  slicePos,
const vlPoint3ui  volPos,
uint8  threshold = 0
[protected]
 

Definition at line 637 of file vlvolume.cpp.

References dim(), vlVolIterConst< DataType, Layout >::get(), m_pSliceData, m_pVolData, vlVolIterConst< DataType, Layout >::moveTo(), vlVolIterConst< DataType, Layout >::nextXYZ(), vlVolIter< DataType, Layout >::set(), threshold, uint8, vlTriple< uint16 >::x(), and vlTriple< uint16 >::y().

Referenced by readImages().

bool vlVolume::cropRGBtoRGBA const vlPoint3ui  slicePos,
const vlPoint3ui  volPos,
uint8  threshold = 0
[protected]
 

Definition at line 609 of file vlvolume.cpp.

References dim(), vlVolIterConst< DataType, Layout >::get(), m_pSliceData, m_pVolData, vlVolIterConst< DataType, Layout >::moveTo(), vlVolIterConst< DataType, Layout >::nextXYZ(), vlVolIter< DataType, Layout >::set(), threshold, uint8, vlTriple< uint16 >::x(), and vlTriple< uint16 >::y().

Referenced by readImages().

template<class DataType>
bool vlVolume::cropSliceT DataType &  dummy,
const vlPoint3ui  slicePos,
const vlPoint3ui  volPos
[protected]
 

Definition at line 559 of file vlvolume.cpp.

References dim(), vlVolIterConst< DataType, Layout >::get(), m_pSliceData, m_pVolData, vlVolIterConst< DataType, Layout >::moveTo(), vlVolIterConst< DataType, Layout >::nextXYZ(), vlVolIter< DataType, Layout >::set(), vlTriple< uint16 >::x(), and vlTriple< uint16 >::y().

Referenced by readImages().

vlLayoutType vlVolume::dataLayout  )  const
 

Definition at line 1680 of file vlvolume.cpp.

References vlVolData::layout(), vlLayout::Linear, m_pVolData, and vlLayoutType.

std::string vlVolume::dataLayoutName  )  const
 

Definition at line 1689 of file vlvolume.cpp.

References vlPlugin::info(), m_layoutPlugin, and vlPluginInfo::service().

Referenced by read(), readImages(), readSubvolumes(), and resize().

vlVolDataLayoutPlugin * vlVolume::dataLayoutPlugin  )  const
 

This will return a null pointer if the currently used layout was compiled-in and hence was not loaded from a dynamic plugin.

Definition at line 1765 of file vlvolume.cpp.

References m_layoutPlugin.

vlDataType vlVolume::dataType  )  const
 

Definition at line 1662 of file vlvolume.cpp.

References vlVolData::dataType(), m_pVolData, UnknownDataType, and vlDataType.

Referenced by vlSlice::extractSlice(), vlVolDataLinear::getConstIter(), vlVolDataRLEncode::getConstIter(), vlVolDataDiskRawPlugin::getConstIter(), vlVolDataLinear::getIter(), vlVolDataRLEncode::getIter(), vlVolDataDiskRawPlugin::getIter(), getVolInfo(), vlSlice::getVoxelInfo(), vlHistogram::recompute(), vlVolProcessorRegionGrow::run(), GaussianApprox::run(), vlSlice::setDefaultParams(), and vlVolProcessorThresh::thresholding().

vlDim vlVolume::dim  )  const
 

Definition at line 1608 of file vlvolume.cpp.

References vlVolData::dim(), and m_pVolData.

Referenced by vlVolProcessorConcatenate::copyDataT(), CreateVolume(), cropREDtoRGBA(), cropRGBtoRed(), cropRGBtoRGBA(), cropSliceT(), vlVolProcessorDilate::dilateReal(), vlVolProcessorErode::erodeReal(), vlSlice::extractXSlice(), vlSlice::extractYSlice(), vlSlice::extractZSlice(), getVolInfo(), readImages(), readSubvolumes(), vlRegionGrowOffsetFinder::regionGrowOffsets(), vlVolProcessorRegionGrow::run(), vlVolProcessorErode::run(), vlVolProcessorDilate::run(), VolumeCrop::run(), vlVolProcessorConcatenate::run(), vlVolProcessorAlphaAdd::run(), vlSlice::setDefaultParams(), vlVolProcessorThresh::thresholding(), and vlSlice::updateNormal().

const vlVarList * vlVolume::extraInfo  )  const
 

Definition at line 1727 of file vlvolume.cpp.

References m_extraInfo.

vlVarList * vlVolume::extraInfoRW  ) 
 

Definition at line 1733 of file vlvolume.cpp.

References m_extraInfo.

vlVolInfo * vlVolume::getVolInfo  )  const [protected]
 

Definition at line 1748 of file vlvolume.cpp.

References bitsPerVoxel(), bytesPerVoxel(), dataType(), dim(), m_extraInfo, m_origFileDim, m_origFilePos, vlVolInfo::setBitsPerVoxel(), vlVolInfo::setBytesPerVoxel(), vlVolInfo::setDataType(), vlVolInfo::setDim(), vlVolInfo::setExtraInfo(), vlVolInfo::setOrigFileDim(), vlVolInfo::setOrigFilePos(), vlVolInfo::setStepping(), vlVolInfo::setUnits(), stepping(), and units().

Referenced by write().

template<class DataType>
bool vlVolume::getVoxel const vlPoint3f position,
DataType &  voxel
const [inline]
 

Definition at line 220 of file vlvolume.h.

References m_pVolData, and vlVolData::typeInfo().

template<class DataType>
bool vlVolume::getVoxel const vlPoint3ui position,
DataType &  voxel
const [inline]
 

Definition at line 203 of file vlvolume.h.

References m_pVolData, and vlVolData::typeInfo().

void * vlVolume::getVoxelVoidPtr const vlPoint3ui position  )  const
 

This returns a void pointer, so make sure you cast it to the correct type. To avoid type-conflicts, "use iterators".

Parameters:
position location of the voxel in 3D.
Returns:
void * pointer to the memory location of the voxel.

Definition at line 1739 of file vlvolume.cpp.

References vlVolData::getVoxelVoidPtr(), and m_pVolData.

bool vlVolume::isDirty  )  const
 

Definition at line 1710 of file vlvolume.cpp.

References vlVolData::isDirty(), and m_pVolData.

Referenced by vlHistogram::update().

bool vlVolume::isValid  )  const
 

Definition at line 1698 of file vlvolume.cpp.

References vlVolData::isValid(), and m_pVolData.

Referenced by vlVolProcessorSobel::run(), vlVolProcessorRegionGrow::run(), vlVolProcessorErode::run(), vlVolProcessorDilate::run(), vlVolProcessorConcatenate::run(), vlVolProcessorCentralDiff::run(), vlVolProcessor::setVolume(), and write().

bool vlVolume::read const std::string &  filename,
const vlVolInfo info,
const std::string &  fileFormat,
bool  useFileExt = true
 

If the given format does not succeed, no further atempt is made to read the file

Parameters:
filename Name of the file to open
info The information to be used to open the file
fileFormat The file will be read using the given format only
useFileExt This is valid only when fileFormat is not specified. When true, file extension will be used to determine the file format (default) When false, each file IO plugin will try to read the header information from the file and then try to read the data from the file.
Returns:
true on success, else false

Definition at line 356 of file vlvolume.cpp.

References dataLayoutName(), vlVolInfo::dataType(), vlVolInfo::dim(), vlVolInfo::extraInfo(), fileExt, filename, vlVarList::get(), vlVolFioFilter::getFileExtensions(), vlTrader::getPluginsForGroup(), vlPlugin::info(), vlKernel::instance(), vlVarList::isDefined(), vlVolInfo::isValid(), m_extraInfo, m_pVolData, name, vlVolFioFilter::readData(), vlVolFioFilter::readInfo(), resizeData(), vlPluginInfo::service(), vlVarList::set(), vlKernel::trader(), and vlVolInfo::units().

bool vlVolume::read const std::string &  filename,
const vlVolInfo info,
bool  useFileExt = true
 

File format will be auto detected. (based on 1. file extension and 2. ability to read file header.)

Parameters:
filename Name of the file to open
info The information to be used to open the file
useFileExt When true, file extension will be used to determine the file format (default) When false, each file IO plugin will try to read the header information from the file and then try to read the data from the file.
Returns:
true on success, else fals

Definition at line 332 of file vlvolume.cpp.

References filename, and read().

bool vlVolume::read const std::string &  filename,
const std::string &  fileFormat
 

If the given format does not succeed, no further atempt is made to read the file

Parameters:
filename Name of the file to open
fileFormat The file will be read using this file format only
Returns:
true on success, else fals

Definition at line 304 of file vlvolume.cpp.

References filename, and read().

bool vlVolume::read const std::string &  filename,
bool  useFileExt = true
 

If useFileExt is true (default), the extension is matched to check if the plugin can open the file. If extension matches, the IO filter tries to read the file header. If it succeeds, it goes on to read the dataset. v

Parameters:
filename Name of the file to read.
useFileExt When true, file extension will be used to determine the file format (default) When false, each file IO plugin will try to read the header information from the file and then try to read the data from the file.
Returns:
true if read operation is successful, else false

Definition at line 285 of file vlvolume.cpp.

References filename.

Referenced by main(), and read().

std::queue< std::string > vlVolume::readImages const std::string &  imgfilepath,
std::queue< std::string >  validImgList,
const vlVolInfo imgInfo,
const vlVolInfo info,
const unsigned int  start = 0
 

Definition at line 1042 of file vlvolume.cpp.

References vlVolInfo::bytesPerVoxel(), callFunctionOnDataType, createData(), cropREDtoRGBA(), cropRGBtoRed(), cropRGBtoRGBA(), cropSliceT(), dataLayoutName(), vlVolInfo::dataType(), dim(), vlVolInfo::dim(), fileExt, filename, vlVolFioFilter::getFileExtensions(), vlTrader::getPluginsForGroup(), imgfilepath, vlPlugin::info(), vlKernel::instance(), vlVolInfo::isValid(), m_origFilePos, m_pSliceData, vlVolInfo::origFilePos(), vlVolFioFilter::readData(), vlVolFioFilter::readInfo(), resize(), resizeData(), vlPluginInfo::service(), threshold, vlKernel::trader(), uint8, vlVolInfo::units(), vlTriple< uint16 >::x(), vlTriple< uint16 >::y(), and vlTriple< uint16 >::z().

std::queue< std::string > vlVolume::readImages const std::string &  imgfilepath,
const std::string &  imgfilelist,
const vlVolInfo info,
const unsigned int  start = 0
 

The extension of the first image file is matched to check if the plugin can open the file. If extension matches, the IO filter tries to read the file header. If it succeeds, it goes on to read the dataset.

Parameters:
imgfilepath Directory of the image files to read.
imgfilelist Names of the image files to read. These files should be in the path indicated by imgfilepath.
imgInfo The information to be used to open the image files
info The information to be used to creat the volume file
Returns:
true if read operation is successful, else false

Definition at line 985 of file vlvolume.cpp.

References imgfilelist, imgfilepath, and readImages().

std::queue< std::string > vlVolume::readImages const std::string &  imgfilepath,
const std::string &  imgfilelist,
const vlVolInfo imgInfo,
const vlVolInfo info,
const unsigned int  start = 0
 

Definition at line 992 of file vlvolume.cpp.

References vlVolInfo::dim(), imgfilelist, imgfilepath, and vlTriple< uint16 >::z().

Referenced by CreateVolume(), and readImages().

bool vlVolume::readInfo const std::string &  filename,
vlVolInfo info,
const std::string &  fileFormat,
bool  useFileExt = true
 

If the given format does not succeed, no further atempt is made to read the file

Parameters:
filename Name of the file to open
info The information read will be stored in this
fileFormat The file will be read using the given format only
useFileExt This is valid only when fileFormat is not specified. When true, file extension will be used to determine the file format (default) When false, each file IO plugin will try to read the header information from the file and then try to read the data from the file.
Returns:
true on success, else false

Definition at line 137 of file vlvolume.cpp.

References vlVarList::add(), vlVolInfo::dim(), vlVolInfo::extraInfoRW(), fileExt, filename, vlVolFioFilter::getFileExtensions(), vlTrader::getPluginsForGroup(), vlPlugin::info(), vlKernel::instance(), name, vlPluginInfo::name(), vlVolFioFilter::readInfo(), vlPluginInfo::service(), and vlKernel::trader().

bool vlVolume::readInfo const std::string &  filename,
vlVolInfo info,
bool  useFileExt = true
 

The file format is autodetected. If useFileExt is set to true, the file format will be detected based on the file extension. Else, each plugin will be try to read the file. The first successful plugin will be used.

Parameters:
filename Name of the file to open
info The information read will be stored in this
useFileExt When true, file extension will be used to determine the file format (default) When false, each file IO plugin will try to read the header information from the file and then try to read the data from the file.
Returns:
true on success, else false

Definition at line 116 of file vlvolume.cpp.

References filename.

Referenced by main().

bool vlVolume::readSubvolumes const std::string &  imgfilepath,
std::vector< std::string >  ,
const vlVolInfo imgInfo,
const vlVolInfo info,
const unsigned int  nsubVols = 0,
const unsigned int  start = 0
 

Definition at line 743 of file vlvolume.cpp.

References callFunctionOnDataType, copyDataT(), createData(), dataLayoutName(), vlVolData::dataType(), vlVolInfo::dataType(), vlVolInfo::dim(), dim(), fileExt, filename, vlVolFioFilter::getFileExtensions(), vlTrader::getPluginsForGroup(), imgfilepath, vlPlugin::info(), vlKernel::instance(), vlVolInfo::isValid(), m_origFileDim, m_origFilePos, m_pSliceData, m_pVolData, vlVolInfo::origFileDim(), vlVolInfo::origFilePos(), vlVolFioFilter::readData(), vlVolFioFilter::readInfo(), resizeData(), vlPluginInfo::service(), vlVolInfo::setDataType(), vlKernel::trader(), vlVolInfo::units(), vlPoint3ui, vlTriple< uint16 >::x(), vlTriple< uint16 >::y(), and vlTriple< uint16 >::z().

bool vlVolume::readSubvolumes const std::string &  imgfilepath,
std::vector< std::string >  ,
const vlVolInfo info,
const unsigned int  nsubVols = 0,
const unsigned int  start = 0
 

Definition at line 735 of file vlvolume.cpp.

References imgfilepath, and readSubvolumes().

bool vlVolume::readSubvolumes const std::string &  imgfilepath,
const std::string &  imgfilelist,
const vlVolInfo imgInfo,
const vlVolInfo info,
const unsigned int  nsubVols = 0,
const unsigned int  subVolStart = 0
 

If extension matches, the IO filter tries to read the file header. If it succeeds, it goes on to read the dataset.

Parameters:
imgfilepath Directory of the subvolume files to read.
imgfilelist Names of the image files to read. These files should be in the path indicated by imgfilepath.
imgInfo The information to be used to open the image files. If specified the original file postion is used to force getting all subvolume data starting from a the specified location. This allows for cropping subvolumes at the time of volume creation. If imgInfo is not specified, the subvolume dimensions and original file postions are used to determine the correct dimensions and origFilePos for the volume being created. Each subvolume data is placed in the new volume at the subvolume file's origFilePos, relative to the new volume's origFilePos. If each subvolume has a origFilePos z value of zero this is used to indicate that we want to place the subvolumes consecutively.
info The information to be used to create the volume file. Note: DataType only being used. The volume is placed at the start of the volume file.
Returns:
true if read operation is successful, else false

Definition at line 686 of file vlvolume.cpp.

References imgfilelist, and imgfilepath.

Referenced by CreateVolume(), and readSubvolumes().

bool vlVolume::resize vlDim const &  newDim,
const bool  keep = false,
const vlPoint3ui  cropStart = vlPoint3ui(0,0,0)
 

Note that the entire volume data will be lost.

Todo:
Is this function really needed? What about dirty flags and bits?

Definition at line 1461 of file vlvolume.cpp.

References callFunctionOnDataType, copyDataT(), createData(), dataLayoutName(), vlVolData::dataType(), m_origFilePos, m_pSliceData, m_pVolData, resizeData(), and vlVolData::units().

Referenced by CreateVolume(), readImages(), and vlVolProcessorConcatenate::run().

bool vlVolume::resizeData const vlDim newDim,
const vlDataType  dataType,
const vlUnit units,
const std::string &  layout
[protected]
 

Parameters:
newDim 
dataType 
layout 

Todo:
decide whether or not to delete the plugin

Definition at line 1488 of file vlvolume.cpp.

References vlVolDataLayoutPlugin::getLayout(), vlTrader::getPlugin(), vlPlugin::info(), m_layoutPlugin, m_pVolData, vlPluginInfo::service(), and vlKernel::trader().

Referenced by read(), readImages(), readSubvolumes(), resize(), and vlVolume().

void vlVolume::setDirty bool  dirty  ) 
 

Definition at line 1719 of file vlvolume.cpp.

References m_pVolData, and vlVolData::setDirty().

template<class DataType>
bool vlVolume::setVoxel const vlPoint3ui position,
const DataType  voxel
[inline]
 

Definition at line 237 of file vlvolume.h.

References m_pVolData, and vlVolData::typeInfo().

vlStep vlVolume::stepping  )  const
 

Definition at line 1617 of file vlvolume.cpp.

References m_pVolData, and vlVolData::stepping().

Referenced by getVolInfo().

const char * vlVolume::typeInfo  )  const
 

Definition at line 1671 of file vlvolume.cpp.

References m_pVolData, and vlVolData::typeInfo().

Referenced by vlVolIterBaseConst< DataType >::vlVolIterBaseConst().

vlUnit vlVolume::units  )  const
 

Definition at line 1626 of file vlvolume.cpp.

References m_pVolData, and vlVolData::units().

Referenced by getVolInfo().

vlVolData* vlVolume::volData  )  const [inline, protected]
 

Definition at line 273 of file vlvolume.h.

References m_pVolData.

Referenced by vlVolIterBaseConst< DataType >::vlVolIterBaseConst().

vlVolData* vlVolume::volDataRW  )  [inline, protected]
 

Definition at line 270 of file vlvolume.h.

References m_pVolData.

uint64 vlVolume::voxelCount  )  const
 

Definition at line 1653 of file vlvolume.cpp.

References m_pVolData, uint64, and vlVolData::voxelCount().

Referenced by main().

bool vlVolume::write const std::string &  filename,
const std::string &  fileFormat,
const bool  appendExtension = false
const
 

Parameters:
filename name of the file to write to.
format The format used to write the file. (a plugin should be available)
appendExtension If true, the default extension of the format is appended if the given filename does not have that extension. If false, the filename is not modified (default).
Returns:
true on success, false otherwise.

Todo:
Delete file which was created

Definition at line 1297 of file vlvolume.cpp.

References extension(), fileExt, filename, vlVolFioFilter::getFileExtensions(), vlTrader::getPluginsForGroup(), getVolInfo(), vlPlugin::info(), isValid(), m_pVolData, vlVolInfo::origFilePos(), vlPluginInfo::service(), vlKernel::trader(), vlVolFioFilter::writeData(), and vlVolFioFilter::writeInfo().

bool vlVolume::write const std::string &  filename  )  const
 

The format used to write the file will depend on the file extension. The file extension of the given file will be matched with extensions supported by file IO plugins. If there is a match, that format will be used to write the file.

Parameters:
filename Name of the file to write the data to
Returns:
true upon success, else false

Definition at line 1279 of file vlvolume.cpp.

References filename.

Referenced by CreateVolume(), and main().

bool vlVolume::writeSlice const std::string &  filename,
const std::string &  format,
const bool  appendExtension = false,
const int  slice = 1
const
 

bool vlVolume::writeSlice const std::string &  filename,
const int  slice = 1
const
 


Friends And Related Function Documentation

friend class vlSlice [friend]
 

Definition at line 56 of file vlvolume.h.

friend class vlVolIterBase [friend]
 

Definition at line 60 of file vlvolume.h.

friend class vlVolIterBaseConst [friend]
 

Definition at line 63 of file vlvolume.h.


Member Data Documentation

vlVarListAdmin vlVolume::m_extraInfo [private]
 

Definition at line 292 of file vlvolume.h.

Referenced by extraInfo(), extraInfoRW(), getVolInfo(), read(), and vlVolume().

vlVolDataLayoutPlugin* vlVolume::m_layoutPlugin [private]
 

Definition at line 300 of file vlvolume.h.

Referenced by createData(), dataLayoutName(), dataLayoutPlugin(), resizeData(), vlVolume(), and ~vlVolume().

vlDim vlVolume::m_origFileDim [private]
 

Definition at line 298 of file vlvolume.h.

Referenced by getVolInfo(), and readSubvolumes().

vlPoint3ui vlVolume::m_origFilePos [private]
 

Definition at line 297 of file vlvolume.h.

Referenced by getVolInfo(), readImages(), readSubvolumes(), and resize().

vlVolData* vlVolume::m_pSliceData [private]
 

Definition at line 296 of file vlvolume.h.

Referenced by cropREDtoRGBA(), cropRGBtoRed(), cropRGBtoRGBA(), cropSliceT(), readImages(), readSubvolumes(), and resize().

vlVolData* vlVolume::m_pVolData [private]
 

Definition at line 295 of file vlvolume.h.

Referenced by bitsPerVoxel(), bytesPerVoxel(), clear(), cropREDtoRGBA(), cropRGBtoRed(), cropRGBtoRGBA(), cropSliceT(), dataLayout(), dataType(), dim(), getVoxel(), getVoxelVoidPtr(), isDirty(), isValid(), read(), readSubvolumes(), resize(), resizeData(), setDirty(), setVoxel(), stepping(), typeInfo(), units(), vlVolume(), volData(), volDataRW(), voxelCount(), write(), and ~vlVolume().


The documentation for this class was generated from the following files:
Generated on Fri Mar 18 11:33:24 2005 for OpenVL by doxygen 1.3.3