Skip to content

Commit

Permalink
Merge pull request #163 from navis-org/ftp
Browse files Browse the repository at this point in the history
Read files from FTP server
  • Loading branch information
schlegelp committed Sep 18, 2024
2 parents 8864623 + b187de2 commit a2bc5f3
Show file tree
Hide file tree
Showing 8 changed files with 536 additions and 184 deletions.
13 changes: 8 additions & 5 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ more consistent and easier to use.
- New function: [`navis.graph.skeleton_adjacency_matrix`][] computes the node adjacency for skeletons
- New function: [`navis.graph.simplify_graph`][] simplifies skeleton graphs to only root, branch and leaf nodes while preserving branch length (i.e. weights)
- New [`NeuronList`][navis.NeuronList] method: [`get_neuron_attributes`][navis.NeuronList.get_neuron_attributes] is analagous to `dict.get`
- [`NeuronLists`][navis.NeuronList] now implemented the `|` (`__or__`) operator which can be used to get the union of two [`NeuronLists`][navis.NeuronList]
- [`NeuronLists`][navis.NeuronList] now implement the `|` (`__or__`) operator which can be used to get the union of two [`NeuronLists`][navis.NeuronList]
- [`navis.Volume`][] now have an (optional) `.units` property similar to neurons

##### Improvements
- Plotting:
- [`navis.plot3d`][]:
- `legendgroup` parameter (plotly backend) now also sets the legend group's title
- new parameters for the plotly backend:
- `legend` (default `True`): determines whether legends is shown
- `legend_orientation` (default `v`): determines whether legend is aranged vertically (`v`) or horizontally (`h`)
- `linestyle` (default `-`): determines line style for skeletons
- `legend` (default `True`): determines whether legends is shown
- `legend_orientation` (default `v`): determines whether legend is aranged vertically (`v`) or horizontally (`h`)
- `linestyle` (default `-`): determines line style for skeletons
- default for `radius` is now `"auto"`
- [`navis.plot2d`][]:
- the `view` parameter now also works with `methods` `3d` and `3d_complex`
Expand All @@ -55,13 +55,16 @@ more consistent and easier to use.
- new parameters for methods `3d` and `3d_complex`: `mesh_shade=False` and `non_view_axes3d`
- the `scalebar` parameter can now be a dictionary used to style (color, width, etc) the scalebar
- the `connectors` parameter can now be used to show specific connector types (e.g. `connectors="pre"`)
- I/O:
- `read_*` functions are now able to read from FTP servers (`ftp://...`)
- the `limit` parameter used in many `read_*` functions can now also be a regex pattern or a `slice`
- General improvements to docs and tutorials

##### Fixes
- Memory usage of `Neuron/Lists` is now correctly re-calculated when the neuron is modified
- Various fixes and improvements for the MICrONS interface (`navis.interfaces.microns`)
- [`navis.graph.node_label_sorting`][] now correctly prioritizes total branch length
- [`navis.TreeNeuron.simple][] now correctly drops soma nodes if they aren't root, branch or leaf points themselves
- [`navis.TreeNeuron.simple`][] now correctly drops soma nodes if they aren't root, branch or leaf points themselves

## Version `1.7.0` { data-toc-label="1.7.0" }
_Date: 25/07/24_
Expand Down
19 changes: 17 additions & 2 deletions docs/examples/0_io/plot_00_io_skeletons.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,26 @@
s

# %%
# You can even use URLs directly:
# You can even use URLs or FTP servers directly:

# %%

# From URL:
s = navis.read_swc('https://v2.virtualflybrain.org/data/VFB/i/jrch/jup2/VFB_00101567/volume.swc')

# %%

# From an FTP folder:
nl = navis.read_swc('ftp://download.brainlib.org:8811/biccn/zeng/pseq/morph/200526/', limit=3)


# !!! tip
# [`read_swc`][navis.read_swc] is super flexible and can handle a variety of inputs (file names, folders, archives, URLs, etc.).
# Importantly, it also let you customize which/how neurons are loaded. For example:
# - the `limit` parameter can also be used to load only files matching a given pattern
# - the `fmt` parameter lets you specify how to parse filenames into neuron names and ids
# Many of the other `navis.read_*` functions share these features!

# %%
# ## To SWC files
#
Expand Down Expand Up @@ -125,7 +140,7 @@
#
# Among other formats, neuroglancer supports a "precomputed" format for skeletons
# (see specs [here](https://github.com/google/neuroglancer/blob/master/src/neuroglancer/datasource/precomputed/skeletons.md).
# This binary format is more compact than uncompressed SWC files but probably is not used outside of neuroglancer afaik.
# This binary format is more compact than uncompressed SWC files but is not used outside of neuroglancer as far as I know.
# That said: {{ navis }} lets you read and write skeletons from/to precomputed format using [`navis.read_precomputed`][] and
# [`navis.write_precomputed`][]. Note that these functions work on both precomputed skeletons and meshes.
#
Expand Down
Loading

0 comments on commit a2bc5f3

Please sign in to comment.