s3pipeline
Python-based spherical cortical surface processing tools, including spherical mapping, resampling, interpolation, registration, parcellation, etc. It provides fast and accurate cortical surface-based data analysis using deep learning techniques.
Install
It can be installed from PyPI using:
pip install s3pipe
or using conda to directly create an environment from environment.yml
conda env create -f environment.yml
conda activate s3env
Then install pytorch from https://pytorch.org/get-started/locally/ with correct gpu/cpu and cuda choices.
Main tools
I/O vtk file. Python function for reading and writing .vtk surface file. Example code:
from s3pipe.utils.vtk import read_vtk, write_vtk
surf = read_vtk(file_name)
# Some operations to the surface
write_vtk(surf, new_file_name)
For matlab users, please refer to this issue and this repository.
Layers provide basic spherical convolution, pooling, upsampling layers for constructing spherical convolutional neural networks.
Models provide some baseline spherical convolutional neural networks, e.g., Spherical U-Net, Spherical SegNet, Spherical VGG, Spherical ResNet, Spherical CycleGAN, etc.
Resample feature on spherical surface to standard icosahedron subdivision spheres. Example code:
from s3pipe.utils.interp_numpy import resampleSphereSurf
from s3pipe.utils.vtk import read_vtk, write_vtk
from s3pipe.utils.utils import get_sphere_template
template_163842 = get_sphere_template(163842)
data = read_vtk(file)
resampled_feat = resampleSphereSurf(data['vertices'], template_163842['vertices'],
np.concatenate((data['sulc'][:,np.newaxis], data['curv'][:,np.newaxis]), axis=1))
surf = {'vertices': template_163842['vertices'],
'faces': template_163842['faces'],
'sulc': resampled_feat[:,0],
'curv': resampled_feat[:,1]}
write_vtk(surf, file.replace('.vtk', '.resample.vtk'))
Note if you want to run it on GPU, change interp_numpy to interp_torch.
Resample label on spherical surface to standard icosahedron subdivision spheres. Example code:
from s3pipe.utils.vtk import read_vtk, write_vtk,
from s3pipe.utils.interp_numpy import resample_label
from s3pipe.utils.utils import get_sphere_template
template_163842 = get_sphere_template(163842)
surf = read_vtk(file)
resampled_label = resample_label(surf['vertices'], template_163842['vertices'], surf['par_fs_vec'])
Cortical surface parcellation with trained models based on this package.
Cortical surface registration with trained models based on this package.
Rigid surface alignment. An example code can be found here.
Spherical surfae mapping with trained models based on this package.
Papers
If you use this code, please cite:
Fenqiang Zhao, et.al. Spherical U-Net on Cortical Surfaces: Methods and Applications. Information Processing in Medical Imaging (IPMI), 2019.
Fenqiang Zhao, et.al. Spherical Deformable U-Net: Application to Cortical Surface Parcellation and Development Prediction. IEEE Transactions on Medical Imaging, 2021.
Fenqiang Zhao, et.al. S3Reg: Superfast Spherical Surface Registration Based on Deep Learning. IEEE Transactions on Medical Imaging, 2021.
Fenqiang Zhao, et.al. Fast spherical mapping of cortical surface meshes using deep unsupervised learning. MICCAI 2022.
Metadata
Release files for s3pipe 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| s3pipe-1.3.0.tar.gz | 85.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| s3pipe-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 169.8 MB
Release files / s3pipe-1.3.0.tar.gz
| Download URL | s3pipe-1.3.0.tar.gz |
|---|---|
| Size | 85.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e43dbcd3b7907c8cf04b5b7eb1e4123d5c392303e2d72f4ef3219150b134aff
|
|
BLAKE2b-256 checksum How to use checksums |
ab84fc6bda0a7516d3e3ed1501cb6d9b4ad63abea8ada8b522ee270d006afd98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.5
|
Release files / s3pipe-1.3.0-py3-none-any.whl
| Download URL | s3pipe-1.3.0-py3-none-any.whl |
|---|---|
| Size | 84.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
de3e2396de63f97bf9acd5f119f8aa7a2bbc3513492df4b6282e0d9945c02541
|
|
BLAKE2b-256 checksum How to use checksums |
2f01ad0d6cf4b9277499d23621b87d7c5848a5d457b46801f27e10cf0020e9a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.5
|