Skip to content

Commit b8e4822

Browse files
committed
fix(image-sets-normalization): check more tags when grouping volumes
1 parent d4ec0c3 commit b8e4822

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/dicom/gdcm/image-sets-normalization.cxx

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
const std::string STUDY_INSTANCE_UID = "0020|000D";
3232
const std::string SERIES_INSTANCE_UID = "0020|000e";
33+
const std::string FRAME_OF_REFERENCE_UID = "0020|0052";
34+
const std::string IMAGE_ORIENTATION_PATIENT = "0020|0037";
3335

3436
using File = std::string;
3537

@@ -124,8 +126,7 @@ bool compareTags(const TagMap &tags1, const TagMap &tags2, const TagKeys &tagKey
124126

125127
bool isSameVolume(const TagMap &tags1, const TagMap &tags2)
126128
{
127-
// TODO check cosines
128-
return compareTags(tags1, tags2, {SERIES_INSTANCE_UID});
129+
return compareTags(tags1, tags2, {SERIES_INSTANCE_UID, FRAME_OF_REFERENCE_UID, IMAGE_ORIENTATION_PATIENT});
129130
}
130131

131132
Volumes groupByVolume(const DicomFiles &dicomFiles)
@@ -135,8 +136,7 @@ Volumes groupByVolume(const DicomFiles &dicomFiles)
135136
{
136137
const auto tags = dicomFile.second;
137138
auto matchingVolume = std::find_if(volumes.begin(), volumes.end(), [&tags](const Volume &volume)
138-
{
139-
return isSameVolume(volume.begin()->second, tags); });
139+
{ return isSameVolume(volume.begin()->second, tags); });
140140

141141
if (matchingVolume != volumes.end())
142142
{

0 commit comments

Comments
 (0)