[addon] Splitter

v 0.1


The purpose of this addon is quite simple - it splits large lists of IDs into more manageable portions.

When you install it, you should see a new button in the Dock:

When you click that button, this popup should show:

Let’s start from the top.
The first field is a textarea, where you can paste your whole list of IDs. The IDs can be separated by comma, comma and space or new line or any combinations of these. The number of the IDs is virtually limitless. I’ve tested it with almost 300k segments and it worked correctly (I had to wait a few seconds between pasting and seeing them pasted, and then additional few seconds after pressing the Add button and the browser being responsive).
Then we have the Add button. When you press it, all the IDs will be stored into browser’s IndexedDB database. They will disappear from the textarea and the counter near the bottom (“Number of stored”) should show the number of IDs added.
If you want to add more IDs, just paste them again into the textarea and press the Add button again. The old ones won’t be deleted and the list will be extended. Be a little careful, because the script doesn’t check for duplicates or even if the numbers are correct.
Under the Add button is a button called “Get stored” which copies all the stored IDs into clipboard in a comma-separated format.
The button under it is “Clear stored” which just erases all the stored IDs.
In the next column we start with a field called “Batch size”. Here you can set, how many cells/segments should be displayed with each pressing of the Next button (description lower). Default is 20, because that number worked best for me, when I was testing it during last several days, but, of course, you can set it to whatever value you want. Even 1 is ok, if you just want to see the cells one-by-one.
Then we have two buttons - “Get saved” and “Clear saved”, which work analogously to the “Get stored” and “Clear stored” ones, but for saved cells (more about them in a second).
The Close button closes the dialog. You can also click anywhere outside the dialog to close it.
When you’re setting the size of a single batch, the size is set immediately after you’ve typed the correct value, so you don’t have to confirm or save it in any way.

The other thing, that you’ve probably already noticed after installing the script, it this rather large combo of two violet buttons - “Next” and “Save left”:

They are this big, because I found, I’m using them quite often and wanted to hit them easily each time.
Let start with positioning them - you can right-click and drag them whenever you want and they’ll stay there. I usually put them over the right panel, over the “3D Visualization” section, because I don’t use these controls much.
Whenever you click the “Next” button, all the previously visible cells will be removed and the first n cells from your stored list will be displayed. Where n is the batch size you’ve set earlier. The stored list will be shorted by these first n IDs, so, if you want to keep the list complete, save if somewhere else, e.g. in a text file.
There are two counters on the button - the bigger one (15 on the image) shows, how many times you have clicked the Next button since last refresh of the page. This info is useful, because even if you remove a cell from the FW, it internally stores such cell in its cache. That causes, that with time, you have less and less RAM and the browser works slower. With batch size of 20 I usually refresh the browser around (20) clicks. I’ve tried to clear that internal cache, but to no avail, so we’ll have to deal with the refreshing every once in a while.
The other, smaller counter at the bottom of the button shows, how many more batches there are still stored. When you change the batch size, this number, of course, changes, but only after a refresh or when you click the Next button first time after the changing.

The “Save left” button saves all the visible (or hidden, but still in FW) cells to the database. It also removes the saved cells from FW. Whenever you press the button, the saved list will be extended. To get the saved cells, you can press the “Get saved” button mentioned before. To clear them, the “Clear saved” button can be used.
This button works not only for the cells displayed in batches but for any other cells currently added to FW, so you can work with cells in any way and if you decide, that you want to save the cells you currently have, just press the button (remember, that they all land into a single list).

There are two modes, I like to use this addon in:

  1. When I have a large list, that contains relatively small number of cells, I’m looking for. In such case, I load each batch, search for my cells and add them to a list using the Classifier addon. When I’m done, I have all my cells in one of the Classifier’s lists.
  2. When I have a large list, that contains almost all my cells and some small number of others. In this case I also load each batch, then remove all the unnecessary cells with the standard double-click and the press the “Save left” button and load the next batch. When I’m done, I have all my cells in the saved list.

This is great KK! Very handy when we’re sorting through these candidate lists :slight_smile:

1 Like

Yep, that’s what I’m using it for. Finally, I don’t have to have opened two text files and copy and paste the segments in batches between a file and the FW and then back again. It was driving me mad and that’s why I wrote this one.

1 Like

Using this now, thank you! This is great for the lists that have been pulled. So far no issues and it’s making ID’ing a breeze.


v 0.2

Added a “refresh every” functionality:


With this new addition, the FW site will refresh every n clicks of the “Next” button. It’s purpose is to solve the issue with the size of the Neuroglancer cache growing with each displayed batch of cells.
Before this update you had to refresh the page every n clicks anyway, or your RAM usage would be too much and the page would became sluggish. Now the page will refresh itself and click the “Next” button automatically after the refresh. From the user’s point of view, it will just be a little longer loading of a batch every n times. From my experience, it makes the process much smoother.
By default, I’ve set the value to 100, so it wouldn’t refresh the page by suprise for any unaware user, but I’d suggest, refreshing every, let’s say, 10 clicks makes things go smoothest (at least, on my PC).

1 Like

Will the splitter always split the IDs of a list the same way every time if it’s the same list?

1 Like

Yes, it should.

1 Like

Ok cool thanks :slight_smile:

1 Like