dicom headers contain header name

This commit is contained in:
Masroor Ehsan 2025-01-27 17:52:08 +06:00
parent ce9669b556
commit b2726911e7

View File

@ -283,20 +283,21 @@ private function getStudyDicomTags(string $study_uuid): array
// randomly sample few instances for tags collection
$selectedInstances = count($instances) <= $this->maxInstances ? $instances : array_rand(array_flip($instances), $this->maxInstances);
$tags = [];
$tags = collect();
foreach ($selectedInstances as $instance) {
foreach ($this->fetchInstancesTags($instance) as $key => $value) {
if ($key == 'MainDicomTags' || $key == 'RequestedTags') {
foreach ($value as $tag => $val) {
if (! isset($tags[$tag]) || $tags[$tag] !== $val) {
$tags[$tag] = $val;
$dcmTag = RawDicomTags::tryFrom($tag);
if ($dcmTag != null && (! $tags->has($dcmTag->name) || $tags->get($dcmTag->name) !== $val)) {
$tags->put($dcmTag->name, $val);
}
}
}
}
}
return $tags;
return $tags->toArray();
}
private function setValue(array &$array, string $key, mixed $value): void