Skip to main content

3D shape analysis using deep learning

Project description

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Python Version PyPI Downloads Wheel Development Status Tests Coverage Status Code style: black

Cellshape logo by Matt De Vries


Cellshape-helper provides the ability to convert 3D masks to point clouds.

To install

Step 1: Install PyMesh:

This package relies on PyMesh which needs to be installed first. To install, check out the source code from GitHub:

  • Clone the PyMesh repo into a directory of your choice:
git clone https://github.com/PyMesh/PyMesh.git
cd PyMesh
git submodule update --init
export PYMESH_PATH=`pwd`
  • On Linux, the system dependencies can be installed with apt-get:
apt-get install \
   libeigen3-dev \
   libgmp-dev \
   libgmpxx4ldbl \
   libmpfr-dev \
   libboost-dev \
   libboost-thread-dev \
   libtbb-dev \
   python3-dev
  • On MacOS, the system dependencies can be installed with MacPorts:
port install
    python36 \
    eigen3 \
    gmp \
    mpfr \
    tbb \
    boost
  • Python dependencies such as NumPy and SciPy can be installed using pip:
pip install -r $PYMESH_PATH/python/requirements.txt
  • Build PyMesh with setuptools:
./setup.py build
  • Install PyMesh:
./setup.py install  # May require root privilege
  • Alternatively, one can install PyMesh locally:
./setup.py install --user
  • Check if PyMesh was installed correctly:
python -c "import pymesh; pymesh.test()"
  • Please refer to the PyMesh installation guide if there are any issues.

Step 2: Install cellshape-helper

pip install cellshape-helper

Usage

import cellshape_helper as helper


PATH_TO_TIF_FILES = "path/to/tif/files/"
PATH_TO_SAVE_MESH = "path/to/save/mesh/files/"
PATH_TO_SAVE_PC = "path/to/save/pointcloud/files/"
NUM_POINTS = 2048

helper.tif_to_pc_directory(PATH_TO_TIF_FILES, 
                           PATH_TO_SAVE_MESH, 
                           PATH_TO_SAVE_PC, 
                           NUM_POINTS)

Parameters

  • PATH_TO_TIF_FILES: str.
    The path to you binary masks of cells or nuclei.
  • PATH_TO_SAVE_MESH: str.
    The path where you want to save the mesh objects to.
  • PATH_TO_SAVE_PC: str.
    The path where you want to save your point clouds to.
  • NUM_POINTS: str.
    The number of points to sample from the mesh object when creating a point cloud.

For developers

  • Fork the repository
  • Clone your fork
git clone https://github.com/USERNAME/cellshape-helper 
  • Install an editable version (-e) with the development requirements (dev)
cd cellshape-voxel
pip install -e .[dev] 
  • To install pre-commit hooks to ensure formatting is correct:
pre-commit install
  • To release a new version:

Firstly, update the version with bump2version (bump2version patch, bump2version minor or bump2version major). This will increment the package version (to a release candidate - e.g. 0.0.1rc0) and tag the commit. Push this tag to GitHub to run the deployment workflow:

git push --follow-tags

Once the release candidate has been tested, the release version can be created with:

bump2version release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cellshape-helper-0.0.15.tar.gz (6.5 kB view hashes)

Uploaded Source

Built Distribution

cellshape_helper-0.0.15-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page