https://github.com/bluebrain/morphoviewer
Morphology viewer
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.4%) to scientific vocabulary
Repository
Morphology viewer
Basic Info
- Host: GitHub
- Owner: BlueBrain
- License: apache-2.0
- Language: HTML
- Default Branch: main
- Size: 14.1 MB
Statistics
- Stars: 1
- Watchers: 4
- Forks: 2
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
[!WARNING] The Blue Brain Project concluded in December 2024, so development has ceased under the BlueBrain GitHub organization. Future development will take place at: https://github.com/openbraininstitute/morphoviewer
morphoviewer
Usage
```tsx import React from "react" import { MorphologyCanvas } from "@bbp/morphoviewer"
export default functon MyCellViewer({ swc }: { swc: string }) { const refPainter = React.useRef(new MorphologyCanvas()) React.useEffect( () => { refPainter.current.swc = swc }, [swc] ) return
Utils
colorContrast(background: string, ...colors: string[]): string
Returns the element from colors that has the better contrast
with background.
This can be handy if you need to overlay text on the canvas.
The alpha will be ignored for background, but not for colors.
AtlasPainter
ts
const painter = new AtlasPainter()
MorphologyPainter
ts
const painter = new MorphologyPainter()
painter.colors
Define the colors of the background and the different sections of the cell in CSS style.
ts
painter.colors.soma = "#ef558a"
painter.colors.apicalDendrite = "rgb(32, 88, 150)"
painter.eventColorsChange
This event is dispatched anytime a color is changed by setting any
attribute of painter.colors.
painter.eventMouseWheelWithoutCtrl
The mouse wheel is used to zoom in/out. But if the viewer is embeded in a long page, this behavior can prevent the page from scrolling and frustrate the user.
That's why, if the viewer is not in fullscreen mode, the zoom will only work if the user holds Control key while mouse wheeling. This event is dispatched if an attempt to use the mouse wheel without holding Control is detected in non fullscreen mode.
painter.minRadius
When dendrites are very long and very thin, they can start to disappear. That's why the painter has a minimal radius for them to keep them always visible.
Default value is 1 pixel.
painter.toggleFullscreen()
Toggle the associated canvas in fullscreen mode.
painter.resetCamera()
The camera will target the soma and the zoom will be set as to see the whole cell. It will face the Z axis of the morphology, with the Y axis looking to the top.
painter.pixelScale (readonly)
Returns the space size of a screen pixel. This can be used to compute a scale bar.
See painter.eventPixelScaleChange.
painter.eventPixelScaleChange
This event is dispatched every time painter.pixelScale changes.
painter.computeScalebar(options)
Input:
ts
options: Partial<{
preferedSizeInPixels: number
units: Record<string, number>
values: number[]
}>
preferedSizeInPixels: The scalebar's size we target. Depending on the constaints, the scalebar actual size can be different. Default to 240 pixels.units: The units we are allowd to use and their scale against the default space unit. Default to{ nm: 1e-3, µm: 1, mm: 1e3, m: 1e6, km: 1e9 }.values: The rounded values we are allowed to use. This will prevent the scalebar from displaying something like27.1542 mm. Default to[1, 2, 5, 10, 20, 25, 50, 75, 100, 200, 300, 400, 500, 600, 700, 800, 900].
Output:
ts
{
sizeInPixel: number
value: number
unit: string
}
Funding & Acknowledgment
The development of this software was supported by funding to the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss government's ETH Board of the Swiss Federal Institutes of Technology.
Copyright (c) 2024 Blue Brain Project/EPFL
sizeInPixel: Actual size of the scalebar computed for the resultingvalueandunit.value: Numerical value to display.unit: Unit of expression ofvalue.
painter.colorBy
A string enum that defines how the cell must be colored.
"section": Usepainter.colorsto color the soma, axon ans dendrites."distance": Use a gradient (green, yello, red) to show the distance from the soma. Red is the farest point from the soma.
painter.radiusType
A float between 0 and 1 to know how to interpret radius information from the SWC file.
0: Variable radius (default).1: Constant radius.
In real life, dendrites tend to be thicker near to the soma and become thiner at the end. Trees in the woods behave like this too.
Setting 0 will give you the real radius. And the 1 will set the same radius everywhere (a constant one that is the average of all the values).
If needed, to temper the effect, you can set any value between 0 and 1 to get an interpolation.
painter.canvas
The canvas onto display the 3D cell.
painter.swc
The string content of a SWC file that describes the tree structure of the current cell.
Funding & Acknowledgment
The development of this software was supported by funding to the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss government's ETH Board of the Swiss Federal Institutes of Technology.
Copyright (c) 2024 Blue Brain Project/EPFL
Owner
- Name: The Blue Brain Project
- Login: BlueBrain
- Kind: organization
- Email: bbp.opensource@epfl.ch
- Location: Geneva, Switzerland
- Website: https://portal.bluebrain.epfl.ch/
- Repositories: 226
- Profile: https://github.com/BlueBrain
Open Source Software produced and used by the Blue Brain Project
GitHub Events
Total
- Watch event: 1
- Push event: 1
- Fork event: 2
Last Year
- Watch event: 1
- Push event: 1
- Fork event: 2
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- npm 396 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 49
- Total maintainers: 2
npmjs.org: @bbp/morphoviewer
Class to display SWC morphology files in 3D
- Homepage: https://github.com/BlueBrain/morphoviewer#readme
- License: Apache-2.0
-
Latest release: 0.21.1
published almost 2 years ago
Rankings
Maintainers (2)
Dependencies
- actions/checkout v3 composite
- actions/setup-node v3 composite
- 966 dependencies
- @babel/preset-typescript ^7.24.1 development
- @types/jest ^29.5.12 development
- @types/react ^18.3.1 development
- @types/react-dom ^18.3.0 development
- @types/react-test-renderer ^18.3.0 development
- @typescript-eslint/eslint-plugin ^7.8.0 development
- @typescript-eslint/parser ^7.8.0 development
- babel-eslint ^10.1.0 development
- babel-jest ^29.7.0 development
- build-react-routes ^0.8.0 development
- clean-webpack-plugin ^4.0.0 development
- copy-webpack-plugin ^12.0.2 development
- css-loader ^6.11.0 development
- eslint ^8.57.0 development
- eslint-config-prettier ^9.1.0 development
- eslint-plugin-import ^2.29.1 development
- eslint-plugin-jsdoc ^48.2.3 development
- eslint-plugin-jsx-a11y ^6.8.0 development
- eslint-plugin-no-null ^1.0.2 development
- eslint-plugin-prefer-arrow ^1.2.3 development
- eslint-plugin-react ^7.34.1 development
- eslint-plugin-react-hooks ^4.6.2 development
- eslint-plugin-unicorn ^52.0.0 development
- file-loader ^6.2.0 development
- gh-pages ^6.1.1 development
- html-webpack-plugin ^5.6.0 development
- htmlparser2 ^9.1.0 development
- identity-obj-proxy ^3.0.0 development
- jest ^29.7.0 development
- jest-environment-jsdom ^29.7.0 development
- jest-websocket-mock ^2.5.0 development
- mini-css-extract-plugin ^2.9.0 development
- mock-socket ^9.3.1 development
- prettier 3.2.5 development
- raw-loader ^4.0.2 development
- react-test-renderer ^18.3.1 development
- style-loader ^3.3.4 development
- ts-jest ^29.1.2 development
- ts-loader ^9.5.1 development
- ts-node ^10.9.2 development
- typedoc ^0.25.13 development
- typescript ^5.4.5 development
- url-loader ^4.1.1 development
- webpack ^5.91.0 development
- webpack-cli ^5.1.4 development
- webpack-dev-server ^5.0.4 development
- webpack-manifest-plugin ^5.0.0 development
- @bbp/morphoviewer file:../lib
- @radix-ui/react-slider ^1.1.2
- @radix-ui/react-switch ^1.0.3
- jotai ^2.7.0
- react ^18.2.0
- react-dom ^18.2.0
- 660 dependencies
- @types/jest ^29.5.12 development
- @typescript-eslint/eslint-plugin ^7.8.0 development
- @typescript-eslint/parser ^7.8.0 development
- babel-jest ^29.7.0 development
- build-typescript-library ^0.7.3 development
- eslint ^8.56.0 development
- eslint-config-prettier ^9.1.0 development
- eslint-plugin-import ^2.29.1 development
- eslint-plugin-jsdoc ^48.2.3 development
- eslint-plugin-jsx-a11y ^6.8.0 development
- eslint-plugin-no-null ^1.0.2 development
- eslint-plugin-prefer-arrow ^1.2.3 development
- eslint-plugin-react ^7.34.1 development
- eslint-plugin-react-hooks ^4.6.2 development
- eslint-plugin-unicorn ^52.0.0 development
- jest ^29.7.0 development
- jest-environment-jsdom ^29.7.0 development
- ts-jest ^29.1.2 development
- ts-loader ^9.5.1 development
- ts-patch ^3.1.2 development
- typedoc ^0.25.13 development
- typescript ^5.4.5 development
- typescript-eslint ^7.8.0 development
- typescript-transform-paths ^3.4.7 development
- webpack ^5.91.0 development
- webpack-cli ^5.1.4 development
- fflate ^0.8.2
- @mapbox/node-pre-gyp 1.0.11 development
- abbrev 1.1.1 development
- agent-base 6.0.2 development
- ansi-regex 5.0.1 development
- aproba 2.0.0 development
- are-we-there-yet 2.0.0 development
- balanced-match 1.0.2 development
- brace-expansion 1.1.11 development
- canvas 2.11.2 development
- chownr 2.0.0 development
- color-name 1.1.4 development
- color-support 1.1.3 development
- concat-map 0.0.1 development
- console-control-strings 1.1.0 development
- cssfontparser 1.2.1 development
- debug 4.3.4 development
- decompress-response 4.2.1 development
- delegates 1.0.0 development
- detect-libc 2.0.2 development
- emoji-regex 8.0.0 development
- fs-minipass 2.1.0 development
- fs.realpath 1.0.0 development
- gauge 3.0.2 development
- glob 7.2.3 development
- has-unicode 2.0.1 development
- https-proxy-agent 5.0.1 development
- inflight 1.0.6 development
- inherits 2.0.4 development
- is-fullwidth-code-point 3.0.0 development
- jest-canvas-mock 2.5.2 development
- lru-cache 6.0.0 development
- make-dir 3.1.0 development
- mimic-response 2.1.0 development
- minimatch 3.1.2 development
- minipass 3.3.6 development
- minipass 5.0.0 development
- minizlib 2.1.2 development
- mkdirp 1.0.4 development
- moo-color 1.0.3 development
- ms 2.1.2 development
- nan 2.18.0 development
- node-fetch 2.7.0 development
- nopt 5.0.0 development
- npmlog 5.0.1 development
- object-assign 4.1.1 development
- once 1.4.0 development
- path-is-absolute 1.0.1 development
- readable-stream 3.6.2 development
- rimraf 3.0.2 development
- safe-buffer 5.2.1 development
- semver 6.3.1 development
- semver 7.6.0 development
- set-blocking 2.0.0 development
- signal-exit 3.0.7 development
- simple-concat 1.0.1 development
- simple-get 3.1.1 development
- string-width 4.2.3 development
- string_decoder 1.3.0 development
- strip-ansi 6.0.1 development
- tar 6.2.0 development
- tr46 0.0.3 development
- util-deprecate 1.0.2 development
- webidl-conversions 3.0.1 development
- whatwg-url 5.0.0 development
- wide-align 1.1.5 development
- wrappy 1.0.2 development
- yallist 4.0.0 development
- canvas ^2.11.2 development
- jest-canvas-mock ^2.5.2 development