annotorious / annotorious-v2-selector-pack

Additional selection tools for Annotorious and the Annotorious OpenSeadragon plugin
BSD 3-Clause "New" or "Revised" License
14 stars 20 forks source link

Need help using the line tool #20

Open ufuk23 opened 1 year ago

ufuk23 commented 1 year ago

I can't use the line tool, it exists in the src tools folder but cannot be used. It doesn't exist in the latest min.js file released. I tried to generate it from the source code typing "npm run build" command, but it did not work so I could not build it for the latest selector min.js file. What is the best practice to use the line tool without suffering?

rsimon commented 1 year ago

The line tool didn't exist yet when the last release was publishe. I think it's good to go, though. I'll to see if I can test (and create a new release) soon-ish. The build should work however. (Just tested and there's nothing broken with it in principle.)

What problem are your seeing when you do npm run build? Did you run npm install before? You'll definitely also need up-to-date versions of node and npm. I just tested with node 16.16 and npm 8.15.

ufuk23 commented 1 year ago

I get some runtime errors trying to build selector project. Is it the right way to use commands 'npm install' and 'npm run build' for this project as well?

Then I try another way and put the line folder to the annotorious project and build it with npm. It seems it works with this way but some issues exist. Now I can create a line but cannot update or move it, it doesn't allow me to select :) I am confused and dont know how to do it

rsimon commented 1 year ago

Yes, exactly.

Output JS should be in the /dist folder.

Hm... I'll test. It might be that the line tool is indeed still unfinished at the moment.

ufuk23 commented 1 year ago

Hi, thank you for your interest 👍 I try it on another PC, (here are the versions npm v9.1.2 node v18.12.1 and the Error) image That seems like a compilation error, but I can build the other annotorious projects similarly.

ufuk23 commented 1 year ago

By the way, when I try to build the "annotorious-openseadragon" project, I think I get some issues because of an outdated code. It tells me the error is about "pointInLine" like below and I realize it doesn't exist in the annotorious-openseadragon project. Then I replace it with the latest "annotorious" source code and it can be build and work now. I mean line tool works when I put it in the tools folder and add some line for ToolRegistry.js file. I think it works using in the selector-pack without changing the "annotorious" project source code.

WARNING in ./src/AnnotationStore.js 117:11-22 export 'pointInLine' (imported as 'pointInLine') was not found in '@recogito/annotorious/src/util/Geom2D' (possible exports: pointInCircle, pointInEllipse, pointInPolygon, polygonArea, polygonInPolygon, svgPathToPolygons)

akshayp0 commented 1 year ago

hi @rsimon is the line tool ready for use ? if not can you help me implement this feature

rsimon commented 1 year ago

The line tool should be available in the latest source. If you build the selector pack yourself (npm install -> npm run build), the tool should be available. Did you try that?

akshayp0 commented 1 year ago

i tried with the latest source but i was not able to draw line using annotorious-openseadragon, i can select line tool & select points for drawing the line but the line doesn't get saved

rsimon commented 1 year ago

Does saving work for other shapes? Per default, annotations that don't have any content (=a comment or a tag) don't get saved. If you want to be able to save "empty" annotations, you need to initialize with the allowEmpty init option. (See here: https://recogito.github.io/annotorious/api-docs/annotorious/#initialization). Does this change anything?

spoorthym1999 commented 1 year ago

I was able to draw the line but the line wasn't selectable , rotatable and extendable as in other shapes.

rsimon commented 1 year ago

Hm, the latest version of AnnotoriousOSD (2.7.10) should support selecting of line shapes. (2.7.9 didn't.) So, at least, the popup box should open. But, yes, it's work in progress, and a 3rd party contribution. I'm not sure if editing functionality has been added yet. (And don't currently have the time to do this myself.)

akshayp0 commented 1 year ago

No, the latest version doesn't support selecting line shape. AnnotoriousOSD throws Unsupported SVG shape type: line . There is no line support in the source code https://github.com/recogito/annotorious-openseadragon/blob/main/src/gigapixel/index.js

rsimon commented 1 year ago

Oh, yes - you are right. It lacks support for line shapes in Gigapixel mode. Should work in normal mode I think. How big is your image?

akshayp0 commented 1 year ago

it is a tiled deep zoomable image

rsimon commented 1 year ago

Do you have the "gigapixelMode: true" option enabled? And, if so, does disabling it change anything?

akshayp0 commented 1 year ago

yes it is set to true, disabling it doesn't change anything (annotations for square, circle work & line still doesn't work)

rsimon commented 1 year ago

Ok, you mean none of the selector pack annotation tools work? Or JUST the line tool? Do you mean you are not able to draw those shapes? Or select them if they already exist? Also, are you enabling the tools programmatically, with your own code? Or are you using the toolbar plugin?

akshayp0 commented 1 year ago

all selector pack annotation tools except line work fine

rsimon commented 1 year ago

Ah - sorry, I misread your last message. Ok, thanks for reporting. As I said, I don't know what's the current state of progress on the line tool. I had assumed that it works in normal (=not gigapixel) mode - which doesn't seem to be the case. I'll put it on the list. But can't promise I'll have the time to look into it soon :-(

akshayp0 commented 1 year ago

I can try to implement this, what do i have to understand in the code to get started ?

akshayp0 commented 1 year ago

hi @rsimon the line tool is working fine with the osd.html example when i disable giga pixel mode, maybe the issue is in our code, we will try to debug it

smithjo commented 1 year ago

The line tool doesn't appear to be working in the regular Annotorious, any ideas where to start troubleshooting? or, any plans to add it as an official plugin? Per @akshayp0's earlier comment, all selector pack annotation tools except line work fine.

ufuk23 commented 1 year ago

The line tool doesn't appear to be working in the regular Annotorious, any ideas where to start troubleshooting? or, any plans to add it as an official plugin? Per @akshayp0's earlier comment, all selector pack annotation tools except line work fine.

@smithjo @akshayp0

It works as I said before. I had to build it with annotorious source code, not openseadragon. Look at my repo and run the index.html https://github.com/ufuk23/annotorious-OpenseaDragon . It uses selector-pack that contains line and the other tools without any issue 👍

Clasen00 commented 1 year ago

@rsimon looks like you just fixed that?

rsimon commented 1 year ago

Yes, I finally published a new release, with the dependencies sorted out properly. Everything should be good to go now, including the line tool.