Skip to content

Commit 03dd6cf

Browse files
committed
fix(cine): hide view-type switcher and force axial for cine views
Coronal/Sagittal 2D slots kept their orientation when a cine image was dropped on them, and the view-type select was still offered. Force the slice viewer to render Axial for cine images, swap the bottom-right switcher for play controls, and clean up FPS label styling to match surrounding overlay text.
1 parent e1d01f5 commit 03dd6cf

3 files changed

Lines changed: 54 additions & 37 deletions

File tree

src/components/PlayControls.vue

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,19 @@ function togglePlay() {
124124
>
125125
<v-icon size="14">{{ playing ? 'mdi-pause' : 'mdi-play' }}</v-icon>
126126
</button>
127-
<input
128-
:value="fpsInput"
129-
type="number"
130-
:min="MIN_CINE_FPS"
131-
:max="MAX_CINE_FPS"
132-
class="fps-input"
133-
title="Frames per second"
134-
@input="clampFpsInput"
135-
@blur="commitFpsInput"
136-
/>
137-
<span class="fps-suffix">fps</span>
127+
<span class="fps-control">
128+
<input
129+
:value="fpsInput"
130+
type="number"
131+
:min="MIN_CINE_FPS"
132+
:max="MAX_CINE_FPS"
133+
class="fps-input"
134+
title="Frames per second"
135+
@input="clampFpsInput"
136+
@blur="commitFpsInput"
137+
/>
138+
<span class="fps-suffix">FPS</span>
139+
</span>
138140
</div>
139141
</template>
140142

@@ -144,8 +146,8 @@ function togglePlay() {
144146
align-items: center;
145147
gap: 4px;
146148
color: #fff;
147-
font-size: 0.8125rem;
148-
line-height: 1;
149+
font-size: inherit;
150+
line-height: inherit;
149151
}
150152
151153
.play-btn {
@@ -159,27 +161,39 @@ function togglePlay() {
159161
border: none;
160162
color: inherit;
161163
cursor: pointer;
164+
opacity: 1;
165+
}
166+
167+
.play-btn :deep(.v-icon) {
168+
opacity: 1;
162169
}
163170
164171
.play-btn:hover {
165172
color: rgba(255, 255, 255, 0.8);
166173
}
167174
175+
.fps-control {
176+
display: inline-flex;
177+
align-items: center;
178+
gap: 4px;
179+
}
180+
168181
.fps-input {
169182
width: 44px;
170183
background: transparent;
171184
color: inherit;
172185
border: none;
173186
padding: 0 4px;
174187
text-align: right;
175-
font-size: inherit;
188+
font: inherit;
189+
opacity: 1;
176190
}
177191
178192
.fps-input:focus {
179193
outline: 1px solid rgba(255, 255, 255, 0.3);
180194
}
181195
182196
.fps-suffix {
183-
opacity: 0.7;
197+
opacity: 1;
184198
}
185199
</style>

src/components/SliceViewer.vue

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,21 @@ const viewOptions = computed(
223223
() => viewInfo.value.options as SliceViewerOptions
224224
);
225225
226+
// base image
227+
const {
228+
currentImageID,
229+
currentLayers,
230+
currentImageMetadata,
231+
currentImageData,
232+
isImageLoading,
233+
} = useCurrentImage();
234+
235+
const isCine = computed(() => isCineImage(currentImageID.value));
236+
const effectiveOrientation = computed<LPSAxis>(() =>
237+
isCine.value ? 'Axial' : viewOptions.value.orientation
238+
);
226239
const viewingVectors = computed(() =>
227-
get2DViewingVectors(viewOptions.value.orientation)
240+
get2DViewingVectors(effectiveOrientation.value)
228241
);
229242
const viewDirection = computed(() => viewingVectors.value.viewDirection);
230243
const viewUp = computed(() => viewingVectors.value.viewUp);
@@ -244,14 +257,6 @@ useViewAnimationListener(vtkView, viewId, '2D');
244257
// active tool
245258
const { currentTool } = storeToRefs(useToolStore());
246259
247-
// base image
248-
const {
249-
currentImageID,
250-
currentLayers,
251-
currentImageMetadata,
252-
currentImageData,
253-
isImageLoading,
254-
} = useCurrentImage();
255260
const { slice: currentSlice, range: sliceRange } = useSliceConfig(
256261
viewId,
257262
currentImageID
@@ -267,7 +272,6 @@ const windowingManipulatorProps = computed(() => {
267272
268273
// Scalar probe samples the canonical image; for cine that's frame-0-only.
269274
// Unmount it for cine views and clear any stale probe data on switch.
270-
const isCine = computed(() => isCineImage(currentImageID.value));
271275
const probeStore = useProbeStore();
272276
watch(isCine, (cine) => {
273277
if (cine) probeStore.clearProbeData();

src/components/SliceViewerOverlay.vue

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ const {
3939
const { metadata } = useImage(imageId);
4040
4141
const isCine = computed(() => isCineImage(imageId.value));
42+
const showViewTypeSwitcher = computed(
43+
() =>
44+
!isCine.value &&
45+
!viewId.value.includes('-coronal') &&
46+
!viewId.value.includes('-sagittal') &&
47+
!viewId.value.includes('-axial') &&
48+
!viewId.value.includes('-multi-oblique')
49+
);
4250
</script>
4351

4452
<template>
@@ -73,28 +81,19 @@ const isCine = computed(() => isCineImage(imageId.value));
7381
</div>
7482
</div>
7583
</template>
76-
<template v-slot:bottom-center>
77-
<div v-if="isCine" class="annotation-cell" @click.stop>
78-
<play-controls :view-id="viewId" :image-id="imageId" />
79-
</div>
80-
</template>
8184
<template v-slot:top-right>
8285
<div class="annotation-cell">
8386
<dicom-quick-info-button :image-id="imageId"></dicom-quick-info-button>
8487
</div>
8588
</template>
8689
<template #bottom-right>
8790
<div
88-
v-if="
89-
!viewId.includes('-coronal') &&
90-
!viewId.includes('-sagittal') &&
91-
!viewId.includes('-axial') &&
92-
!viewId.includes('-multi-oblique')
93-
"
91+
v-if="isCine || showViewTypeSwitcher"
9492
class="annotation-cell"
9593
@click.stop
9694
>
97-
<ViewTypeSwitcher :view-id="viewId" :image-id="imageId" />
95+
<play-controls v-if="isCine" :view-id="viewId" :image-id="imageId" />
96+
<ViewTypeSwitcher v-else :view-id="viewId" :image-id="imageId" />
9897
</div>
9998
</template>
10099
</view-overlay-grid>

0 commit comments

Comments
 (0)