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

Examples of using mulitres mesh? #142

Open
eddyod opened this issue Feb 9, 2023 · 6 comments
Open

Examples of using mulitres mesh? #142

eddyod opened this issue Feb 9, 2023 · 6 comments
Labels

Comments

@eddyod
Copy link

eddyod commented Feb 9, 2023

Is there any example code for using the multi resolution mesh creation with scripting?

@william-silversmith
Copy link
Contributor

Hi Edward,

I would just follow along with the code in the CLI module. You need to do the initial mesh forging tasks as "sharded" then you need to call sharded mesh merge.

Let me know if you need more help!

@eddyod
Copy link
Author

eddyod commented Feb 9, 2023

Something like this?

tasks = tc.create_meshing_tasks(layer_path, mip=0, sharded=True)
tq.insert(tasks)
tq.execute()

tasks = tc.create_sharded_multires_mesh_tasks(layer_path, num_lod=2)
tq.insert(tasks)    
tq.execute()

@william-silversmith
Copy link
Contributor

That looks like it works!

@eddyod
Copy link
Author

eddyod commented Feb 10, 2023

Must we use the sharded=True parameter? When I use this, I get:
python3.10/site-packages/cloudvolume/lib.py:297: RuntimeWarning: overflow encountered in scalar multiply
return reduce(operator.mul, self)

And then this file is not created: mesh_mip_0_err_40/0.shard

I'm using int8 as the data type by the way.

Thanks!

@william-silversmith
Copy link
Contributor

That's a pretty odd error. That makes me think the bounding box is being manipulated incorrectly for some reason. What are the dimensions of your dataset?

If you're working with a reasonably small dataset, then (I forgot this existed for a sec) you can use the unsharded multi-res. Omit the sharded flag and use this function, create_unsharded_multires_mesh_tasks, to create the merging tasks.

https://github.com/seung-lab/igneous/blob/master/igneous/task_creation/mesh.py#L449-L513

@eddyod
Copy link
Author

eddyod commented Feb 10, 2023

Thanks, I'm having better luck with the unsharded process and it appears to be working!

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

No branches or pull requests

2 participants