Skip to content

Commit

Permalink
fix(WindowLevelControls): Make sure default radio button is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
bnmajor committed Oct 4, 2023
1 parent 3f432f0 commit d73d2cf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/tools/windowing/WindowLevelControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default defineComponent({
const viewStore = useViewStore();
const dicomStore = useDICOMStore();
const panel = ref([1]);
const windowingDefaults = defaultWindowLevelConfig();
// Get the relevant view ids
const viewIDs = computed(() =>
Expand Down Expand Up @@ -67,12 +68,16 @@ export default defineComponent({
['ct', 'ctprotocol'].includes(modality.value.toLowerCase())
);
const wlDefaults = computed(() => {
return { width: windowingDefaults.width, level: windowingDefaults.level };
});
const wlPresetSettings = computed({
get() {
// All views will have the same setting, just grab the first
const viewID = viewIDs.value[0];
const config = windowingStore.getConfig(viewID, currentImageID.value);
return config?.preset || { width: 1, level: 0.5 };
return config?.preset || wlDefaults.value;
},
set(selection: { width: number; level: number }) {
const imageID = currentImageID.value;
Expand Down Expand Up @@ -117,8 +122,6 @@ export default defineComponent({
);
};
const wlDefaults = computed(() => defaultWindowLevelConfig());
return {
resetWindowLevel,
WLAutoRanges,
Expand Down

0 comments on commit d73d2cf

Please sign in to comment.