New player script for eyewire 2/neuroglancer:

Hello y’all.

With the help of KK and chatgpt we created 3 scripts to help (us) automate some stuff in EW2 gsheet.

ok script one, built by ‘me’ (chatgpt):

you’ll need tampermonkey, create a new userscript and paste the above any existing code.

This will create a copy completion button in neuroglancer


It is draggable and movable by holding down the left mouse button and in theory it should also remember where you place it between different links.
This will copy to your clipboard the current date, segment ID and that ‘share’ json link.

DISCLAIMER: I have not tried it with multiple segment IDs as we only need 1 for the Final SegID, so I don’t know how it’ll behave if there’s more than 1 segment ID to copy.

So having clicked that button head over to the gsheet to where you type/copy paste the date and paste, and all three entries will paste, so no need to paste date, final segID and link, leaving you with only having to type/paste your name and select the status (complete, complete(cut-off) etc).

2nd script by KK:

this will export and/or import settings such as opacity for 2D/3D, in render, as well as the gear cog:



So anything from 3D opacity to whether you want to see the default annotations (dataset bounding box) or not.

How to go about it exporting the settings:

Open a neurog/ew2 link:
delete any and all segments AND annotations (such as soma coords and/or true ends etc)


then adjust the settings as you want them to be.
then right mouse click on the grey bar up top like this:

select export settings.
and you’re done. You can close that link and open any other, if you right click mouse on that bar and select import it’ll import all of the settings without you having to re-edit them every single time.

3rd script by me/chatgpt:

this automates the settings import so that you don’t have to import them every single time, you just click any of the starting links from the gsheet, It’ll wait a variable amount of time for the page to stabilize/finish loading then auto-import the settings. it’s variable because it was giving me errors if I had it too low (below 3s) and it didn’t always have to wait 10-15s either, so now it waits for the page to finish loading/stabilize/serialize, then it auto-imports with a corresponding msg in the console that it has done so.

If you don’t adjust any setting(s) with every new link then you can ignore scripts 2 and 3.

2 Likes

Small correction to the first script, so the urls pasted into the sheet are in the correct format:

2 Likes

And a correction for the correction, that fixes two small, but important issues:

2 Likes

I made a small change to the auto import script (Script #2) so that it does not re-import settings when a user reloads (F5) the page. Now it should only do it when the link opens the first time.

1 Like

small update that fixes some bugs in this script (export/import settings).

1 Like

Also, if someone’s working on Windows, you can use the scripting program called AutoHotKey 2.0.
It allows to automate almost everything in every possible way. From simple things, like assigning keys to other keys to simulate mouse movements and clicks, to read the state of the screen, to even run more advanced pieces of code.

Below is an example of a code, I’m currently using to slightly automate claiming cells in the GSheet:

#Requires AutoHotkey v2.0
#HotIf WinActive("Focused BCs")

pressCount := 0
lastPress := 0
maxDelay := 300  ; ms

*Shift::
{
  global pressCount, lastPress, maxDelay

  now := A_TickCount

  if (now - lastPress <= maxDelay)
    pressCount++
  else
    pressCount := 1

  lastPress := now

  if (pressCount = 3)
  {
    pressCount := 0

    ; Wait until all Shift keys are released.
    KeyWait("Shift")

    ; Reset timing so a later Shift starts a new sequence.
    lastPress := 0

    SendText("KrzysztofKruk")
    Send("{Tab}")
    SendText("WIP")
    Send("{Tab}")
    Send("+{Tab}")
  }
}

#HotIf

What it does is, if you’re currently in any window, that has “Focused BCs” in this name (it doesn’t even have to be a browser tab), then if you press the Shift key (left or right) three times in a row in a quick succession (max 300ms between presses) then it’ll simulate typing “KrzysztofKruk” in that window in the place, where the writing cursor is; then it simulates pressing the Tab button (to jump to the next cell in the sheet), types “WIP”, presses the Tab again to save the changes and the presses Shift+Tab to go back to the cell with the Status.

All you have to do is to install the AutoHotKey software, copy the script above, save it to any file with an .ahk extension (for example “auto-claim.ahk”) and then double click on the file. It will work until you turn off/restart your computer or close the script manually.

I’ve also modified a bit @Nseraf’s “Neuroglancer Copy Completion Row” script, so now it prepends, what’s already copied there with “Complete (cut off)[tab]”. Thanks to those two things (the AHK script and the modification) I need one keyboard shortcut to start a cell and one to finish it, nothing else.

Here’s the modified script: // ==UserScript==// @name Neuroglancer Copy Completion Row// @namesp - Pastebin.com

1 Like

i am not getting the last modified version of neuroglancer copy completion script to work, looks like it is some trouble pasting in it column j. is it possible to change it to paste it in column I instead, as it is a script we have to paste into tampermonkey ourself, it should be possible to change the username in one of the code lines from my understanding?

2 Likes

And, again, I didn’t see your message yesterday. Otherwise, I’d do it back then. Anyway, here’s a version of the script, that prepares the data in a way, that it can be pasted in the column I, so it includes the username.

The version below is already configured for your username @annkri. If someone wants to change it, just go to the script, line 14, and change the USERNAME value accordingly.

Copy Completion Row, version with username (annkri by default)

2 Likes

thank you so much, works great

2 Likes