neuralib.segmentation.base.AbstractSegmentationOption
- class neuralib.segmentation.base.AbstractSegmentationOption[source]
Bases:
AbstractParser- __init__()
Methods
__init__()eval()eval the model in single file or batch files, and save the results
Normalize the image in batch mode
Load image from a directory and convert to grayscale
ij_roi_output(filepath)Get imageJ/Fiji
.roioutput save pathlaunch_napari(**kwargs)napari viewer
main([args, parse_only, system_exit])parsing the commandline input args and call
run().new_parser(**kwargs)create an
ArgumentParser.Normalize the image
Load image from file and convert to grayscale
run()called after
main()seg_output(filepath)Get segmented output save path
Attributes
parser description.
EPILOGparser epilog.
USAGEparser usage.
Flag batch mode
images directory for batch processing
suffix in batch mode
image file path
Flag file mode
force re-evaluate the result
which pretrained model
view in napari
NOT DO Percentile-based image normalization for eval
if save also the imageJ/Fiji compatible .roi file
- DESCRIPTION: str = 'ABC for cellular segmentation'
parser description. Could be override as a method if its content is dynamic-generated.
- EX_GROUP_SOURCE = 'EX_GROUP_SOURCE'
- file: Path
image file path
- directory: Path
images directory for batch processing
- directory_suffix: str
suffix in batch mode
- save_ij_roi: bool
if save also the imageJ/Fiji compatible .roi file
- force_re_eval: bool
force re-evaluate the result
- model: str
which pretrained model
- no_normalize: bool
NOT DO Percentile-based image normalization for eval
- napari_view: bool
view in napari
- property file_mode: bool
Flag file mode
- property batch_mode: bool
Flag batch mode
- raw_image()[source]
Load image from file and convert to grayscale
- Returns:
Array[float, [H, W]]
- Return type:
ndarray
- foreach_raw_image()[source]
Load image from a directory and convert to grayscale
- Returns:
Tuple of filepath and image Array[float, [H, W]]
- Return type:
Iterable[tuple[Path, ndarray]]
- foreach_normalize_image()[source]
Normalize the image in batch mode
- Returns:
Tuple of filepath and image Array[float, [H, W]]
- Return type:
Iterable[tuple[Path, ndarray]]
- abstract seg_output(filepath)[source]
Get segmented output save path
- Parameters:
filepath (Path) – filepath for image
- Returns:
segmented output save path
- Return type:
Path
- ij_roi_output(filepath)[source]
Get imageJ/Fiji
.roioutput save path- Parameters:
filepath (Path) – filepath for image
- Returns:
ij roi output save path
- Return type:
Path