Metadata-Version: 2.1
Name: cellshape-cluster
Version: 0.0.3rc0
Summary: 3D shape analysis using deep learning
Author: Matt De Vries, Adam Tyson
Author-email: mattdevries.ai@gmail.com
Project-URL: Source Code, https://github.com/Sentinal4D/cellshape-cluster
Project-URL: Bug Tracker, https://github.com/Sentinal4D/cellshape-cluster/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows :: Windows 10
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: torch
Requires-Dist: torchvision
Requires-Dist: numpy
Requires-Dist: cellshape-cloud
Requires-Dist: cellshape-voxel
Requires-Dist: tqdm
Requires-Dist: scikit-learn
Provides-Extra: dev
Requires-Dist: black ; extra == 'dev'
Requires-Dist: pytest-cov ; extra == 'dev'
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: gitpython ; extra == 'dev'
Requires-Dist: coverage (>=5.0.3) ; extra == 'dev'
Requires-Dist: bump2version ; extra == 'dev'
Requires-Dist: pre-commit ; extra == 'dev'
Requires-Dist: flake8 ; extra == 'dev'

# cellshape-cluster
___
Cellshape-cluster is an easy-to-use tool to analyse the cluster cells by their shape using deep learning and, in particular, deep-embedded-clustering. The tool provides the ability to train popular graph-based or convolutional autoencoders on point cloud or voxel data of 3D single cell masks as well as providing pre-trained networks for inference.


## To install
```bash
pip install cellshape-cluster
```

## Usage
```python
import torch
from cellshape_cloud import CloudAutoEncoder
from cellshape_cluster import DeepEmbeddedClustering

autoencoder = CloudAutoEncoder(
    num_features=128, 
    k=20, 
    encoder_type="dgcnn"
)

model = DeepEmbeddedClustering(autoencoder=autoencoder, 
                               num_clusters=10,
                               alpha=1.0)

points = torch.randn(1, 2048, 3)

recon, features, clusters = model(points)
```

## Parameters

- `autoencoder`: CloudAutoEncoder or VoxelAutoEncoder.  
Instance of autoencoder class from cellshape-cloud or cellshape-voxel
- `num_clusters`: int.  
The number of clusters to use in deep embedded clustering algorithm.
- `alpha`: float.  
Degrees of freedom for the Student's t-distribution. Xie et al. (ICML, 2016) let alpha=1 for all experiments.

## For developers
* Fork the repository
* Clone your fork
```bash
git clone https://github.com/USERNAME/cellshape-cluster 
```
* Install an editable version (`-e`) with the development requirements (`dev`)
```bash
cd cellshape-cluster
pip install -e .[dev] 
```
* To install pre-commit hooks to ensure formatting is correct:
```bash
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:

```bash
git push --follow-tags
```

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

```bash
bump2version release
```
