Merge branch 'smart-stack-controls' into 'master'
Added controls for smart stack See merge request openflexure/openflexure-microscope-server!134
This commit is contained in:
commit
6d25dcfa9e
2 changed files with 116 additions and 34 deletions
18
openflexure_microscope/api/static/package-lock.json
generated
18
openflexure_microscope/api/static/package-lock.json
generated
|
|
@ -2971,12 +2971,6 @@
|
||||||
"unique-filename": "^1.1.1"
|
"unique-filename": "^1.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"caniuse-lite": {
|
|
||||||
"version": "1.0.30001165",
|
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001165.tgz",
|
|
||||||
"integrity": "sha512-8cEsSMwXfx7lWSUMA2s08z9dIgsnR5NAqjXP23stdsU3AUWkCr/rr4s4OFtHXn5XXr6+7kam3QFVoYyXNPdJPA==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"color-convert": {
|
"color-convert": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||||
|
|
@ -3902,12 +3896,6 @@
|
||||||
"node-releases": "^1.1.67"
|
"node-releases": "^1.1.67"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"caniuse-lite": {
|
|
||||||
"version": "1.0.30001165",
|
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001165.tgz",
|
|
||||||
"integrity": "sha512-8cEsSMwXfx7lWSUMA2s08z9dIgsnR5NAqjXP23stdsU3AUWkCr/rr4s4OFtHXn5XXr6+7kam3QFVoYyXNPdJPA==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"electron-to-chromium": {
|
"electron-to-chromium": {
|
||||||
"version": "1.3.615",
|
"version": "1.3.615",
|
||||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.615.tgz",
|
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.615.tgz",
|
||||||
|
|
@ -4724,9 +4712,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"caniuse-lite": {
|
"caniuse-lite": {
|
||||||
"version": "1.0.30001020",
|
"version": "1.0.30001249",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001020.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001249.tgz",
|
||||||
"integrity": "sha512-yWIvwA68wRHKanAVS1GjN8vajAv7MBFshullKCeq/eKpK7pJBVDgFFEqvgWTkcP2+wIDeQGYFRXECjKZnLkUjA==",
|
"integrity": "sha512-vcX4U8lwVXPdqzPWi6cAJ3FnQaqXbBqy/GZseKNQzRj37J7qZdGcBtxq/QLFNLLlfsoXLUdHw8Iwenri86Tagw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"case-sensitive-paths-webpack-plugin": {
|
"case-sensitive-paths-webpack-plugin": {
|
||||||
|
|
|
||||||
|
|
@ -244,10 +244,70 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<!--Show stack and scan if scan plugin is enabled-->
|
||||||
|
<li v-if="scanUri" :class="{ 'uk-open': smartStack && scanCapture }">
|
||||||
|
<a class="uk-accordion-title" href="#">Smart Stack</a>
|
||||||
|
<div
|
||||||
|
class="uk-accordion-content"
|
||||||
|
:class="{ 'uk-disabled': !scanCapture }"
|
||||||
|
>
|
||||||
|
<div class="uk-margin">
|
||||||
|
<label
|
||||||
|
><input
|
||||||
|
v-model="smartStack"
|
||||||
|
class="uk-checkbox"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
Enable smart stacking</label
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
Smart stacking is an experimental closed-loop Z stack, that checks
|
||||||
|
the Z stack is centred on the focus. It requires Z stacking to be
|
||||||
|
enabled above (we recommend 9 images in Z) and you must select
|
||||||
|
"fast" autofocus.
|
||||||
|
</p>
|
||||||
|
<div :class="{ 'uk-disabled': !smartStack }">
|
||||||
|
<div class="uk-margin-small uk-margin-remove-bottom">
|
||||||
|
<label class="uk-form-label" for="form-stacked-text"
|
||||||
|
>Autofocus range (steps)</label
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
v-model="smartStackAutofocusDz"
|
||||||
|
class="uk-input uk-form-small"
|
||||||
|
type="number"
|
||||||
|
min="1000"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="uk-margin-small uk-margin-remove-bottom">
|
||||||
|
<label class="uk-form-label" for="form-stacked-text"
|
||||||
|
>Alignment range (steps)</label
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
v-model="smartStackAlignDist"
|
||||||
|
class="uk-input uk-form-small"
|
||||||
|
type="number"
|
||||||
|
min="100"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div v-if="scanCapture" class="uk-margin uk-margin-remove-top">
|
<div v-if="scanCapture" class="uk-margin uk-margin-remove-top">
|
||||||
<taskSubmitter
|
<taskSubmitter
|
||||||
|
v-if="smartStack"
|
||||||
|
:submit-url="smartScanUri"
|
||||||
|
:submit-data="smartScanPayload"
|
||||||
|
:submit-label="'Start Smart Scan'"
|
||||||
|
:button-primary="true"
|
||||||
|
@response="onScanResponse"
|
||||||
|
@error="modalError"
|
||||||
|
>
|
||||||
|
</taskSubmitter>
|
||||||
|
<taskSubmitter
|
||||||
|
v-if="!smartStack"
|
||||||
:submit-url="scanUri"
|
:submit-url="scanUri"
|
||||||
:submit-data="scanPayload"
|
:submit-data="scanPayload"
|
||||||
:submit-label="'Start Scan'"
|
:submit-label="'Start Scan'"
|
||||||
|
|
@ -305,7 +365,14 @@ function defaultCaptureSettings() {
|
||||||
annotations: {
|
annotations: {
|
||||||
Client: "openflexure-microscope-jsclient:builtin"
|
Client: "openflexure-microscope-jsclient:builtin"
|
||||||
},
|
},
|
||||||
scanUri: null
|
smartStack: false,
|
||||||
|
smartStackThreshold: 0.9,
|
||||||
|
smartStackPeakWidth: 200,
|
||||||
|
smartStackAlignDist: 900,
|
||||||
|
smartStackBacklash: 100,
|
||||||
|
smartStackFitStyle: "chevy",
|
||||||
|
smartStackMAndMIndex: 10,
|
||||||
|
smartStackAutofocusDz: 3000
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -322,7 +389,9 @@ export default {
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
...defaultCaptureSettings(),
|
...defaultCaptureSettings(),
|
||||||
scanCapture: false // Don't remember the "scan" tickbox in local storage.
|
scanCapture: false, // Don't remember the "scan" tickbox in local storage.
|
||||||
|
scanUri: null,
|
||||||
|
smartScanUri: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -372,18 +441,6 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
scanPayload: function() {
|
scanPayload: function() {
|
||||||
var payload = this.basePayload;
|
|
||||||
|
|
||||||
// Scan params
|
|
||||||
payload.grid = [this.scanSteps.x, this.scanSteps.y, this.scanSteps.z];
|
|
||||||
payload.stride_size = [
|
|
||||||
this.scanStepSize.x,
|
|
||||||
this.scanStepSize.y,
|
|
||||||
this.scanStepSize.z
|
|
||||||
];
|
|
||||||
payload.style = this.scanStyle.toLowerCase();
|
|
||||||
payload.namemode = this.namingStyle.toLowerCase();
|
|
||||||
|
|
||||||
// Convert AF selector to dz
|
// Convert AF selector to dz
|
||||||
var afDeltas = {
|
var afDeltas = {
|
||||||
Off: 0,
|
Off: 0,
|
||||||
|
|
@ -392,11 +449,32 @@ export default {
|
||||||
Fine: 10,
|
Fine: 10,
|
||||||
Fast: 2000
|
Fast: 2000
|
||||||
};
|
};
|
||||||
|
return {
|
||||||
payload.autofocus_dz = afDeltas[this.scanDeltaZ];
|
...this.basePayload,
|
||||||
payload.fast_autofocus = this.scanDeltaZ == "Fast";
|
// Scan params
|
||||||
|
grid: [this.scanSteps.x, this.scanSteps.y, this.scanSteps.z],
|
||||||
return payload;
|
stride_size: [
|
||||||
|
this.scanStepSize.x,
|
||||||
|
this.scanStepSize.y,
|
||||||
|
this.scanStepSize.z
|
||||||
|
],
|
||||||
|
style: this.scanStyle.toLowerCase(),
|
||||||
|
namemode: this.namingStyle.toLowerCase(),
|
||||||
|
autofocus_dz: afDeltas[this.scanDeltaZ],
|
||||||
|
fast_autofocus: this.scanDeltaZ == "Fast"
|
||||||
|
};
|
||||||
|
},
|
||||||
|
smartScanPayload: function() {
|
||||||
|
return {
|
||||||
|
...this.scanPayload,
|
||||||
|
threshold: this.smartStackThreshold,
|
||||||
|
width: this.smartStackPeakWidth,
|
||||||
|
align_dist: this.smartStackAlignDist,
|
||||||
|
backlash: this.smartStackBacklash,
|
||||||
|
fit_style: this.smartStackFitStyle,
|
||||||
|
m_and_m_index: this.smartStackMAndMIndex,
|
||||||
|
autofocus_dz: this.smartStackAutofocusDz
|
||||||
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -446,6 +524,22 @@ export default {
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
this.modalError(error); // Let mixin handle error
|
this.modalError(error); // Let mixin handle error
|
||||||
});
|
});
|
||||||
|
|
||||||
|
axios
|
||||||
|
.get(this.pluginsUri) // Get a list of plugins
|
||||||
|
.then(response => {
|
||||||
|
var plugins = response.data;
|
||||||
|
var foundExtension = plugins.find(
|
||||||
|
e => e.title === "org.openflexure.smart-stack"
|
||||||
|
);
|
||||||
|
if (foundExtension) {
|
||||||
|
// Get plugin action link
|
||||||
|
this.smartScanUri = foundExtension.links.tile.href;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
this.modalError(error); // Let mixin handle error
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onScanResponse: function() {
|
onScanResponse: function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue