Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __cmtkVolumeIO_h_included_
00034 #define __cmtkVolumeIO_h_included_
00035
00036 #include <cmtkconfig.h>
00037
00038 #include <Base/cmtkUniformVolume.h>
00039 #include <Base/cmtkAnatomicalOrientation.h>
00040
00041 #include <IO/cmtkFileFormat.h>
00042 #include <IO/cmtkTypedStream.h>
00043
00044 namespace
00045 cmtk
00046 {
00047
00050
00074 class VolumeIO
00075 {
00076 public:
00078 typedef VolumeIO Self;
00079
00081 static UniformVolume::SmartPtr Read( const char *path, const bool verbose = false );
00082
00084 static UniformVolume::SmartPtr ReadGrid( const char *path, const bool verbose = false );
00085
00087 static UniformVolume::SmartPtr ReadGridOriented( const char *path, const char* orientation, const bool verbose = false );
00088
00090 static UniformVolume::SmartPtr ReadGridOriented( const char *path, const bool verbose = false )
00091 {
00092 return Self::ReadGridOriented( path, AnatomicalOrientation::ORIENTATION_STANDARD, verbose );
00093 }
00094
00104 static UniformVolume::SmartPtr ReadOriented( const char *path, const char* orientation, const bool verbose = false );
00105
00110 static UniformVolume::SmartPtr ReadOriented( const char *path, const bool verbose = false )
00111 {
00112 return Self::ReadOriented( path, AnatomicalOrientation::ORIENTATION_STANDARD, verbose );
00113 }
00114
00121 static void Write( const UniformVolume& volume, const FileFormatID format, const char *path, const bool verbose = false );
00122
00133 static void Write( const UniformVolume& volume, const char *pathAndFormat, const bool verbose = false );
00134
00136 static void SetWriteCompressedOn()
00137 {
00138 Self::WriteCompressedOn = true;
00139 }
00140
00142 static void SetWriteCompressedOff()
00143 {
00144 Self::WriteCompressedOn = false;
00145 }
00146
00148 static bool GetWriteCompressed()
00149 {
00150 return Self::WriteCompressedOn;
00151 }
00152
00153 private:
00155 static bool WriteCompressedOn;
00156
00162 class Initializer
00163 {
00164 private:
00166 Initializer();
00167
00169 static Initializer Instance;
00170 };
00171 };
00172
00174
00175 }
00176
00177 #endif // #ifndef __cmtkVolumeIO_h_included_