Skip to content

Commit bf22a03

Browse files
committed
fix(windowing): keep autoRange when switching images
1 parent 8d9a5c6 commit bf22a03

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/composables/useWindowingConfigInitializer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ export function useWindowingConfigInitializer(
152152
{ deep: true }
153153
);
154154

155-
watch([useAuto, autoRange], ([gate, percentile]) => {
156-
if (!gate) {
155+
watch([useAuto, autoRange, autoRangeValues], () => {
156+
if (!useAuto.value) {
157157
return;
158158
}
159159
const image = imageData.value;
@@ -162,7 +162,7 @@ export function useWindowingConfigInitializer(
162162
if (imageIdVal == null || windowConfig.value == null || !image) {
163163
return;
164164
}
165-
const range = autoRangeValues.value[percentile];
165+
const range = autoRangeValues.value[autoRange.value];
166166
const width = range[1] - range[0];
167167
const level = (range[1] + range[0]) / 2;
168168
store.updateConfig(viewIdVal, imageIdVal, {

0 commit comments

Comments
 (0)