neuralib.stardist.run_2d.StarDist2DOptions

class neuralib.stardist.run_2d.StarDist2DOptions[source]

Bases: AbstractSegmentationOptions

__init__()

Methods

__init__()

eval(**kwargs)

eval the model in single file or batch files in directory, and save the results

foreach_process_image([to_gray])

Iterates over image files in the specified directory, processes each image, and yields the file path along with the processed image.

ij_roi_output(filepath)

Get imageJ/Fiji .roi output save path

launch_napari([with_widget])

Launch napari viewer for stardist results

main([args, parse_only, system_exit])

parsing the commandline input args and call run().

new_parser(**kwargs)

create an ArgumentParser.

process_image([to_gray])

Process the image for segmentation.

run()

called after main().

seg_output(filepath)

Get segmented output save path

Attributes

DESCRIPTION

parser description.

EPILOG

parser epilog.

EX_GROUP_SOURCE

GROUP_IO

USAGE

parser usage.

batch_mode

flag batch mode

directory

directory for batch imaging processing

directory_suffix

suffix in the directory for batch mode (default: '.tif')

file

image file path

file_mode

flag file mode

invalid_existed_result

force re-evaluate the result (default: False)

model

stardist pretrained model (default: '2D_versatile_fluo')

napari_view

view result by napari GUI, only available in single file mode (default: False)

no_normalize

not do percentile-based image normalization (default: False)

prob_thresh

Consider only object candidates from pixels with predicted object probability above this threshold.

save_ij_roi

if save also the imageJ/Fiji compatible .roi file (default: False)

with_norm

flag normalize image

DESCRIPTION: str | None = 'Run the Stardist model for segmentation'

parser description. Could be override as a method if its content is dynamic-generated.

model: Literal['2D_versatile_fluo', '2D_versatile_he', '2D_paper_dsb2018', '2D_demo']

stardist pretrained model (default: ‘2D_versatile_fluo’)

prob_thresh: float | None

Consider only object candidates from pixels with predicted object probability above this threshold. Seealso: stardist.models.base._predict_instances_generator: prob_thresh (default: None)

run()[source]

called after main(). Used for runs the main execution logic of the object

seg_output(filepath)[source]

Get segmented output save path

Parameters:

filepath (Path) – filepath for image

Returns:

segmented output save path

Return type:

Path

eval(**kwargs)[source]

eval the model in single file or batch files in directory, and save the results

Return type:

None

launch_napari(with_widget=False, **kwargs)[source]

Launch napari viewer for stardist results

Parameters:

with_widget (bool) – If True, launch also with the starDist widget (required package stardist-napari)