00001 // $Id: vlvolinfo.h,v 1.20 2004/08/19 11:14:33 slfrank Exp $ 00002 // 00003 // OpenVL - A Library for working with volumetric datasets. 00004 // http://openvl.sf.net 00005 // 00006 // Copyright (C) 2000-2002 Sarang Lakare <sarang#users.sf.net> 00007 // 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU Library General Public 00010 // License as published by the Free Software Foundation; either 00011 // version 2 of the License, or (at your option) any later version. 00012 // 00013 // This library is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 // Library General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU Library General Public 00019 // License along with this library; if not, write to the Free Software 00020 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00021 // USA. 00022 // 00023 // Please report all bugs and problems to openvl-devel@lists.sf.net or 00024 // at the OpenVL website. 00025 // 00026 00027 #ifndef _vlVolInfo_h 00028 #define _vlVolInfo_h 00029 00030 // C/C++ includes 00031 #include <string> 00032 #include <vector> 00034 #include <iostream> 00035 00036 // OpenVL includes 00037 #include "vlenums.h" 00038 #include "vldim.h" 00039 #include "vlpoint.h" 00040 #include "vlunit.h" 00041 #include "vlstep.h" 00042 #include "vlvarlistadmin.h" 00043 00052 class vlVolInfo { 00053 // Member functions 00054 public: 00056 vlVolInfo(); 00057 00059 virtual ~vlVolInfo(); 00060 00062 bool isValid() const; 00063 00064 vlDim dim() const { return m_dim; }; 00065 00066 vlDim origFileDim() const { return m_origFileDim; }; 00067 00068 vlStep stepping() const { return m_step; }; 00069 00070 vlUnit units() const { return m_units; }; 00071 00072 vlPoint3ui origFilePos() const { return m_position; }; 00073 00074 00080 uint16 bitsPerVoxel() const { return m_bitsPerVoxel; }; 00081 00086 uint16 bytesPerVoxel() const { return m_bytesPerVoxel; }; 00087 00088 uint16 memSize() const { return m_bytesPerVoxel*m_dim.x()*m_dim.y()*m_dim.z(); }; 00089 00090 vlDataType dataType() const { return m_dataType; }; 00091 00092 vlLayoutType dataLayout() const { return m_layout; }; 00093 00094 vlLayoutType nonInterleaved() const { return m_noninterleavedRGB; }; 00095 00096 uint32 headerSize() const { return m_headerSize; }; 00097 00099 const vlVarList * extraInfo() const { return (&m_extraInfo); }; 00100 00102 vlVarList * extraInfoRW() { return (&m_extraInfo); }; 00103 00104 void setOrigFilePos(const vlPoint3ui & position) { m_position = position; }; 00105 00106 void setDim(const vlDim & dim) { m_dim = dim; }; 00107 00108 void setOrigFileDim(const vlDim & dim) { m_origFileDim = dim; }; 00109 00110 void setStepping(const vlStep & step) { m_step = step; }; 00111 00112 void setUnits(const vlUnit & units) { m_units = units; }; 00113 00114 void setBitsPerVoxel(const uint16 bitsPerVoxel) { m_bitsPerVoxel = bitsPerVoxel; }; 00115 00116 void setBytesPerVoxel(const uint16 bytesPerVoxel) { m_bytesPerVoxel = bytesPerVoxel; }; 00117 00118 void setDataType(const vlDataType type) { m_dataType = type; }; 00119 00120 void setDataLayout(const vlLayoutType type) { m_layout = type; }; 00121 00122 void setNonInterleaved(const bool ni) { m_noninterleavedRGB = ni; }; 00123 00124 void setHeaderSize(const uint32 size) { m_headerSize = size; }; 00125 00126 void setExtraInfo(const vlVarList * extraInfo) 00127 { 00128 m_extraInfo.clear(); m_extraInfo = *extraInfo; 00129 }; 00130 00132 friend std::ostream & operator << (std::ostream & os, vlVolInfo const & info) { 00133 return (os<<"Volume Info: \nDim:"<<info.m_dim<<"\nUnits:"<<info.m_units<<"\nBits/Voxel: "<<info.m_bitsPerVoxel 00134 <<"\nBytes/Voxel: " <<info.m_bytesPerVoxel<<" "); 00135 } 00136 00137 protected: 00139 vlDim m_dim; 00140 00142 vlDim m_origFileDim; 00143 00145 vlStep m_step; 00146 00148 vlUnit m_units; 00149 00150 unsigned short m_bitsPerVoxel; 00151 00152 unsigned short m_bytesPerVoxel; 00153 00155 vlDataType m_dataType; 00156 00158 vlLayoutType m_layout; 00159 00161 bool m_noninterleavedRGB; 00162 00164 unsigned long m_headerSize; 00165 00167 vlPoint3ui m_position; 00168 00170 vlVarListAdmin m_extraInfo; 00171 00172 private: 00173 00174 }; 00175 00176 00177 #endif // _vlVolInfo_h
1.3.3