Skip to content

Commit

Permalink
LIMS-1569: Improve invert behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Williams committed Dec 13, 2024
1 parent f884c5a commit 9961fe6
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions client/src/js/modules/dc/views/imageviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ define(['jquery', 'marionette',

this.moved = false
this.blocks = 0
this.invert_change = false

this.ps = parseFloat(this.model.get('DETECTORPIXELSIZEHORIZONTAL'))/1000 || 0.172
this.diwidth = parseInt(this.model.get('DETECTORNUMBEROFPIXELSX')) || 2527
Expand Down Expand Up @@ -445,14 +444,13 @@ define(['jquery', 'marionette',

// Apply image adjustments
adjust: function() {
if (this.brightness == 0 && this.contrast == 0 && !(this.invert_change || this.ui.invert.is(':checked'))) return
if (this.brightness == 0 && this.contrast == 0 && !(this.ui.invert.is(':checked'))) return

this.c.revert()
if (this.invert_change) {
if (this.ui.invert.is(':checked')) {
this.c.invert()
//_plot_profiles(lastx, lasty)
}
this.invert_change = false

var self = this
this.c.brightness(this.brightness).contrast(this.contrast).render(function() {
Expand Down Expand Up @@ -678,9 +676,6 @@ define(['jquery', 'marionette',
//return false
},




// Clamp zoom box
_clamp_z_box: function(c) {
if (c[0]+20 > this.ui.canvas.width()) c[0] = this.ui.canvas.width()-20
Expand All @@ -698,13 +693,6 @@ define(['jquery', 'marionette',
if (this.offsetx < this.ui.canvas.width() - this.scalef*this.width) this.offsetx = this.ui.canvas.width() - this.scalef*this.width
},








// Convert distance from centre to resolution and back
_dist_to_res: function(dist) {
return this.model.get('WAVELENGTH') / (2*Math.sin(Math.atan(dist/this.model.get('DET'))/2))
Expand Down Expand Up @@ -742,11 +730,8 @@ define(['jquery', 'marionette',

this.ui.resc.text(res.toFixed(2))
},







// Bind load image on return
keyPressNum: function(e) {
var n = parseInt(this.ui.num.val())
Expand Down Expand Up @@ -790,12 +775,12 @@ define(['jquery', 'marionette',
},

doInvert: function() {
this.invert_change = true
this._dra()
},

doIceOrRes: function() {
if (app.options.get("dials_rest_url_rings")) {
this.ui.invert.prop('checked', false)
this.reloadImage()
} else {
this._dra()
Expand Down

0 comments on commit 9961fe6

Please sign in to comment.