Skip to content

Commit

Permalink
feat(WindowLevelControls): simplify CT preset options
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHax committed Dec 19, 2024
1 parent 3eeb433 commit fa5c56e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 69 deletions.
30 changes: 12 additions & 18 deletions src/components/tools/windowing/WindowLevelControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default defineComponent({
const windowingStore = useWindowingStore();
const viewStore = useViewStore();
const dicomStore = useDICOMStore();
const panel = ref(['tags', 'presets']);
const panel = ref(['tags', 'presets', 'auto']);
const windowingDefaults = defaultWindowLevelConfig();
// Get the relevant view ids
Expand Down Expand Up @@ -126,7 +126,7 @@ export default defineComponent({
<v-expansion-panels v-model="panel" multiple>
<v-expansion-panel value="tags" v-if="tags.length">
<v-expansion-panel-title>
Data-Specific Presets
File Specific Presets
</v-expansion-panel-title>
<v-expansion-panel-text>
<v-radio-group v-model="wlOptions" hide-details>
Expand All @@ -141,24 +141,18 @@ export default defineComponent({
</v-expansion-panel-text>
</v-expansion-panel>
<v-expansion-panel v-if="showCtPresets" value="presets">
<v-expansion-panel-title>Presets</v-expansion-panel-title>
<v-expansion-panel-title>CT Presets</v-expansion-panel-title>
<v-expansion-panel-text>
<v-radio-group v-model="wlOptions" hide-details>
<template v-if="showCtPresets">
<p>CT Presets</p>
<hr />
<div v-for="(options, category) in WLPresetsCT" :key="category">
<p>{{ parseLabel(category) }}</p>
<v-radio
v-for="(value, key) in options"
:key="key"
:label="parseLabel(key)"
:value="value"
density="compact"
class="ml-3"
/>
</div>
</template>
<div v-for="(wl, name) in WLPresetsCT" :key="name">
<v-radio
:key="name"
:label="parseLabel(name)"
:value="wl"
density="compact"
class="ml-3"
/>
</div>
</v-radio-group>
</v-expansion-panel-text>
</v-expansion-panel>
Expand Down
70 changes: 19 additions & 51 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,57 +82,25 @@ export const WL_AUTO_DEFAULT = 'FullRange';
export const WL_HIST_BINS = 512;

export const WLPresetsCT = {
Head: {
Brain: {
width: 80,
level: 40,
},
Subdural: {
width: 300,
level: 100,
},
Stroke: {
width: 40,
level: 40,
},
Bones: {
width: 2800,
level: 600,
},
SoftTissue: {
width: 400,
level: 60,
},
},
Chest: {
Lungs: {
width: 1500,
level: -600,
},
Mediastinum: {
width: 350,
level: 50,
},
},
Abdomen: {
SoftTissue: {
width: 400,
level: 50,
},
Liver: {
width: 150,
level: 30,
},
},
Spine: {
SoftTissue: {
width: 250,
level: 50,
},
Bones: {
width: 1800,
level: 400,
},
Bones: {
width: 1000,
level: 400,
},
Air: {
width: 1000,
level: -426,
},
SoftTissue: {
width: 350,
level: 50,
},
Lungs: {
width: 1500,
level: -600,
},
Brain: {
width: 80,
level: 40,
},
};

Expand Down

0 comments on commit fa5c56e

Please sign in to comment.