Added scan control for background detect
There is now a button that appears when the background-detect extension is installed, allowing you to skip autofocus if the field looks like background.
This commit is contained in:
parent
333b52aa9b
commit
cfb1bb09a6
1 changed files with 36 additions and 2 deletions
|
|
@ -221,6 +221,17 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="uk-margin-small uk-margin-remove-bottom" v-if="backgroundDetectUri">
|
||||||
|
<label class="uk-form-label" for="form-stacked-text">
|
||||||
|
<input
|
||||||
|
v-model="detectEmptyFieldsAndSkipAutofocus"
|
||||||
|
class="uk-checkbox"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
Skip autofocus for empty fields of view
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="uk-margin-small uk-margin-remove-bottom">
|
<div class="uk-margin-small uk-margin-remove-bottom">
|
||||||
<label class="uk-form-label" for="form-stacked-text"
|
<label class="uk-form-label" for="form-stacked-text"
|
||||||
>Scan Style</label
|
>Scan Style</label
|
||||||
|
|
@ -365,6 +376,7 @@ function defaultCaptureSettings() {
|
||||||
annotations: {
|
annotations: {
|
||||||
Client: "openflexure-microscope-jsclient:builtin"
|
Client: "openflexure-microscope-jsclient:builtin"
|
||||||
},
|
},
|
||||||
|
detectEmptyFieldsAndSkipAutofocus: false,
|
||||||
smartStack: false,
|
smartStack: false,
|
||||||
smartStackThreshold: 0.9,
|
smartStackThreshold: 0.9,
|
||||||
smartStackPeakWidth: 200,
|
smartStackPeakWidth: 200,
|
||||||
|
|
@ -391,7 +403,8 @@ export default {
|
||||||
...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,
|
scanUri: null,
|
||||||
smartScanUri: null
|
smartScanUri: null,
|
||||||
|
backgroundDetectUri: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -461,7 +474,8 @@ export default {
|
||||||
style: this.scanStyle.toLowerCase(),
|
style: this.scanStyle.toLowerCase(),
|
||||||
namemode: this.namingStyle.toLowerCase(),
|
namemode: this.namingStyle.toLowerCase(),
|
||||||
autofocus_dz: afDeltas[this.scanDeltaZ],
|
autofocus_dz: afDeltas[this.scanDeltaZ],
|
||||||
fast_autofocus: this.scanDeltaZ == "Fast"
|
fast_autofocus: this.scanDeltaZ == "Fast",
|
||||||
|
detect_empty_fields_and_skip_autofocus: this.detectEmptyFieldsAndSkipAutofocus
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
smartScanPayload: function() {
|
smartScanPayload: function() {
|
||||||
|
|
@ -508,6 +522,10 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
updateScanUri: function() {
|
updateScanUri: function() {
|
||||||
|
// Update URIs for the various functions in plugins.
|
||||||
|
// This will only work if the plugins are present, so
|
||||||
|
// checking if the URIs is null will determine which
|
||||||
|
// extensions are available.
|
||||||
axios
|
axios
|
||||||
.get(this.pluginsUri) // Get a list of plugins
|
.get(this.pluginsUri) // Get a list of plugins
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
|
@ -540,6 +558,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.background-detect"
|
||||||
|
);
|
||||||
|
if (foundExtension) {
|
||||||
|
// Get plugin action link
|
||||||
|
this.backgroundDetectUri = foundExtension.links.grab_and_classify_image.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