Add uniqueID and SliceCount to ExtendMedicalImageProperties
This commit is contained in:
@@ -102,6 +102,14 @@ void DICOMDirectoryHelper::getFileProperty(const std::string &path, DICOMFileMap
|
||||
ReadTAGToProperty(StudyID, 0x0020, 0x0010);
|
||||
seriesProperty->SetSeriesUID(SeriesUID.c_str());
|
||||
seriesProperty->SetSeriesNumber(SeriesNumber);
|
||||
std::string uniqueID;
|
||||
uniqueID.append(PatientName);
|
||||
uniqueID.append("_");
|
||||
uniqueID.append(StudyUID);
|
||||
uniqueID.append("_");
|
||||
uniqueID.append(SeriesUID);
|
||||
seriesProperty->SetUniqueID(uniqueID);
|
||||
|
||||
double WindowCenter = 0.0;
|
||||
dataset->findAndGetFloat64(DcmTagKey(0x0028, 0x1050), WindowCenter);
|
||||
double WindowWidth = 0.0;
|
||||
|
||||
@@ -144,13 +144,7 @@ SeriesImageSet* DicomLoader::getSeriesImageSet(const std::string& uniqueID)//, D
|
||||
if (reader) reader->Delete();
|
||||
reader = vtkDICOMImageReader2::New();
|
||||
auto iter = std::find_if(imageProperties.begin(), imageProperties.end(),[&uniqueID](auto property){
|
||||
std::string id;
|
||||
id.append(property->GetPatientName());
|
||||
id.append("_");
|
||||
id.append(property->GetStudyUID());
|
||||
id.append("_");
|
||||
id.append(property->GetSeriesUID());
|
||||
return id == uniqueID;
|
||||
return property->GetUniqueID()==uniqueID;
|
||||
});
|
||||
if (iter==imageProperties.end()) return nullptr;
|
||||
|
||||
@@ -217,12 +211,7 @@ void DicomLoader::readTags(const std::string &dir, SeriesOpenMode openMode)
|
||||
}
|
||||
if ( imageProperties.size() > 0 ) {
|
||||
currentImageProperty = imageProperties[0];
|
||||
defaultUniqueID = "";
|
||||
defaultUniqueID.append(currentImageProperty->GetPatientName());
|
||||
defaultUniqueID.append("_");
|
||||
defaultUniqueID.append(currentImageProperty->GetStudyUID());
|
||||
defaultUniqueID.append("_");
|
||||
defaultUniqueID.append(currentImageProperty->GetSeriesUID());
|
||||
defaultUniqueID = currentImageProperty->GetUniqueID();
|
||||
}
|
||||
readSeries();
|
||||
}
|
||||
|
||||
@@ -59,6 +59,16 @@ public:
|
||||
if (FileNames.empty()) return nullptr;
|
||||
return FileNames[FileNames.size()/2].data();
|
||||
}
|
||||
unsigned long long GetSliceCount(){
|
||||
return FileNames.size();
|
||||
}
|
||||
|
||||
const std::string& GetUniqueID(){
|
||||
return uniqueID;
|
||||
}
|
||||
void SetUniqueID(const std::string& id){
|
||||
uniqueID = id;
|
||||
}
|
||||
|
||||
protected:
|
||||
ExtendMedicalImageProperties();
|
||||
@@ -69,6 +79,7 @@ protected:
|
||||
long AcquisitionNumber = 0;
|
||||
unsigned short SamplePerPixel;
|
||||
std::vector<std::string> FileNames;
|
||||
std::string uniqueID;
|
||||
private:
|
||||
ExtendMedicalImageProperties(const ExtendMedicalImageProperties&) = delete;
|
||||
void operator=(const ExtendMedicalImageProperties&) = delete;
|
||||
|
||||
Reference in New Issue
Block a user