Closing Issue #75: string for StationName is static but was never cleared.
This commit is contained in:
@ -100,6 +100,7 @@ CalculateInternalTransformV3(
|
||||
const char* queryStationName(const char* pcFName){
|
||||
|
||||
static std::string buffer;
|
||||
buffer.clear();
|
||||
|
||||
/* Check if we can open the file */
|
||||
gdcm::Reader R;
|
||||
@ -112,10 +113,8 @@ const char* queryStationName(const char* pcFName){
|
||||
const gdcm::File &file = R.GetFile();
|
||||
const gdcm::DataSet &ds = file.GetDataSet();
|
||||
|
||||
std::string s (gGetStringValueFromTag(gdcm::Tag(0x0008,0x1010), ds));
|
||||
std::copy(s.rbegin(), s.rend(), std::back_inserter(buffer));
|
||||
|
||||
std::reverse(buffer.begin(),buffer.end());
|
||||
std::string s(gGetStringValueFromTag(gdcm::Tag(0x0008,0x1010), ds));
|
||||
std::copy(s.begin(), s.end(), buffer.begin());
|
||||
|
||||
return buffer.c_str();
|
||||
|
||||
@ -134,10 +133,12 @@ int query2DimageReconstructionDiameter(const char *pcFName){
|
||||
const gdcm::File &file = R.GetFile();
|
||||
const gdcm::DataSet &ds = file.GetDataSet();
|
||||
|
||||
char* sTmpString = new char [255];
|
||||
strcpy( sTmpString,gGetStringValueFromTag(gdcm::Tag(0x0018,0x1100), ds));
|
||||
std::string buffer;
|
||||
|
||||
return std::atoi(sTmpString);
|
||||
std::string s(gGetStringValueFromTag(gdcm::Tag(0x0018,0x1100), ds));
|
||||
std::copy(s.begin(), s.end(), buffer.begin());
|
||||
|
||||
return std::stoi(buffer);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user