Skip to content

Commit

Permalink
fix(image-sets-normalization): check more tags when grouping volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHax committed Mar 31, 2024
1 parent d4ec0c3 commit b8e4822
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/dicom/gdcm/image-sets-normalization.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

const std::string STUDY_INSTANCE_UID = "0020|000D";
const std::string SERIES_INSTANCE_UID = "0020|000e";
const std::string FRAME_OF_REFERENCE_UID = "0020|0052";
const std::string IMAGE_ORIENTATION_PATIENT = "0020|0037";

using File = std::string;

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

bool isSameVolume(const TagMap &tags1, const TagMap &tags2)
{
// TODO check cosines
return compareTags(tags1, tags2, {SERIES_INSTANCE_UID});
return compareTags(tags1, tags2, {SERIES_INSTANCE_UID, FRAME_OF_REFERENCE_UID, IMAGE_ORIENTATION_PATIENT});
}

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

if (matchingVolume != volumes.end())
{
Expand Down
Binary file not shown.

0 comments on commit b8e4822

Please sign in to comment.