Skip to content

Commit 8b2b3ea

Browse files
authored
Merge pull request #750 from Kitware/no-flash-of-white-wl
Avoid a flash of white when loading images without W/L info
2 parents 7adcd97 + e6b1f0b commit 8b2b3ea

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/composables/useWindowingConfig.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ export function useWindowingConfig(
1919
});
2020

2121
const generateComputed = (prop: 'width' | 'level') => {
22+
// show all-black image with W/L of (1, 2^32-1) until slices load in and we get a valid window/level
23+
const defaultValue = prop === 'width' ? 1 : 2 ** 32 - 1;
2224
return computed({
2325
get: () => {
24-
return config.value?.[prop] ?? 0;
26+
return config.value?.[prop] ?? defaultValue;
2527
},
2628
set: (val) => {
2729
const imageIdVal = unref(imageID);

0 commit comments

Comments
 (0)