Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
leversc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
leversc
Commits
23907bf0
Commit
23907bf0
authored
Sep 28, 2021
by
Mark Winter
Browse files
Options
Downloads
Patches
Plain Diff
Added simple python usage example using scikit-image
parent
ab1f761a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Python/test_cells3d.py
+19
-0
19 additions, 0 deletions
src/Python/test_cells3d.py
with
19 additions
and
0 deletions
src/Python/test_cells3d.py
0 → 100644
+
19
−
0
View file @
23907bf0
"""
This small example loads the cells3d dataset from scikit-image into LEVERSC for visualization
"""
import
numpy
as
np
from
skimage.data
import
cells3d
import
leversc
# Load the cells3d dataset
cells
=
cells3d
()
# Rearrange the dimensions to be in expected order (c,z,y,x) for row-major numpy array
cellsC
=
np
.
copy
(
np
.
transpose
(
cells
,[
1
,
0
,
2
,
3
]),
order
=
'
C
'
)
# Set up the image metadata: such as physical voxel size, and channel names
# See: https://scikit-image.org/docs/0.18.x/api/skimage.data.html?highlight=cells3d#skimage.data.cells3d
imD
=
{
"
PixelPhysicalSize
"
:
[
0.29
,
0.26
,
0.26
],
"
ChannelNames
"
:
[
"
Membrane
"
,
"
Nuclei
"
]}
# Send data to the LEVERSC viewer
lsc
=
leversc
.
leversc
(
im
=
cellsC
,
imD
=
imD
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment