A suite of useful tools based on 3D interactivity in napari

Overview

napari-threedee

License PyPI Python Version tests codecov napari hub

A suite of useful tools based on 3D interactivity in napari


This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.

Installation

You can install napari-threedee via pip:

pip install napari-threedee

To install latest development version :

pip install git+https://github.com/alisterburt/napari-threedee.git

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the BSD-3 license, "napari-threedee" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

Comments
  • [WIP] manipulator refactor

    [WIP] manipulator refactor

    Haven't been committing and want to keep track of where I'm at with this

    • [x] separate models for manipulator/translator and associated visual data
    • [x] add tests construction of models
    • [x] produce correct visual data from individual models
    • [x] produce correct visual data from manipulator itself
    • [x] hook up to Kevin's vispy visual
    • [x] highlighting logic

    Also todo but maybe in separate PRs:

    • [ ] hook up existing manipulators
    • [ ] add docs
    opened by alisterburt 7
  • Make napari-threedee available on conda-forge

    Make napari-threedee available on conda-forge

    Hi all,

    I would love to ship napari-threedee together with of devbio-napari. This should just work, the only thing is: It would be cool if it was available via conda-forge.

    See also:

    • [ ] https://github.com/haesleinhuepf/devbio-napari/issues/29
    opened by haesleinhuepf 6
  • nd-ify the plane point annotator

    nd-ify the plane point annotator

    This PR makes our plane point annotator compatible with nD data

    The only restriction at the minute is that the points and image layers must have the same dimensionality

    opened by alisterburt 5
  • [WIP] add visualisation of click-plane for debugging

    [WIP] add visualisation of click-plane for debugging

    this is a branch which adds visualisation of

    • the centroid of the clicked triangle
    • the click point
    • the view direction (as another point, further along the view direction)

    This should allow us to debug the 'furthest away rotator is sometimes selected on click' bug

    I'm struggling to figure out what exactly is wrong with what we're doing - switching to the maximum distance is clearly wrong and the signed distances appear to be calculated correctly... will keep investigating

    opened by alisterburt 5
  • Add napari IO plugin with working implementations for spheres and splines

    Add napari IO plugin with working implementations for spheres and splines

    This PR adds a simple reader/writer contribution pairing which will read/write .n3d files, zarr arrays matching annotation specifications

    should add a test but it's the end of the day and getting zarr to work was annoying, will do tomorrow before merge

    slight annoyance: you can't open directories from the standard open file menu in the napari gui, you have to specifically open a folder -> because zarr arrays are folders this is also true for .n3d files

    opened by alisterburt 3
  • add specification docs, spline layer spec and functions for spline io

    add specification docs, spline layer spec and functions for spline io

    Hey @kevinyamauchi - I think this is good to go, let me know what you think of the outline for the spec in the docs and if you think anything is missing

    Once this is in I will implement a single io plugin entry point in a separate plugin rather than implementing one for every annotator

    opened by alisterburt 3
  • add sphere annotator

    add sphere annotator

    progress on sphere annotator and todo:

    • [x] ability to generate sphere data from points with radius in features
    • [x] ability to configure radii interactively
    • [x] ability to configure position interactively

    image

    opened by alisterburt 3
  • Hook up new manipulator infrastructure to existing manipulator implementation base class

    Hook up new manipulator infrastructure to existing manipulator implementation base class

    This WIP PR is another absolute monster: forgive me 🙏🏼

    This PR takes the improved manipulator and related component models from #63 and hooks everything up to our BaseManipulator class in a way which I think makes it nice and easy to implement desired behaviour in specific Manipulator implementations.

    I have so far only reimplemented the RenderPlaneManipulator, widget autogeneration is working as before

    https://user-images.githubusercontent.com/7307488/197223256-978fdd9c-6c09-48e6-ad75-1ca411495a1a.mp4

    the implementation for this is...

    class RenderPlaneManipulator(BaseManipulator):
        """A manipulator for moving and orienting an image layer rendering plane."""
    
        def __init__(self, viewer, layer=None):
            super().__init__(viewer, layer, rotator_axes='yz', translator_axes='z')
    
        def set_layers(self, layers: napari.layers.Image):
            super().set_layers(layers)
    
        def _initialize_transform(self):
            self.origin = np.array(self.layer.plane.position)
            plane_normal = self.layer.plane.normal
            self.rotation_matrix = rotation_matrix_from_vectors_3d([1, 0, 0], plane_normal)
    
        def _while_dragging_translator(self):
            self.layer.plane.position = self.origin
    
        def _while_dragging_rotator(self):
            self.layer.plane.normal = self.z_vector
    

    something else worth highlighting is how simple this new separation made the mouse callback on the BaseManipulator class

        def _mouse_callback(self, layer, event):
            """Update the manipulated object via subclass implementations of drag/rotate behaviour."""
            yield
            if self._viewer.dims.ndisplay != 3 or self._backend.is_dragging is False:
                return  # early exit if manipulator is not being manipulated
            self._pre_drag()
            while event.type == 'mouse_move':
                selected_object_type = self._backend.manipulator_model.selected_object_type
                if selected_object_type == 'translator':
                    self._while_dragging_translator()
                elif selected_object_type == 'rotator':
                    self._while_dragging_rotator()
                yield
            self._post_drag()
    

    edit: things left to do

    • [ ] check and add tests for various instantiation possibilities of manipulator implementations (with layer, no layer)
    • [ ] hook up other manipulators
    opened by alisterburt 3
  • [WIP] Refactor manipulator drag

    [WIP] Refactor manipulator drag

    This WIP PR refactors the manipulator drag:

    • improves the visual for the manipulator
    • factors out an separate model for translator
    • factors out a separate model for rotator
    • introduces a RotatorDragManager to encapsulate the rotator drag logic
    • introduces a TranslatorDragManager to encapsulate the translator drag logic
    • fixes bugs in the rotator drag calculation
    • adds tests
    • restricts axes to [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
    opened by kevinyamauchi 2
  • Initial workflow ideas

    Initial workflow ideas

    In this issue, we discuss the initial workflows we aim to add:

    Draw points on a plane in 3D

    Have a controllable plane displayed in the volume. The user clicks to add points that get put on the point the cursor ray intersects the plane.

    Draw a line and rotate a rendering plane around the line

    Define a line by drawing two points on a plane. Add a render a plane that the line lies on and allow the user to rotate the plane around that line.

    Define a spline with points and translate a rendering plane along the spline

    Add points in 3D. Then fit a spline to those points. Add a rendering plane that is on the spline with its normal along the tangent of the spline. Allow the user to slice along the spline using a slider.

    opened by kevinyamauchi 2
  • update overview docs page and add stubs for getting started

    update overview docs page and add stubs for getting started

    This PR updates the landing page of the docs:

    • add video
    • add installation instructions
    • add getting started section and stubs for the getting started pages
    opened by kevinyamauchi 1
  • needed: manipulator relative scale

    needed: manipulator relative scale

    The manipulator used to stay a constant size relative to the scene

    I broke that with #63 and #65

    Would be great if we could get that feature back and not need to modify the model

    relevant code from old manipulator: https://github.com/napari-threedee/napari-threedee/blob/8f05af903a5722ba529fececc4f365c1fe922bed/src/napari_threedee/manipulators/base_manipulator.py#L127

    https://github.com/napari-threedee/napari-threedee/blob/8f05af903a5722ba529fececc4f365c1fe922bed/src/napari_threedee/manipulators/base_manipulator.py#L732-L747

    opened by alisterburt 0
  • IO and layer specifications

    IO and layer specifications

    Our annotators produce layers with a specific structure - we need to be able to serialize and deserialize that structure

    steps

    • specifications for layers produced by different annotators
    • serialize/deserialise

    related: we also need to make sure all annotators can be instantiated with existing layers which match the spec

    opened by alisterburt 0
Owner
null
Sample data for the napari image viewer.

napari-demo-data Sample data for the napari image viewer. This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugi

Genevieve Buckley 1 Nov 8, 2021
Napari plugin for iteratively improving 3D instance segmentation of cells (u-net x watershed)

iterseg napari plugin for iteratively improving unet-watershed segmentation This napari plugin was generated with Cookiecutter using @napari's cookiec

Abigail McGovern 3 May 16, 2022
Napari simpleitk image processing

napari-simpleitk-image-processing (n-SimpleITK) Process images using SimpleITK in napari Usage Filters of this napari plugin can be found in the Tools

Robert Haase 11 Dec 19, 2022
A simple image-level annotation tool supporting multi-channel images for napari.

napari-labelimg4classification A simple image-level annotation tool supporting multi-channel images for napari. This napari plugin was generated with

null 4 May 16, 2022
A simple plugin to view APR images in napari

napari-apr-viewer A simple plugin to view APR images in napari This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-

null 5 Jan 24, 2022
Art directed cropping, useful for responsive images

Art direction sets a focal point and can be used when you need multiple copies of the same Image but also in in different proportions.

Daniel 1 Aug 16, 2022
Python-based tools for document analysis and OCR

ocropy OCRopus is a collection of document analysis programs, not a turn-key OCR system. In order to apply it to your documents, you may need to do so

OCRopus 3.2k Jan 4, 2023
impy is an all-in-one image analysis library, equipped with parallel processing, GPU support, GUI based tools and so on.

impy is All You Need in Image Analysis impy is an all-in-one image analysis library, equipped with parallel processing, GPU support, GUI based tools a

null 24 Dec 20, 2022
Python wrappers for external BART computational imaging tools and internal libraries

bartpy Python bindings for BART. Overview This repo contains code to generate an updated Python wrapper for the Berkeley Advance Reconstruction Toolbo

Max Litster 7 May 9, 2022
Tools for making image cutouts from sets of TESS full frame images

Cutout tools for astronomical images Astrocut provides tools for making cutouts from sets of astronomical images with shared footprints. It is under a

Space Telescope Science Institute 20 Dec 16, 2022
Kainat 13 Mar 7, 2022
A python based library to help you create unique generative images based on Rarity for your next NFT Project

Generative-NFT Generate Unique Images based on Rarity A python based library to help you create unique generative images based on Rarity for your next

Kartikay Bhutani 8 Sep 21, 2022
Computer art based on quadtrees.

Quads Computer art based on quadtrees. The program targets an input image. The input image is split into four quadrants. Each quadrant is assigned an

Michael Fogleman 1.1k Dec 23, 2022
The ctypes-based simple ImageMagick binding for Python

Wand Wand is a ctypes-based simple ImageMagick binding for Python, supporting 2.7, 3.3+, and PyPy. All functionalities of MagickWand API are implement

Eric McConville 1.2k Dec 30, 2022
Qt based ebook reader

Qt based ebook reader Currently supports: pdf epub djvu fb2 mobi azw / azw3 / azw4 cbr / cbz md Contribute Paypal Bitcoin: 17jaxj26vFJNqQ2hEVerbBV5fpT

null 1.4k Dec 26, 2022
An esoteric visual language that takes image files as input based on a multi-tape turing machine, designed for compatibility with C.

vizh An esoteric visual language that takes image files as input based on a multi-tape turing machine, designed for compatibility with C. Overview Her

Sy Brand 228 Dec 17, 2022
Nanosensor Image Processor (NanoImgPro), a python-based image analysis tool for dopamine nanosensors

NanoImgPro Nanosensor Image Processor (NanoImgPro), a python-based image analysis tool for dopamine nanosensors NanoImgPro.py contains the main class

null 1 Mar 2, 2022
Computer art based on joining transparent images

Computer Art There is no must in art because art is free. Introduction The following tutorial exaplains how to generate computer art based on a series

Computer Art 12 Jul 30, 2022