Skip to content

Commit

Permalink
Window presets (#515)
Browse files Browse the repository at this point in the history
* window level preset buttons

* add CT to allowed scan types

* Add migration for new scan type option

* Lint fix

Co-authored-by: curtislisle <[email protected]>
Co-authored-by: Anne Haley <[email protected]>
  • Loading branch information
3 people authored Jun 1, 2022
1 parent c9c078d commit 97a66c4
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
40 changes: 40 additions & 0 deletions client/src/components/ControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,20 @@ export default {
this.representation.setWindowWidth(this.currentWindowWidth);
this.representation.setWindowLevel(this.currentWindowLevel);
},
// this is a preset value assigned when the user clicks a W/L preset button icon
setWindowLevelToHighContrast() {
this.setCurrentWindowWidth(1500);
this.setCurrentWindowLevel(-500);
this.representation.setWindowWidth(this.currentWindowWidth);
this.representation.setWindowLevel(this.currentWindowLevel);
},
setWindowLevelToLowContrast() {
this.setCurrentWindowWidth(6000);
this.setCurrentWindowLevel(500);
this.representation.setWindowWidth(this.currentWindowWidth);
this.representation.setWindowLevel(this.currentWindowLevel);
},
navigateToFrame(frameId) {
if (frameId && frameId !== this.$route.params.frameId) {
this.$router
Expand Down Expand Up @@ -577,6 +591,32 @@ export default {
</v-slider>
</v-col>
</v-row>

<v-row>
<v-col cols="4">
Window/Level Presets
</v-col>
<v-col cols="4">
<v-btn
small
depressed
@click="setWindowLevelToHighContrast"
>
High Contrast
</v-btn>
</v-col>

<v-col cols="4">
<v-btn
small
depressed
@click="setWindowLevelToLowContrast"
>
Low Contrast
</v-btn>
</v-col>
</v-row>

<v-row class="mx-0">
<v-col
cols="12"
Expand Down
40 changes: 40 additions & 0 deletions miqa/core/migrations/0034_CT_scan_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Generated by Django 3.2.13 on 2022-06-01 20:01

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0033_project_anatomy_orientation'),
]

operations = [
migrations.AlterField(
model_name='scan',
name='scan_type',
field=models.CharField(
choices=[
('T1', 'T1'),
('T2', 'T2'),
('FMRI', 'FMRI'),
('MRA', 'MRA'),
('PD', 'PD'),
('DTI', 'DTI'),
('DWI', 'DWI'),
('ncanda-t1spgr-v1', 'ncanda-t1spgr-v1'),
('ncanda-mprage-v1', 'ncanda-mprage-v1'),
('ncanda-t2fse-v1', 'ncanda-t2fse-v1'),
('ncanda-dti6b500pepolar-v1', 'ncanda-dti6b500pepolar-v1'),
('ncanda-dti30b400-v1', 'ncanda-dti30b400-v1'),
('ncanda-dti60b1000-v1', 'ncanda-dti60b1000-v1'),
('ncanda-grefieldmap-v1', 'ncanda-grefieldmap-v1'),
('ncanda-rsfmri-v1', 'ncanda-rsfmri-v1'),
('PET', 'PET'),
('CT', 'CT'),
],
default='T1',
max_length=25,
),
),
]
1 change: 1 addition & 0 deletions miqa/core/models/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
('ncanda-grefieldmap-v1', 'ncanda-grefieldmap-v1'),
('ncanda-rsfmri-v1', 'ncanda-rsfmri-v1'),
('PET', 'PET'),
('CT', 'CT'),
]


Expand Down

0 comments on commit 97a66c4

Please sign in to comment.