Skip to content

Commit

Permalink
feat(WindowLevelControls): List window width and level tags
Browse files Browse the repository at this point in the history
If there are DICOM tags for window width and level tags list those for the user
to select from.
  • Loading branch information
bnmajor committed Oct 3, 2023
1 parent b7ec673 commit 792e323
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/components/tools/windowing/WindowLevelControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,27 @@ export default defineComponent({
},
});
// --- Tag WL Options --- //
function parseTags(text: string) {
return text.split('\\');
}
const tags = computed(() => {
if (
currentImageID.value &&
currentImageID.value in dicomStore.imageIDToVolumeKey
) {
const volKey = dicomStore.imageIDToVolumeKey[currentImageID.value];
const { WindowWidth, WindowLevel } = dicomStore.volumeInfo[volKey];
const levels = parseTags(WindowLevel);
return parseTags(WindowWidth).map((val, idx) => {
return { width: val, level: levels[idx] };
});
}
return [];
});
// --- Reset --- //
const resetWindowLevel = () => {
Expand All @@ -110,6 +131,7 @@ export default defineComponent({
wlPresetSettings,
WLPresetsCT,
isCT,
tags,
};
},
});
Expand Down Expand Up @@ -144,6 +166,17 @@ export default defineComponent({
Reset Preset
</v-btn>
</v-radio-group>
<v-radio-group v-if="tags.length" v-model="wlPresetSettings" hide-details>
<p>Tags</p>
<hr />
<v-radio
v-for="(value, idx) in tags"
:key="idx"
:label="`Tag ${idx + 1} [W:${value.width},L:${value.level}]`"
:value="value"
density="compact"
/>
</v-radio-group>
<v-radio-group v-model="wlAutoSettings" hide-details>
<p>Auto</p>
<hr />
Expand Down

0 comments on commit 792e323

Please sign in to comment.