3D shape analysis using deep learning
Project description
Cellshape-voxel is an easy-to-use tool to analyse the shapes of cells using deep learning and, in particular, 3D convolutional neural networks. The tool provides the ability to train 3D convolutional autoencoders on 3D single cell masks as well as providing pre-trained networks for inference.
To install
pip install cellshape-voxel
Usage
import torch
from cellshape_voxel import VoxelAutoEncoder
from cellshape_voxel.encoders.resnet import Bottleneck
model = VoxelAutoEncoder(num_layers_encoder=3,
num_layers_decoder=3,
encoder_type="resnet",
input_shape=(64, 64, 64, 1),
filters=(32, 64, 128, 256, 512),
num_features=50,
bias=True,
activations=False,
batch_norm=True,
leaky=True,
neg_slope=0.01,
resnet_depth=10,
resnet_block_inplanes=(64, 128, 256, 512),
resnet_block=Bottleneck,
n_input_channels=1,
no_max_pool=True,
resnet_shortcut_type="B",
resnet_widen_factor=1.0)
volume = torch.randn(1, 64, 64, 64, 1)
recon, features = model(volume)
Parameters
num_features
: int.
The size of the latent space of the autoencoder. If you have rectangular images, make sure your image size is the maximum of the width and heightk
: int.
The number of neightbours to use in the k-nearest-neighbours graph construction.encoder_type
: int.
The type of encoder: 'foldingnet' or 'dgcnn'decoder_type
: int.
The type of decoder: 'foldingnet' or 'dgcnn'
For developers
- Fork the repository
- Clone your fork
git clone https://github.com/USERNAME/cellshape-voxel
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cellshape-voxel-0.0.4rc0.tar.gz
.
File metadata
- Download URL: cellshape-voxel-0.0.4rc0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e7b63c0463baa9b1c8237b9afee1da8ea6e9e309b3ac8d0700a5055c345d4a9 |
|
MD5 | 19ff233963b7086c99214128c77add4d |
|
BLAKE2b-256 | 3710da008fa399569e0a64c0cba170ece9547ae7c476a1395ac1b621f65b25a3 |
File details
Details for the file cellshape_voxel-0.0.4rc0-py3-none-any.whl
.
File metadata
- Download URL: cellshape_voxel-0.0.4rc0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 042151e91ab794085b8cfc1ca409d3edaf40c300687765d4daefd43d61a01aee |
|
MD5 | bedbc8524022a64420b955bec16e457c |
|
BLAKE2b-256 | 7bfcd0ed434ad5316be00127e66463d395f4c5c266ff80b140e0ba82346a9c9a |