Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xml parsing issue with load_kzip_seg #30

Open
smcelroy97 opened this issue Jun 30, 2023 · 1 comment
Open

xml parsing issue with load_kzip_seg #30

smcelroy97 opened this issue Jun 30, 2023 · 1 comment

Comments

@smcelroy97
Copy link

I get an error xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 17, column 128
Which is an issue in the format of the xml file when parsed. I am trying to import a k.zip file that was exported from Knossos, but this import function as well as skeleton().fromNML give the same error (when attempting to use either k.zip or .nml). I used the example from this repo, so is this an issue that arises from the export?

@my-tien
Copy link
Member

my-tien commented Jul 2, 2023

I assume you are referring to the same data you copy-pasted us over here.

In the pasted data we can see the dataset config path: https://agglomeration.ariadne.ai/dataset/2021-12-24.pyk.conf
We can download this file and look at its contents to find out that the segmentation you are looking at is streamed from a server.
When you save to .k.zip, you actually only save the changes you make to this streamed data, but you cannot simply save the entire segmentation, because it is far too large to fit into memory.

You can however load the streaming dataset directly with knossos_utlis:

dataset = KnossosDataset("/path/to/downloaded/2021-12-24.pyk.conf")

And then load the chunks you are interested in one at a time:

dataset.load_seg(
    offset=dataset.boundary // 2,
    size=(512,512,512),
    mag=1
)

So e.g. to analyze the segmentation of one cell, you would have start at one chunk containing the cell’s subobject ID and then iteratively explore adjacent chunks for occurences of the same ID.

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

No branches or pull requests

2 participants