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){
|
const char* queryStationName(const char* pcFName){
|
||||||
|
|
||||||
static std::string buffer;
|
static std::string buffer;
|
||||||
|
buffer.clear();
|
||||||
|
|
||||||
/* Check if we can open the file */
|
/* Check if we can open the file */
|
||||||
gdcm::Reader R;
|
gdcm::Reader R;
|
||||||
@ -112,10 +113,8 @@ const char* queryStationName(const char* pcFName){
|
|||||||
const gdcm::File &file = R.GetFile();
|
const gdcm::File &file = R.GetFile();
|
||||||
const gdcm::DataSet &ds = file.GetDataSet();
|
const gdcm::DataSet &ds = file.GetDataSet();
|
||||||
|
|
||||||
std::string s (gGetStringValueFromTag(gdcm::Tag(0x0008,0x1010), ds));
|
std::string s(gGetStringValueFromTag(gdcm::Tag(0x0008,0x1010), ds));
|
||||||
std::copy(s.rbegin(), s.rend(), std::back_inserter(buffer));
|
std::copy(s.begin(), s.end(), buffer.begin());
|
||||||
|
|
||||||
std::reverse(buffer.begin(),buffer.end());
|
|
||||||
|
|
||||||
return buffer.c_str();
|
return buffer.c_str();
|
||||||
|
|
||||||
@ -134,10 +133,12 @@ int query2DimageReconstructionDiameter(const char *pcFName){
|
|||||||
const gdcm::File &file = R.GetFile();
|
const gdcm::File &file = R.GetFile();
|
||||||
const gdcm::DataSet &ds = file.GetDataSet();
|
const gdcm::DataSet &ds = file.GetDataSet();
|
||||||
|
|
||||||
char* sTmpString = new char [255];
|
std::string buffer;
|
||||||
strcpy( sTmpString,gGetStringValueFromTag(gdcm::Tag(0x0018,0x1100), ds));
|
|
||||||
|
|
||||||
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