11 #ifndef __itkFiberTractsReader_hxx 12 #define __itkFiberTractsReader_hxx 50 fseek (file, 0, SEEK_END);
51 long fsize = ftell(file);
54 float val[3+dim_s], val2[dim_p];
58 fseek (file, offset, SEEK_SET);
60 fread((
char*)&numPoints,
sizeof(
int), 1, file);
63 auto tract = fiber->GetTract();
64 auto properties = fiber->GetProperties();
65 auto scalars = fiber->GetScalars();
66 for (
int i = 0; i < numPoints; ++i )
68 fread((
char*)&val,
sizeof(
float)*(3+dim_s), 1, file);
72 tract->AddVertex(vertex);
74 for (
int j = 0; j < dim_s; ++j )
75 vec.push_back(val[3+j]);
76 scalars->push_back(vec);
79 fread((
char*)&val2,
sizeof(
float)*dim_p, 1, file);
80 for (
int j = 0; j < dim_p; ++j )
81 properties->push_back(val[j]);
83 fibers->InsertElement( fibers->Size(), fiber);
85 offset += 4+ numPoints*(3+dim_s)*4 + dim_p*4;
FiberTractsType::FiberPointer FiberPointer
bool IsFileExist(const std::string &file)
FiberTractsPointer m_FiberTracts
int GetFiberTractsFormat(const std::string &filename)
#define utlGlobalException(cond, expout)
FiberType::VertexType VertexType
int GetDimensionOfScalars(const TrackVisHeaderType &header)
void ReadTrackVisHeader(const std::string &filename, TrackVisHeaderType &header)
FiberType::STDVectorType STDVectorType
int GetDimensionOfProperties(const TrackVisHeaderType &header)