|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const appState = {
|
|
|
models: {
|
|
|
classifier: null,
|
|
|
poorGood: null,
|
|
|
grader: null,
|
|
|
yolo: null
|
|
|
},
|
|
|
croppedEmbryos: [],
|
|
|
embryoResults: [],
|
|
|
embryoRemarks: {},
|
|
|
currentEmbryoIndex: 0,
|
|
|
currentImage: null,
|
|
|
zoomLevel: 1,
|
|
|
finalResult: null
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function setModel(modelName, model) {
|
|
|
appState.models[modelName] = model;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getModel(modelName) {
|
|
|
return appState.models[modelName];
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function setCroppedEmbryos(embryos) {
|
|
|
appState.croppedEmbryos = embryos;
|
|
|
appState.currentEmbryoIndex = 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getCurrentEmbryo() {
|
|
|
return appState.croppedEmbryos[appState.currentEmbryoIndex];
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function setCurrentImage(imageData) {
|
|
|
appState.currentImage = imageData;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function setZoomLevel(level) {
|
|
|
appState.zoomLevel = level;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getZoomLevel() {
|
|
|
return appState.zoomLevel;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function setCurrentEmbryoIndex(index) {
|
|
|
appState.currentEmbryoIndex = index;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getEmbryoCount() {
|
|
|
return appState.croppedEmbryos.length;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function setEmbryoRemark(index, remark) {
|
|
|
appState.embryoRemarks[index] = remark;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getEmbryoRemark(index) {
|
|
|
return appState.embryoRemarks[index] || '';
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getAllRemarks() {
|
|
|
return appState.embryoRemarks;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function clearAllRemarks() {
|
|
|
appState.embryoRemarks = {};
|
|
|
}
|
|
|
|