Closed lankiszhang closed 3 months ago
I don't have a Windows machine but I tried your code with Python 3.11.8 and navis 1.6.0 and it works just fine. I don't think this is an issue with navis
but rather a weird interaction between multiprocessing on Windows. See this StackOverflow thread and let me know if that solves your problem.
As additional reference: by default navis.read_swc
will also use multi-processing if there are many files to load (I think the threshold is 200). That explains why it's crashing too.
@schlegelp Thank you for your help! I did see the thread before, but as a rookie I thought the if __name__ == "__main__"
has to be put in the code of navis.mesh() to take effect. Which actually not the case, the following code works:
import navis
path_swc_JRC2018U = "E:/Jiajun/python_project/navis/flywire_swc_JRC2018U"
path_obj_JRC2018U = "E:/Jiajun/python_project/navis/flywire_obj_JRC2018U"
if __name__ == "__main__":
nl_reg = navis.read_swc(path_swc_JRC2018U)
m_reg = navis.mesh(nl_reg,parallel=True,n_cores=32)
navis.write_mesh(m_reg, path_obj_JRC2018U,"obj")
Description navis.mesh(nl) throw out a runtime error.
To Reproduce
Example Files: flywire_swc_JRC2018U.zip
Expected behavior navis.mesh() is expected to convert all neurons in the neuronlist to mesh.
Your system
Additional context navis.read_swc(nl) throw the same Runtime error when nl has too many neurons.