No project description provided
Project description
Function Usage Guide
This guide provides instructions on how to use two sets of image processing functions in Python. The first set focuses on cell segmentation, while the second set includes functions for denoising images and converting them to grayscale.
Cell Segmentation Functions
Required Libraries
os
numpy
skimage
sklearn
matplotlib
Functions:
-
cell_segment(image_path, num_clusters=4): Segments cells in an image using K-means clustering.
image_path
: Path to the input image file.num_clusters
: Number of clusters for K-means clustering (default is 4).- Returns: Segmented image array.
-
img_save(segmented_image, save_path, image_path): Saves the segmented image to a specified location.
segmented_image
: Segmented image array.save_path
: Path to the folder where the segmented image will be saved.image_path
: Path to the original image file.
-
plot_img(segmented_image): Plots the segmented image.
segmented_image
: Segmented image array.
-
cell_folder(input_folder, output_folder, num_clusters=4): Segments cells in all images within a folder and saves the results.
input_folder
: Path to the folder containing input images.output_folder
: Path to the folder where segmented images will be saved.num_clusters
: Number of clusters for K-means clustering (default is 4).
Image Denoising and Grayscale Conversion Functions
Required Libraries
numpy
matplotlib
skimage
PIL
os
Functions:
-
denoise_images(input_folder, result_folder=None): Denoises images in a folder using Non-local Means Denoising.
input_folder
: Path to the folder containing input images.result_folder
: Path to the folder where denoised images will be saved (optional).
-
img_to_gray(input_folder, result_folder=None): Converts images to grayscale.
input_folder
: Path to the folder containing input images.result_folder
: Path to the folder where grayscale images will be saved (optional).
Example Usage:
from cellmean import cell_segment, img_save, plot_img, cell_folder, denoise_images, img_to_gray
# Cell Segmentation
segmented_image = cell_segment('input_image.jpg')
plot_img(segmented_image)
img_save(segmented_image, 'output_folder', 'input_image.jpg')
cell_folder('input_images_folder', 'output_images_folder', num_clusters=5)
# Image Denoising and Grayscale Conversion
denoise_images('input_images_folder', result_folder='denoised_images')
img_to_gray('input_images_folder', result_folder='gray_images')
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
Built Distribution
File details
Details for the file cellmean-1.2.2.tar.gz
.
File metadata
- Download URL: cellmean-1.2.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff450ed0b8ddf9dba71bdeff12f2dfa70f0a97ad46ad20a5d861a065eb6d29a4 |
|
MD5 | 7e0cf982fe8938478579da5a3c77b171 |
|
BLAKE2b-256 | dbe796115925fdb5efdd0617e1d9a44b83c413cede6e0d611bd0e0b1e6951a15 |
File details
Details for the file cellmean-1.2.2-py3-none-any.whl
.
File metadata
- Download URL: cellmean-1.2.2-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96bf092cb63b46a2d5d7444430f3923985ab1ae2583fd573894bce3aed50971f |
|
MD5 | d2a6b280f522edbc1f32cc2f7e90160b |
|
BLAKE2b-256 | 51ea70928cdbc40b11921eb6057957744254f939ab76aa15f24742cb113d46e0 |