/usr/include/ITK-4.5/metaArray.h is in libinsighttoolkit4-dev 4.5.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | /*============================================================================
MetaIO
Copyright 2000-2010 Insight Software Consortium
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
#include "metaTypes.h"
#ifndef ITKMetaIO_METAVECTOR_H
#define ITKMetaIO_METAVECTOR_H
#include "metaUtils.h"
#include "metaForm.h"
/*! MetaArray (.h and .cpp)
*
* Description:
* Reads and Writes MetaArray Files.
* MetaArray Files can be in one of two possible formats:
* a combined header/data format, typically designated .mva files
* or as separate header and data files, typically designated
* .mvh and .mvd files
*
* Features:
* Header information is in ascii format - for easy creation, editing,
* and review.
* Has required and optional header data (provides rapid formation
* or extensive documentation).
* Handles byte ordering (MSB/LSB)
* REQUIRED: NDims, ByteOrderMSB, ElementDataType, DataFileName
*
* \author Stephen R. Aylward
*
* \date August 29, 1999
*
* Depends on:
* MetaUtils.h
* MetaForm.h
*/
#if (METAIO_USE_NAMESPACE)
namespace METAIO_NAMESPACE {
#endif
class METAIO_EXPORT MetaArray : public MetaForm
{
/////
//
// PUBLIC
//
////
public:
////
//
// Constructors & Destructor
//
////
MetaArray(void);
MetaArray(const char *_headerName);
MetaArray(MetaArray *_vector,
bool _allocateElementData=false,
bool _autoFreeElementData=false);
MetaArray(int _length,
MET_ValueEnumType _elementType,
int _elementNumberOfChannels=1,
void *_elementData=NULL,
bool _allocateElementData=false,
bool _autoFreeElementData=false);
~MetaArray(void);
void PrintInfo(void) const;
void CopyInfo(const MetaForm * _form);
void Clear(void);
bool InitializeEssential(int _nDims,
MET_ValueEnumType _elementType,
int _elementNumberOfChannels=1,
void *_elementData=NULL,
bool _allocateElementData=false,
bool _autoFreeElementData=true);
bool AllocateElementData(bool _autoFreeElementData=true);
int Length(void) const;
void Length(int _length);
int NDims(void) const;
void NDims(int _length);
MET_ValueEnumType ElementType(void) const;
void ElementType(MET_ValueEnumType _elementType);
int ElementNumberOfChannels(void) const;
void ElementNumberOfChannels(int _elementNumberOfChannels);
//
//
//
void ElementByteOrderSwap(void);
bool ElementByteOrderFix(void);
//
// ConverTo(...)
// Converts to a new data type
bool ConvertElementDataTo(MET_ValueEnumType _toElementType,
double _fromMin=0,
double _fromMax=0,
double _toMin=0,
double _toMax=0);
bool ImportBufferToElementData(const void *_fromBuffer,
MET_ValueEnumType _fromBufferType,
double _fromMin=0,
double _fromMax=0,
double _toMin=0,
double _toMax=0);
//
//
//
bool AutoFreeElementData(void) const;
void AutoFreeElementData(bool _freeData);
const char * ElementDataFileName(void) const;
void ElementDataFileName(const char * _dataFileName);
void * ElementData(void);
double ElementData(int _i) const;
void ElementData(void * _data, bool _autoFreeElementData=false);
bool ElementData(int _i, double _v);
//
//
//
virtual bool CanRead(const char *_headerName=NULL) const;
virtual bool Read(const char *_headerName=NULL,
bool _readElements=true,
void * _elementDataBuffer=NULL,
bool _autoFreeElementData=false);
virtual bool CanReadStream(METAIO_STREAM::ifstream * _stream) const;
virtual bool ReadStream(METAIO_STREAM::ifstream * _stream,
bool _readElements=true,
void * _elementDataBuffer=NULL,
bool _autoFreeElementData=false);
virtual bool Write(const char *_headName=NULL,
const char *_dataName=NULL,
bool _writeElements=true,
const void * _constElementData=NULL);
virtual bool WriteStream(METAIO_STREAM::ofstream * _stream,
bool _writeElements=true,
const void * _constElementData=NULL);
////
//
// PROTECTED
//
////
protected:
int m_Length;
MET_ValueEnumType m_ElementType;
int m_ElementNumberOfChannels;
bool m_AutoFreeElementData;
METAIO_STL::streamoff m_CompressedElementDataSize;
char m_ElementDataFileName[255];
void * m_ElementData;
void M_Destroy(void);
void M_SetupReadFields(void);
void M_SetupWriteFields(void);
bool M_Read(void);
bool M_ReadElements(METAIO_STREAM::ifstream * _fstream,
void * _data,
int _dataQuantity);
bool M_WriteElements(METAIO_STREAM::ofstream * _fstream,
const void * _data,
METAIO_STL::streamoff _dataQuantity);
};
#if (METAIO_USE_NAMESPACE)
};
#endif
#endif
|