Comments (7)
We should prevent series of slice annotations to be loaded. A quick fix could be to verify, once annotations were loaded, that we are still in the same slice (currentImage) from where the load was launched. If that's not the case, we do not add the annotations to the slice.
from microdraw.
Hi Hannah,
Commit 75ec636 should solve the 'binge loading' issue. I defined a 'annotationLoadingFlag' that's true when an annotation is loading. If loading is finished or if it fails, annotationLoadingFlag goes false, and further annotations can be loaded. I also check once an annotation has been loaded if the currentImage is the same that the annotation was ment for. If that's not the case, then the code calls itself to get the currentImage. For example: imagine that you are moving the slider and it goes all the way from 1000 to 1500 where it stops. The code will load a bunch of annotations in between 1000 and 1500. Let's suppose that the last one was 1495, and that it finished loading after the user stopped fiddling with the slider. In that case, the annotation loaded will be that of 1495 but currentImage will be 1500, and the code will auto-load the annotation for currentImage=1500.
I also added the code to save multiple-slice annotations. To prevent saving annotations from slices that haven't changed, I am now saving a hash obtained from the Regions. Before saving I recompute the hash. If it hasn't changed, I don't save anything. If it has changed, I update the hash to the new one and save the file.
There was one last issue with multi-slice saving. I was using myTimestamp (time of saving) as Primary Key for the database. When saving multiple slices, myTimestamp will be the same for many of them, and mySQL will refuse to save them. To solve this I had to add a new UniqueID integer column to the database which is now the primary key instead of myTimestamp. I'll add the updated database code in a second.
I'll close the issue, but feel free to open it again if you find a bug.
from microdraw.
Thanks! Looks good, but I will have a close look at it tomorrow.
Regarding the code for saving, I fixed a bug that would overwrite not yet loaded annotations in #34
from microdraw.
Unfortunately, this is not working for me. The annotationLoadingFlag is never set to true, so this might be part of the problem :-)
There are actually two problems when navigating with the slider:
- The old paper canvas is not hidden correctly and
- Annotations are loaded two times from the db
For 1. I might have a solution: Instead of hiding the previous slide only when initAnnotationOverlay
is called, I am now calling a new function hideAnnotationOverlay
from loadImage
(which happens before the loading of the actual tile source). In #40 you can see these changes.
For the second problem, I am not quite sure how to do it. Maybe when the annotationLoadingFlag
works properly, it solves this?
Btw, the log message when saving always outputs the name of the last slide. But it should display the name of the saved slide...
from microdraw.
the log message displays always the last value because that is the value of the 'sl' variable at that time. We should use a closure to generate a local copy of 'sl' at the time when the ajax call is executed... (this will not change anything to the execution, though).
from microdraw.
is this still an issue?
from microdraw.
It was fixed with #48 by disabling the loading of images until the slider has stopped. Only for IE there still might be problems.
from microdraw.
Related Issues (20)
- Different json encryption for selected and not selected polygons HOT 5
- Server constantly checking for access token HOT 2
- Ability to programmatically upload contours HOT 8
- update readme
- tests for /upload endpoint, allow for memory storage over fs by configuration HOT 3
- Differentiate Replace or Merge existing contours with imported ones
- Validate the json files before accepting a programmatic upload
- Inconsistency saving after 'AddRegion' and 'SubstractRegion' HOT 3
- Add test to compound path
- Using Rollup for bundling? HOT 2
- Should we avoid using `reject` when no data is found? HOT 3
- Running the mocha tests erases the complete MongoDB HOT 2
- flip region not working HOT 1
- changes requested
- Use random region UIDs HOT 1
- splitRegion desynchronises data and display region structures
- Panel slider button in "project" mode does not work in iOs
- Amplify size of movement needed to displace a region HOT 1
- Regarding microw embed into application HOT 1
- Microdraw tool as a library HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microdraw.