IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
ipsdk::image::file::RawImageFile Class Reference

Class for raw disk image access. More...

#include <RawImageFile.h>

Inheritance diagram for ipsdk::image::file::RawImageFile:
ipsdk::image::BaseDiskImageAccessor ipsdk::image::BaseImageAccessor ipsdk::BaseSerializationObject ipsdk::BaseDynamicObject

Public Member Functions

bool hasBinary8BitsStorage () const
 method allowing to check whether image underlying storage stores binary data with a 8 bit alignment More...
 
BoolResult createFile (const boost::filesystem::path &filePath, const BaseImageGeometry &geometry, const std::string &headerData=std::string())
 create a new raw file More...
 
BoolResult openFile (const boost::filesystem::path &filePath, const eImageAccessMode &accessMode, const ipUInt64 dataStartOffset, const BaseImageGeometry &geometry)
 open an existing raw file More...
 
BoolResult openSharedRemoteFile (const boost::filesystem::path &filePath, const eImageAccessMode &accessMode, const ipUInt64 dataStartOffset, const BaseImageGeometry &geometry)
 open an existing shared on network raw file More...
 
Constructors and destructors
 RawImageFile ()
 
 ~RawImageFile ()
 
- Public Member Functions inherited from ipsdk::image::BaseDiskImageAccessor
const boost::filesystem::path & getFilePath () const
 retrieve file path associated to object More...
 
bool hasSharedRemoteAccess () const
 retrieve flag indicating whether image has remote shared access (image can be accessed from every where on network) More...
 
 BaseDiskImageAccessor ()
 
virtual ~BaseDiskImageAccessor ()=0
 
- Public Member Functions inherited from ipsdk::image::BaseImageAccessor
bool isInit () const
 retrieve object initialisation flag
 
const eImageAccessModegetAccessMode () const
 retrieve user image access mode More...
 
const BaseImageGeometrygetGeometry () const
 retrieve geometry associated to image file More...
 
const GeometricCalibrationConstPtrgetGeometricCalibrationConstPtr () const
 retrieve geometric calibration associated to image More...
 
BoolResult resize (const BaseImageGeometry &imageGeometry)
 resize image file given a geometry More...
 
void clear ()
 clear of object data
 
 BaseImageAccessor ()
 
virtual ~BaseImageAccessor ()=0
 
bool isValidPlanIdx (const ipUInt64 zPlanIdx, const ipUInt64 cPlanIdx, const ipUInt64 tPlanIdx) const
 
bool isValidPlanIdx (const PlanIndex &planIdx) const
 
BoolResult readRaw (const ipUInt64 zPlanIdx, const ipUInt64 cPlanIdx, const ipUInt64 tPlanIdx, const ipUInt64 pixelStartOffset, const ipUInt64 nbPixels, void *pData) const
 read raw data segment from file More...
 
BoolResult readRaw (const PlanIndex &planIdx, const ipUInt64 pixelStartOffset, const ipUInt64 nbPixels, void *pData) const
 read raw data segment from file More...
 
BoolResult writeRaw (const ipUInt64 zPlanIdx, const ipUInt64 cPlanIdx, const ipUInt64 tPlanIdx, const ipUInt64 pixelStartOffset, const ipUInt64 nbPixels, const void *pData)
 write raw data segment to file More...
 
BoolResult writeRaw (const PlanIndex &planIdx, const ipUInt64 pixelStartOffset, const ipUInt64 nbPixels, const void *pData)
 write raw data segment to file More...
 
- Public Member Functions inherited from ipsdk::BaseSerializationObject
 BaseSerializationObject ()
 Default constructor.
 
virtual ~BaseSerializationObject ()=0
 destructor
 
- Public Member Functions inherited from ipsdk::BaseDynamicObject
virtual const std::string & getClassName () const
 method allowing to retrieve object class name
 
virtual BaseDynamicObjectcreateNew () const =0
 method allowing to create new instance of current object type
 
virtual DynamicObjectPtr createShared () const =0
 method allowing to create new shared instance of current object type
 
virtual bool hasCopySupport () const =0
 check whether objet has copy support
 
virtual BaseDynamicObjectduplicate () const =0
 method allowing to duplicate current object More...
 
virtual DynamicObjectPtr duplicateShared () const =0
 method allowing shared duplication of current object More...
 
 BaseDynamicObject ()
 
virtual ~BaseDynamicObject ()=0
 

Protected Types

typedef boost::shared_ptr< std::fstream > FStreamPtr
 shared pointer to file stream
 
typedef boost::tuple< ipUInt64, ipUInt64, ipUInt64PlanIdentifier
 plan identifier composed of t, c and z indexes
 
typedef std::map< PlanIdentifier, ipUInt64OffsetColl
 collection of plan offsets definition
 
typedef std::map< boost::thread::id, FStreamPtrFStreamColl
 collection of file streams
 

Protected Member Functions

BoolResult openFileInternal (const boost::filesystem::path &filePath, const eImageAccessMode &accessMode, const ipUInt64 dataStartOffset, const BaseImageGeometry &geometry, const bool bSharedRemoteAccess)
 open an existing raw file More...
 
ipUInt64 processOffsets (const ipUInt64 dataStartOffset, const BaseImageGeometry &geometry)
 method allowing to compute image plans offset in raw file More...
 
BoolResult resizeData (const BaseImageGeometry &geometry)
 resize image file given a geometry More...
 
BoolResult readRawData (const ipUInt64 zPlanIdx, const ipUInt64 cPlanIdx, const ipUInt64 tPlanIdx, const ipUInt64 pixelStartOffset, const ipUInt64 nbPixels, void *pData) const
 read raw data segment from file More...
 
BoolResult writeRawData (const ipUInt64 zPlanIdx, const ipUInt64 cPlanIdx, const ipUInt64 tPlanIdx, const ipUInt64 pixelStartOffset, const ipUInt64 nbPixels, const void *pData)
 write raw data segment to file More...
 
void clearDerived ()
 close file and reset object parameters
 
BoolResult findThreadFStream (FStreamPtr &pFStream) const
 method allowing to retrieve file stream associated to current thread More...
 
- Protected Member Functions inherited from ipsdk::image::BaseDiskImageAccessor
std::string getImageInfoStr () const
 retrieve image information string in derived class More...
 
void initBase (const boost::filesystem::path &filePath, const eImageAccessMode &accessMode, const BaseImageGeometry &geometry, const GeometricCalibrationConstPtr &pGeometricCalibration, const bool bSharedRemoteAccess)
 base class initialization method More...
 
boost::filesystem::path getNewDiskImagePath (const std::string strExtension, const BaseImageGeometry &geometry)
 Generates a file path with the default format: <PATH_TO_TEMPORARY_DISK_IMAGES>/IPSDK_Image_YYYYMMDD-HHMMSS.ext Where ext is the image extension and <PATH_TO_TEMPORARY_DISK_IMAGES> is defined in the local processing policy and equals C:<USER> on windows and /tmp/ReactivIP/IPSDK on Linux.
 
- Protected Member Functions inherited from ipsdk::image::BaseImageAccessor
ImageGeometryPtr getGeometryPtr ()
 retrieve geometry pointer associated to user image More...
 
void initBase (const eImageAccessMode &accessMode, const BaseImageGeometry &geometry, const GeometricCalibrationConstPtr &pGeometricCalibration)
 base class initialization method More...
 
- Protected Member Functions inherited from ipsdk::BaseSerializationObject
virtual BoolResult write (BaseOArchive &ar) const
 method allowing to ensure serialization write part for object
 
virtual BoolResult read (BaseIArchive &ar)
 method allowing to ensure serialization read part for object
 
- Protected Member Functions inherited from ipsdk::BaseDynamicObject
virtual void initCtorCopy (const BaseDynamicObject &object)
 
virtual void copy (const BaseDynamicObject &object)
 method allowing to copy data from another object
 

Protected Attributes

OffsetColl _offsetColl
 collection of offset for each image plans
 
FStreamColl _fStreamColl
 collection of thread file streams associated to object
 
void * _handle
 file handle used under windows
 
boost::mutex _mutex
 mutex used for protection against thread concurrent accesses
 
- Protected Attributes inherited from ipsdk::image::BaseImageAccessor
eImageAccessMode _accessMode
 file access mode associated to manager
 
ImageGeometryPtr _pGeometry
 geometry associated to file
 
GeometricCalibrationConstPtr _pGeometricCalibration
 geometric calibration associated to image
 
bool _bInit
 object initialization flag
 

Additional Inherited Members

- Static Public Member Functions inherited from ipsdk::BaseSerializationObject
static ipUInt32 getVersion ()
 method allowing to retrieve class version information for serialization
 
- Static Public Member Functions inherited from ipsdk::BaseDynamicObject
static const std::string & getTypeName ()
 method allowing to retrieve name associated to class
 

Detailed Description

Class for raw disk image access.

Author
E. Noirfalise
Date
2013/6/28

Member Function Documentation

◆ hasBinary8BitsStorage()

bool ipsdk::image::file::RawImageFile::hasBinary8BitsStorage ( ) const
virtual

method allowing to check whether image underlying storage stores binary data with a 8 bit alignment

Exceptions
ipsdk::image::IPSDKImageExceptionif isInit() == false

Implements ipsdk::image::BaseImageAccessor.

◆ createFile()

BoolResult ipsdk::image::file::RawImageFile::createFile ( const boost::filesystem::path &  filePath,
const BaseImageGeometry geometry,
const std::string &  headerData = std::string() 
)

create a new raw file

Returns
false in case of failure

◆ openFile()

BoolResult ipsdk::image::file::RawImageFile::openFile ( const boost::filesystem::path &  filePath,
const eImageAccessMode accessMode,
const ipUInt64  dataStartOffset,
const BaseImageGeometry geometry 
)

open an existing raw file

Returns
false in case of failure

◆ openSharedRemoteFile()

BoolResult ipsdk::image::file::RawImageFile::openSharedRemoteFile ( const boost::filesystem::path &  filePath,
const eImageAccessMode accessMode,
const ipUInt64  dataStartOffset,
const BaseImageGeometry geometry 
)

open an existing shared on network raw file

Returns
false in case of failure

◆ openFileInternal()

BoolResult ipsdk::image::file::RawImageFile::openFileInternal ( const boost::filesystem::path &  filePath,
const eImageAccessMode accessMode,
const ipUInt64  dataStartOffset,
const BaseImageGeometry geometry,
const bool  bSharedRemoteAccess 
)
protected

open an existing raw file

Returns
false in case of failure

◆ processOffsets()

ipUInt64 ipsdk::image::file::RawImageFile::processOffsets ( const ipUInt64  dataStartOffset,
const BaseImageGeometry geometry 
)
protected

method allowing to compute image plans offset in raw file

Returns
full image used size

◆ resizeData()

BoolResult ipsdk::image::file::RawImageFile::resizeData ( const BaseImageGeometry geometry)
protectedvirtual

resize image file given a geometry

Returns
false in case of failure

Implements ipsdk::image::BaseImageAccessor.

◆ readRawData()

BoolResult ipsdk::image::file::RawImageFile::readRawData ( const ipUInt64  zPlanIdx,
const ipUInt64  cPlanIdx,
const ipUInt64  tPlanIdx,
const ipUInt64  pixelStartOffset,
const ipUInt64  nbPixels,
void *  pData 
) const
protectedvirtual

read raw data segment from file

Parameters
zPlanIdxz plan index for data access
cPlanIdxc plan index for data access
tPlanIdxt plan index for data access
pixelStartOffsetpixel start offset for data in file
nbPixelsnumber of pixels to be processed
pDatapointer to buffer filed from image file data

Implements ipsdk::image::BaseImageAccessor.

◆ writeRawData()

BoolResult ipsdk::image::file::RawImageFile::writeRawData ( const ipUInt64  zPlanIdx,
const ipUInt64  cPlanIdx,
const ipUInt64  tPlanIdx,
const ipUInt64  pixelStartOffset,
const ipUInt64  nbPixels,
const void *  pData 
)
protectedvirtual

write raw data segment to file

Parameters
zPlanIdxz plan index for data access
cPlanIdxc plan index for data access
tPlanIdxt plan index for data access
pixelStartOffsetpixel start offset for data in file
nbPixelsnumber of pixels to be processed
pDatapointer to buffer used to write image file data

Implements ipsdk::image::BaseImageAccessor.

◆ findThreadFStream()

BoolResult ipsdk::image::file::RawImageFile::findThreadFStream ( FStreamPtr pFStream) const
protected

method allowing to retrieve file stream associated to current thread

Returns
false in case of failure

The documentation for this class was generated from the following file: