2 #include <vnl/vnl_math.h>
20 gdcm::Reader gdcmReader;
21 gdcmReader.SetFileName( filename.c_str() );
25 gdcm::Tag ge_bvalue_tag( 0x0043, 0x1039 );
26 gdcm::Tag ge_gradient_x( 0x0019, 0x10bb );
27 gdcm::Tag ge_gradient_y( 0x0019, 0x10bc );
28 gdcm::Tag ge_gradient_z( 0x0019, 0x10bd );
33 std::string ge_tagvalue_string;
37 success =
RevealBinaryTag( ge_bvalue_tag, gdcmReader.GetFile().GetDataSet(), ge_tagvalue_string );
42 const char* bval_string = ge_tagvalue_string.substr(0,ge_tagvalue_string.length()-6).c_str();
43 header_info.
b_value =
static_cast<unsigned int>(strtod( bval_string, &pEnd ));
47 RevealBinaryTag( ge_gradient_x, gdcmReader.GetFile().GetDataSet(), ge_tagvalue_string ) )
49 header_info.
g_vector[0] = strtod( ge_tagvalue_string.c_str(), &pEnd );
57 RevealBinaryTag( ge_gradient_y, gdcmReader.GetFile().GetDataSet(), ge_tagvalue_string ) )
59 header_info.
g_vector[1] = strtod( ge_tagvalue_string.c_str(), &pEnd );
67 RevealBinaryTag( ge_gradient_z, gdcmReader.GetFile().GetDataSet(), ge_tagvalue_string ) )
69 header_info.
g_vector[2] = strtod( ge_tagvalue_string.c_str(), &pEnd );
91 this->m_HeaderInformationList.push_back( header_info );
bool RevealBinaryTag(const gdcm::Tag tag, const gdcm::DataSet &dataset, std::string &target)
Retrieve the value of a gdcm tag to the given string.
static const std::string filename
MITKCORE_EXPORT const ScalarType eps