Giter VIP home page Giter VIP logo

navis-flybrains's People

Contributors

robbie1977 avatar schlegelp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

navis-flybrains's Issues

Issue with saalfeldlab_transforms download

PTAL at error message below:

> flybrains.download_saalfeldlab_transforms()
Downloading Saalfeld lab transforms into /Users/dominik/flybrain-data
---------------------------------------------------------------------------     
KeyError                                  Traceback (most recent call last)
<ipython-input-6-205a66d97e28> in <module>
----> 1 flybrains.download_saalfeldlab_transforms()

~/anaconda3/envs/pyg/lib/python3.8/site-packages/flybrains/download.py in download_saalfeldlab_transforms(data_home, skip_existing)
    233         if skip_existing and os.path.exists(dst):
    234             continue
--> 235         _ = download_from_url(url, dst)
    236 
    237 

~/anaconda3/envs/pyg/lib/python3.8/site-packages/flybrains/download.py in download_from_url(url, dst, resume)
    255 
    256     """
--> 257     file_size = int(requests.head(url, allow_redirects=True).headers["Content-Length"])
    258     if os.path.exists(dst) and resume:
    259         first_byte = os.path.getsize(dst)

~/anaconda3/envs/pyg/lib/python3.8/site-packages/requests/structures.py in __getitem__(self, key)
     52 
     53     def __getitem__(self, key):
---> 54         return self._store[key.lower()][1]
     55 
     56     def __delitem__(self, key):

KeyError: 'content-length'

Better document alternative data_home

  1. Be more explicit in docstring
  2. During download check if custom home is already set as FLYBRAINS_DATA environment variable and warn if not.
  3. Allow setting multiple alternative paths as FLYBRAINS_DATA='path1;path2'
  4. Adjust flybrains.report() to just iterate over available folders.

Re-organize transform download

Unify all downloads into a single function and let users determine which ones they want.

In theory, we could even subclass a OnDemandTransform to manage on-demand downloads of transforms.

Importing flybrains - UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 19631: character maps to <undefined>

Hi,

I am using python 3.7 on Windows 10 and when I import flybrains in ipython, I get the following error:

""""
----> 1 import flybrains

~\Anaconda3\envs\fanc_analysis\lib\site-packages\flybrains_init_.py in
15
16 # Import the template brains
---> 17 from .templates import *
18
19 # Import download functions

~\Anaconda3\envs\fanc_analysis\lib\site-packages\flybrains\templates.py in
42
43 with open(meta_filepath, 'r') as f:
---> 44 template_meta = json.load(f)
45
46 # Index by short label

~\Anaconda3\envs\fanc_analysis\lib\json_init_.py in load(fp, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
291 kwarg; otherwise JSONDecoder is used.
292 """
--> 293 return loads(fp.read(),
294 cls=cls, object_hook=object_hook,
295 parse_float=parse_float, parse_int=parse_int,

~\Anaconda3\envs\fanc_analysis\lib\encodings\cp1252.py in decode(self, input, final)
21 class IncrementalDecoder(codecs.IncrementalDecoder):
22 def decode(self, input, final=False):
---> 23 return codecs.charmap_decode(input,self.errors,decoding_table)[0]
24
25 class StreamWriter(Codec,codecs.StreamWriter):

UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 19631: character maps to

""""
After researching the problem, I discovered that Windows' default encoder is the systems' encoder, unlike MacOS and Linux where the default is utf-8.

I think changing "open(meta_filepath, 'r')" to "open(meta_filepath, 'r', encoding='utf-8')" in templates.py would resolve this issue.

Thank you,

Best,

Brandon Pratt

failed to download h5 bridging transforms generated by the Saalfeld lab

Hi,

When I tried to use the code (flybrains.download_saalfeldlab_transforms()), I have the error below:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-25-205a66d97e28> in <module>
----> 1 flybrains.download_saalfeldlab_transforms()

~\Anaconda3\lib\site-packages\flybrains\download.py in download_saalfeldlab_transforms(data_home, skip_existing)
    233         if skip_existing and os.path.exists(dst):
    234             continue
--> 235         _ = download_from_url(url, dst)
    236 
    237 

~\Anaconda3\lib\site-packages\flybrains\download.py in download_from_url(url, dst, resume)
    255 
    256     """
--> 257     file_size = int(requests.head(url, allow_redirects=True).headers["Content-Length"])
    258     if os.path.exists(dst) and resume:
    259         first_byte = os.path.getsize(dst)

~\Anaconda3\lib\site-packages\requests\structures.py in __getitem__(self, key)
     52 
     53     def __getitem__(self, key):
---> 54         return self._store[key.lower()][1]
     55 
     56     def __delitem__(self, key):

KeyError: 'content-length'
--------------------------------

May I how I can solve the issue?

Thanks a lot!

Best,
Yifan

The registration from hemibrain to FAFB is squished

Hi,
When I try to download a mesh or a skeleton to transform to FAFB like below:

neuron_mesh = neu.fetch_mesh_neuron(1324365879, lod=2, with_synapses=False)
flywireneuron_mesh=navis.xform_brain(neuron_mesh,source='JRCFIB2018Fraw', target='FAFB',verbose=True)

The actual hemibrain mesh looks like below:

Screenshot 2021-03-19 at 14 19 48

However, the transformed stuff looks like squished like below:
Screenshot 2021-03-19 at 14 19 14

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.