22 #include "gdcmGlobal.h"
24 #include "gdcmDicts.h"
25 #include "gdcmDictEntry.h"
26 #include "gdcmDictEntry.h"
29 #include "gdcmSerieHelper.h"
45 if(m_DicomFilenames.size())
52 VolumeReaderType::DictionaryArrayRawPointer inputDict
53 = m_VolumeReader->GetMetaDataDictionaryArray();
61 itk::ExposeMetaData<std::string> ( *(*inputDict)[0],
"0020|0032", tag );
62 sscanf( tag.c_str(),
"%f\\%f\\%f", &x0, &y0, &z0 );
63 std::cout <<
"Slice 0: " << tag << std::endl;
68 itk::ExposeMetaData<std::string> ( *(*inputDict)[1],
"0020|0032", tag );
69 sscanf( tag.c_str(),
"%f\\%f\\%f", &x1, &y1, &z1 );
70 std::cout <<
"Slice 1: " << tag << std::endl;
71 x1 -= x0; y1 -= y0; z1 -= z0;
72 x0 = x1*this->m_Output->xSlice + y1*this->m_Output->ySlice + z1*this->m_Output->zSlice;
75 m_SliceOrderIS =
false;
83 nSliceInVolume = m_sliceLocations.size();
84 nVolume = m_nSlice/nSliceInVolume;
87 std::cout <<
"Number of Slices: " << m_nSlice << std::endl;
88 std::cout <<
"Number of Volume: " << nVolume << std::endl;
89 std::cout <<
"Number of Slices in each volume: " << nSliceInVolume << std::endl;
91 for (
int k = 0; k < m_nSlice; k += nSliceInVolume)
94 bool exist = itk::ExposeMetaData<std::string> ( *(*inputDict)[k],
"0043|1039", tag);
95 float b = atof( tag.c_str() );
96 this->m_Output->bValue = b;
98 vnl_vector_fixed<double, 3> vect3d;
102 this->m_Output->DiffusionVector = vect3d;
108 itk::ExposeMetaData<std::string> ( *(*inputDict)[k],
"0019|10bb", tag);
109 vect3d[0] = atof( tag.c_str() );
112 itk::ExposeMetaData<std::string> ( *(*inputDict)[k],
"0019|10bc", tag);
113 vect3d[1] = atof( tag.c_str() );
116 itk::ExposeMetaData<std::string> ( *(*inputDict)[k],
"0019|10bd", tag);
117 vect3d[2] = atof( tag.c_str() );
120 this->m_Output->DiffusionVector = vect3d;
123 TransformGradients();
Convenience class to temporarily change the current locale.