Skip to content

Commit

Permalink
Merge pull request #686 from PaulHax/seg-tweeks
Browse files Browse the repository at this point in the history
Default to Segment Groups under Annotations and Simpify CT Presets
  • Loading branch information
PaulHax authored Dec 19, 2024
2 parents d5c4237 + fa5c56e commit a76e8fb
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 74 deletions.
10 changes: 5 additions & 5 deletions src/components/AnnotationsModule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const MeasurementToolTypes = new Set<string>(
MeasurementTools.map(({ type }) => type)
);
const tab = ref(Tabs.Measurements);
const tab = ref(Tabs.SegmentGroups);
const { currentTool } = storeToRefs(useToolStore());
function autoFocusTab() {
Expand All @@ -58,16 +58,16 @@ watch(
<tool-controls />
<v-divider thickness="4" />
<v-tabs v-model="tab" align-tabs="center" density="compact" class="my-1">
<v-tab value="measurements" class="tab-header">Measurements</v-tab>
<v-tab value="segmentGroups" class="tab-header">Segment Groups</v-tab>
<v-tab value="measurements" class="tab-header">Measurements</v-tab>
</v-tabs>
<v-window v-model="tab">
<v-window-item value="measurements">
<measurements-tool-list :tools="MeasurementTools" />
</v-window-item>
<v-window-item value="segmentGroups">
<segment-group-controls />
</v-window-item>
<v-window-item value="measurements">
<measurements-tool-list :tools="MeasurementTools" />
</v-window-item>
</v-window>
</div>
</template>
Expand Down
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 a76e8fb

Please sign in to comment.