Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Need help using the line tool #20

Open
ufuk23 opened this issue Nov 24, 2022 · 25 comments
Open

Need help using the line tool #20

ufuk23 opened this issue Nov 24, 2022 · 25 comments

Comments

@ufuk23
Copy link

ufuk23 commented Nov 24, 2022

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?

@ufuk23 ufuk23 changed the title Line tool is not working Need help using the line tool Nov 24, 2022
@rsimon
Copy link
Member

rsimon commented Nov 24, 2022

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
Copy link
Author

ufuk23 commented Nov 24, 2022

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
Copy link
Member

rsimon commented Nov 24, 2022

Yes, exactly.

  • Clone the repository
  • npm install
  • npm run build

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
Copy link
Author

ufuk23 commented Nov 25, 2022

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.

  • When do you plan to release the new version of the selector-pack that includes the line tool?
  • Would you mind sending me the latest annotorious-selector-pack.min.js file that includes the line tool you have?

@ufuk23
Copy link
Author

ufuk23 commented Nov 25, 2022

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
Copy link

akshayp0 commented Mar 7, 2023

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

@rsimon
Copy link
Member

rsimon commented Mar 7, 2023

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
Copy link

akshayp0 commented Mar 7, 2023

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
Copy link
Member

rsimon commented Mar 7, 2023

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
Copy link

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

@rsimon
Copy link
Member

rsimon commented Mar 7, 2023

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
Copy link

akshayp0 commented Mar 7, 2023

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
Copy link
Member

rsimon commented Mar 7, 2023

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
Copy link

akshayp0 commented Mar 8, 2023

it is a tiled deep zoomable image

@rsimon
Copy link
Member

rsimon commented Mar 8, 2023

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

@akshayp0
Copy link

akshayp0 commented Mar 8, 2023

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

@rsimon
Copy link
Member

rsimon commented Mar 8, 2023

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
Copy link

akshayp0 commented Mar 8, 2023

all selector pack annotation tools except line work fine

@rsimon
Copy link
Member

rsimon commented Mar 8, 2023

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
Copy link

akshayp0 commented Mar 9, 2023

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

@akshayp0
Copy link

akshayp0 commented Mar 9, 2023

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
Copy link

smithjo commented Mar 21, 2023

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
Copy link
Author

ufuk23 commented May 4, 2023

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
Copy link

Clasen00 commented Nov 9, 2023

@rsimon looks like you just fixed that?

@rsimon
Copy link
Member

rsimon commented Nov 10, 2023

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants