dicom headers contain header name
This commit is contained in:
parent
ce9669b556
commit
b2726911e7
@ -283,20 +283,21 @@ private function getStudyDicomTags(string $study_uuid): array
|
|||||||
// randomly sample few instances for tags collection
|
// randomly sample few instances for tags collection
|
||||||
$selectedInstances = count($instances) <= $this->maxInstances ? $instances : array_rand(array_flip($instances), $this->maxInstances);
|
$selectedInstances = count($instances) <= $this->maxInstances ? $instances : array_rand(array_flip($instances), $this->maxInstances);
|
||||||
|
|
||||||
$tags = [];
|
$tags = collect();
|
||||||
foreach ($selectedInstances as $instance) {
|
foreach ($selectedInstances as $instance) {
|
||||||
foreach ($this->fetchInstancesTags($instance) as $key => $value) {
|
foreach ($this->fetchInstancesTags($instance) as $key => $value) {
|
||||||
if ($key == 'MainDicomTags' || $key == 'RequestedTags') {
|
if ($key == 'MainDicomTags' || $key == 'RequestedTags') {
|
||||||
foreach ($value as $tag => $val) {
|
foreach ($value as $tag => $val) {
|
||||||
if (! isset($tags[$tag]) || $tags[$tag] !== $val) {
|
$dcmTag = RawDicomTags::tryFrom($tag);
|
||||||
$tags[$tag] = $val;
|
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
|
private function setValue(array &$array, string $key, mixed $value): void
|
||||||
|
Loading…
Reference in New Issue
Block a user