Class for writing and reading various library classes to and from disk. More...
#include <cmtkClassStream.h>
Public Types | |
enum | FileMode { READ = TYPEDSTREAM_READ, WRITE = TYPEDSTREAM_WRITE, WRITE_ZLIB = TYPEDSTREAM_WRITE_ZLIB, APPEND = TYPEDSTREAM_APPEND } |
Access modes for archives. More... | |
Public Member Functions | |
ClassStream () | |
Default constructor. | |
ClassStream (const char *filename, const FileMode mode) | |
Open constructor. | |
ClassStream (const char *dir, const char *archive, const FileMode mode) | |
Open constructor for separate path and archive names. | |
void | Open (const char *filename, const FileMode mode) |
Open another archive without constructing a new object. | |
void | Open (const char *dir, const char *archive, const FileMode mode) |
Open another archive in explicit directory. | |
ClassStream & | operator<< (const WarpXform *warpXform) |
Write generic transformation object. | |
ClassStream & | operator<< (const SplineWarpXform &splineWarpXform) |
Write spline transformation object. | |
ClassStream & | operator>> (WarpXform::SmartPtr &warpXform) |
Read (spline or linear) warp transformation. | |
ClassStream & | operator>> (WarpXform *&warpXform) |
Read (spline or linear) warp transformation. | |
ClassStream & | Get (WarpXform::SmartPtr &warpXform, const AffineXform *affineXform=NULL) |
Actually read warp transformation object. | |
ClassStream & | Get (WarpXform *&warpXform, const AffineXform *affineXform=NULL) |
Actually read warp transformation object. | |
ClassStream & | operator<< (const ParametricPlane *parametricPlane) |
Write parametric plane object. | |
ClassStream & | operator<< (const ParametricPlane ¶metricPlane) |
Write parametric plane object. | |
ClassStream & | operator>> (ParametricPlane *¶metricPlane) |
Read parametric plane. | |
ClassStream & | operator<< (const LandmarkList *landmarkList) |
Write landmark list. | |
ClassStream & | operator<< (const LandmarkList &landmarkList) |
Write landmark list. | |
ClassStream & | operator>> (LandmarkList::SmartPtr &landmarkList) |
Read landmark list. | |
Private Member Functions | |
ClassStream & | PutWarp (const WarpXform *warpXform) |
Write actual warp transformation object. |
Class for writing and reading various library classes to and from disk.
For all relevant objects in the Base library, input and output operators (>> and <<) are defined , much like std::iostream does for basic data types.
Definition at line 59 of file cmtkClassStream.h.
Access modes for archives.
READ |
Read-only access. |
WRITE |
Write-only access. |
WRITE_ZLIB |
Write-only access piped through zlib/gzip compression. |
APPEND |
Open existing archive and append to it. |
Definition at line 65 of file cmtkClassStream.h.
cmtk::ClassStream::ClassStream | ( | ) | [inline] |
Default constructor.
Definition at line 77 of file cmtkClassStream.h.
cmtk::ClassStream::ClassStream | ( | const char * | filename, |
const FileMode | mode | ||
) | [inline] |
Open constructor.
filename | Name of the archive to open. |
mode | Access mode, ie. read-only, write-only, etc. |
Definition at line 83 of file cmtkClassStream.h.
cmtk::ClassStream::ClassStream | ( | const char * | dir, |
const char * | archive, | ||
const FileMode | mode | ||
) | [inline] |
Open constructor for separate path and archive names.
dir | Directory to open archive in. |
archive | Name of the archive to open. |
mode | Access mode, ie. read-only, write-only, etc. |
Definition at line 91 of file cmtkClassStream.h.
void cmtk::ClassStream::Open | ( | const char * | dir, |
const char * | archive, | ||
const FileMode | mode | ||
) | [inline] |
Open another archive in explicit directory.
Definition at line 102 of file cmtkClassStream.h.
void cmtk::ClassStream::Open | ( | const char * | filename, |
const FileMode | mode | ||
) | [inline] |
Open another archive without constructing a new object.
Definition at line 96 of file cmtkClassStream.h.
Referenced by cmtk::ClassStreamStudyList::Merge(), cmtk::ImagePairAffineRegistrationCommandLine::OutputResultList(), cmtk::AffineRegistrationCommandLine::OutputResultList(), cmtk::ImagePairNonrigidRegistrationCommandLine::OutputWarp(), cmtk::ElasticRegistrationCommandLine::OutputWarp(), cmtk::XformIO::Read(), cmtk::TypedStreamStudylist::Read(), cmtk::TypedStreamStudylist::Write(), cmtk::ClassStreamStudyList::Write(), and cmtk::GroupwiseRegistrationOutput::WriteGroupwiseArchive().
ClassStream& cmtk::ClassStream::operator<< | ( | const LandmarkList & | landmarkList ) | [inline] |
Write landmark list.
This function works on a reference rather than a pointer. It immediately calls the pointer-based function defined above for the actual writing.
Definition at line 159 of file cmtkClassStream.h.
ClassStream& cmtk::ClassStream::operator<< | ( | const ParametricPlane & | parametricPlane ) | [inline] |
Write parametric plane object.
This function works on a reference rather than a pointer. It immediately calls the pointer-based function defined above for the actual writing.
Definition at line 145 of file cmtkClassStream.h.
ClassStream& cmtk::ClassStream::operator<< | ( | const SplineWarpXform & | splineWarpXform ) | [inline] |
Write spline transformation object.
This function works on a reference rather than a pointer. It immediately calls the pointer-based function defined above for the actual writing.
Definition at line 117 of file cmtkClassStream.h.
ClassStream& cmtk::ClassStream::operator>> | ( | LandmarkList::SmartPtr & | landmarkList ) |
Read landmark list.