cliputil¶
Lucid CLIP.
This module implements utilities for running CLIP image processing tools.
- class cliputil.AABBInfo(xmin: int, ymin: int, zmin: int, xmax: int, ymax: int, zmax: int)¶
- class cliputil.AvgInfo(mean: float, count: int, sum: float)¶
- class cliputil.CAReportLabelInfo(label: int, voxels: int, origin: List[int], extent: List[int])¶
- class cliputil.ComInfo(xcom: float, ycom: float, zcom: float, mass: float)¶
- class cliputil.GluePositionsInfo(global_size: Tuple[int, int], tile_size: Tuple[int, int], tiles: List[cliputil.GlueTilePositionInfo])¶
- class cliputil.GlueTilePositionInfo(tile_path: pathlib.Path, position: Tuple[int, int])¶
- class cliputil.HistoInfo(x0: List[float], pdf: List[float], distr: List[float], total_count: int, bin_counts: List[int])¶
- class cliputil.PopTopInfo(value: float, count: int)¶
- class cliputil.RunTopInfo(quantile: float, count: int, percentile: float)¶
- class cliputil.VarInfo(variance: float, standard_deviation: float)¶
- cliputil.create_empty_file(*args, **kwargs)¶
For backward compatibility. Use fileioutil instead.
- cliputil.extract_raw_pixels_file(image: Image, output_path: Path)¶
Copy the OMNI image pixels to a raw file without offset / trailing data.
- cliputil.extract_raw_uint8_pixels_file(image: Image, output_path: Path)¶
Copy and convert the OMNI image pixels to a raw uint8 (or int8) file without offset / trailing data.
- cliputil.get_exe_path(*relative_path_components: str) Path ¶
Get path of CLIP executable using environment variable LUCID_CLIP set in installer.
- cliputil.get_or_extract_raw_file_and_pipe_float32_pixels(image: Image, temp_folder_path: Path) Tuple[Path, List[PipeProcessInfo]] ¶
Copy and convert the OMNI image pixels to a raw float32 file without offset / trailing data, or just get the existing pixels file if not needed. Return the extracted file path, and the pipe to convert it to float32.
- cliputil.get_or_extract_raw_float32_pixels_file(image: Image, temp_folder_path: Path) Path ¶
Copy and convert the OMNI image pixels to a raw float32 file without offset / trailing data, or just get the existing pixels file if not needed.
- cliputil.get_or_extract_raw_pixels_file(image: Image, output_path: Path) Path ¶
Copy the OMNI image pixels to a raw file without offset / trailing data, or just get the existing pixels file if not needed.
- cliputil.get_or_extract_raw_uint8_pixels_file(image: Image, temp_folder_path: Path) Path ¶
Copy and convert the OMNI image pixels to a raw uint8 (or int8) file without offset / trailing data, or just get the existing pixels file if not needed.
- cliputil.optional_env(**kwargs) Dict[str, str] ¶
Prepare optional environment variables for CLIP.
- cliputil.parse_aabb_result(result_text: str) AABBInfo ¶
Parse stdout of CLIP aabb.
Example: xmin 10 ymin 10 zmin 10 xmax 230 ymax 230 zmax 230
- cliputil.parse_avg_result(result_text: str) AvgInfo ¶
Parse stdout of CLIP avg.
Example: 11115.8 (250000) 2.77894e+09
- cliputil.parse_com_result(result_text: str) ComInfo ¶
Parse stdout of CLIP com.
Example: com 168.35 150.765 46.566 mass 3.21886e+10
- cliputil.parse_count_result(result_text: str) int ¶
Parse stdout of CLIP count.
Example: 143
- cliputil.parse_glue_positions_txt(positions_txt_path: Path) GluePositionsInfo ¶
Parse positions.txt output of CLIP glue.
- Example:
#global image xpixels 24766 ypixels 15045 #tile size xpixels 1024 ypixels 768 tile filename.raw xorigin 321 yorigin 0 …
- cliputil.parse_histo_result(result_text: str) HistoInfo ¶
Parse stdout of CLIP histo.
- Example:
0.5 0.941976 0.941976 1.5 0 0.941976 2.5 0.0580236 1
#(4.716870e+005) #444318 0 27369
- cliputil.parse_poptop_result(result_text: str) PopTopInfo ¶
Parse stdout of CLIP poptop.
Example: 1.533429e+02 (1367184)
- cliputil.parse_runtop_result(result_text: str) RunTopInfo ¶
Parse stdout of CLIP runtop.
Example: -1.677722e+07 (250000) 0.000400 percentile
- cliputil.parse_var_result(result_text: str) VarInfo ¶
Parse stdout of CLIP var.
Example: 2.658845e+13 std 5.156399e+06
- cliputil.pipe_aabb(xsize: int, ysize: int, zsize: int) PipeProcessInfo ¶
Prepare CLIP aabb for run_pipe()
- cliputil.pipe_and(input2_path: Path, *, u32: bool = None, not_: bool = None) PipeProcessInfo ¶
Prepare CLIP and for run_pipe()
- cliputil.pipe_aof(input_path: Path, xn: int, yn: int) PipeProcessInfo ¶
Prepare CLIP aof for run_pipe()
- cliputil.pipe_avg() PipeProcessInfo ¶
Prepare CLIP avg for run_pipe()
- cliputil.pipe_com(xsize: int, ysize: int, zsize: int) PipeProcessInfo ¶
Prepare CLIP com for run_pipe()
- cliputil.pipe_count() PipeProcessInfo ¶
Prepare CLIP count for run_pipe()
- cliputil.pipe_curv(output_folder_path: Path, xsize: int, ysize: int, *, j0: int = None, jn: int = None, threshold: float = None, dump: bool = None, verbose: float = None, mirror: bool = None, enhance: bool = None, dc: float = None) PipeProcessInfo ¶
Prepare CLIP curv for run_pipe()
- cliputil.pipe_down(xn: int, yn: int, *, two_dimensions: bool = False) PipeProcessInfo ¶
Prepare CLIP down for run_pipe()
- cliputil.pipe_evalp(*, min: float = None, max: float = None, c0: float = None, c1: float = None, c2: float = None) PipeProcessInfo ¶
Prepare CLIP evalp for run_pipe()
- cliputil.pipe_f2i(*, inbits: int = None, outbits: int = None, signed: bool = None, min: float = None, max: float = None, a0: float = None, a1: float = None) PipeProcessInfo ¶
Prepare CLIP f2i for run_pipe()
- cliputil.pipe_histo(nbins: int, *, a0: float = None, a1: float = None) PipeProcessInfo ¶
Prepare CLIP histo for run_pipe()
- cliputil.pipe_i2f(*, inbits: int = None, outbits: int = None, signed: bool = None, min: float = None, max: float = None, a0: float = None, a1: float = None) PipeProcessInfo ¶
Prepare CLIP i2f for run_pipe()
- cliputil.pipe_lapl(xsize: int, ysize: int, zsize: int) PipeProcessInfo ¶
Prepare CLIP lapl for run_pipe()
- cliputil.pipe_or(input2_path: Path, *, u32: bool = None, not_: bool = None, xor: bool = None) PipeProcessInfo ¶
Prepare CLIP or for run_pipe()
- cliputil.pipe_pad(xn: int, yn: int, zn: int, xhi: int, yhi: int, zhi: int, *, xlo: int = None, ylo: int = None, zlo: int = None, clamp: bool = None) PipeProcessInfo ¶
Prepare CLIP pad for run_pipe()
- cliputil.pipe_poptop(percent: float, *, down: bool = None, sparse: bool = None) PipeProcessInfo ¶
Prepare CLIP poptop for run_pipe()
- cliputil.pipe_putroi(raw_path: Path, xsize_source: int, ysize_source: int, zsize_source: int, xstart_roi: int, ystart_roi: int, zstart_roi: int, xsize_roi: int, ysize_roi: int, zsize_roi: int) PipeProcessInfo ¶
Prepare CLIP putroi for run_pipe()
- cliputil.pipe_roi(raw_path: Path, xsize_source: int, ysize_source: int, zsize_source: int, xstart_roi: int, ystart_roi: int, zstart_roi: int, xsize_roi: int, ysize_roi: int, zsize_roi: int, *, offset: int = None, element_size: int = None) PipeProcessInfo ¶
Prepare CLIP roi for run_pipe()
- cliputil.pipe_runtop(*, min: bool = None) PipeProcessInfo ¶
Prepare CLIP runtop for run_pipe()
- cliputil.pipe_sel(input2_path: Path, *, not_: bool = None, dense: bool = None, locate: bool = None) PipeProcessInfo ¶
Prepare CLIP sel for run_pipe()
- cliputil.pipe_thr(min: float = None, max: float = None, *, nrm: bool = None, outu8: bool = None, bit1: bool = None) PipeProcessInfo ¶
Prepare CLIP thr for run_pipe()
- cliputil.pipe_up(xn: int, yn: int, zn: int) PipeProcessInfo ¶
Prepare CLIP up for run_pipe()
- cliputil.pipe_var(mean_value: float) PipeProcessInfo ¶
Prepare CLIP var for run_pipe()
- cliputil.pipe_xyt(xn: int, yn: int, size: int) PipeProcessInfo ¶
Prepare CLIP xyt for run_pipe()
- cliputil.read_size_file(size_path: Path) List[int] ¶
Read a .size file written by CLIP.
- cliputil.run_and(input_path: Path, input2_path: Path, output_path: Path, **kwargs)¶
CLIP and
- cliputil.run_aof(input_path: Path, output_path: Path, xn: int, yn: int)¶
CLIP aof
- cliputil.run_bsp_rotate(input_float32_raw_path: Path, output_float32_raw_path: Path, xsize: int, ysize: int, yaw_degrees: float, pitch_degrees: float, roll_degrees: float, *, order: int = None, ntasks: int = None) Tuple[int, int, int] ¶
CLIP bsp-rotate
Returns the output image size.
- cliputil.run_ca(input_int8_raw_path: Path, output_labels_path: Path, xsize: int, ysize: int, *, d: int = 26, background: bool = None, ntasks: int = None)¶
CLIP ca-d6, ca-d18 or ca-d26
- cliputil.run_ca_intersected_by_seed(inout_segm_path: Path, seed_segm_path: Path, tmp_labels_path: Path, tmp_sel_path: Path, xsize: int, ysize: int, zsize: int, *, d: int = None, background: bool = None, bit1: bool = None)¶
CLIP ca: select components that intersect with seed segments
- cliputil.run_ca_main(inout_segm_path: Path, tmp_labels_path: Path, xsize: int, ysize: int, *, d: int = None, background: bool = None, bit1: bool = None)¶
CLIP ca-main.pl
- cliputil.run_ca_range(inout_segm_path: Path, tmp_labels_path: Path, tmp_sel_path: Path, xsize: int, ysize: int, *, min_count: int = None, max_count: int = None, d: int = None, background: bool = None, bit1: bool = None)¶
CLIP ca select components within pixel count range
- cliputil.run_ca_rank(inout_segm_path: Path, tmp_labels_path: Path, tmp_sel_path: Path, xsize: int, ysize: int, *, min_rank: int = None, max_rank: int = None, d: int = None, background: bool = None, bit1: bool = None)¶
CLIP ca select components within pixel count rank. (rank=1 is the largest component)
- cliputil.run_ca_report(input_labels_path: Path, xsize: int, ysize: int, *, ntasks: int = None) List[CAReportLabelInfo] ¶
CLIP ca-report
- cliputil.run_ca_seld(labels_path: Path, selected_txt_path: Path = None, output_dir_path: Path = None, *, inout_path: Path = None, op: str = None, not_: bool = None, sel_list: str = None, bit1: bool = None, ntasks: int = None)¶
CLIP ca-seld
- cliputil.run_collapse(graph_folder_path: Path) CompletedProcess ¶
CLIP collapse
- cliputil.run_count(input_uint8_raw_path: Path) int ¶
CLIP count
- cliputil.run_curv(input_float_raw_path: Path, output_folder_path: Path, xsize: int, ysize: int, **kwargs)¶
CLIP curv
- cliputil.run_curv3d(input_float_raw_path: Path, output_folder_path: Path, xsize: int, ysize: int, *, j0: int = None, jn: int = None, threshold: float = None, dump: bool = None, verbose: float = None, pad: int = None, donuts: bool = None, af: float = None, fftw_patient: bool = None, dc: float = None, ntasks: int = None)¶
CLIP curv3d
- cliputil.run_dct_rsmpl(input_float_raw_path: Path, output_float_raw_path: Path, xsize: int, ysize: int, newxsize: int, newysize: int, newzsize: int, ntasks: int = None)¶
CLIP DCT Resampling
- cliputil.run_dctf(input_float_raw_path: Path, output_folder_path: Path, xsize: int, ysize: int, *, nudt: float = None, laplace: int = None, ntasks: int = None)¶
CLIP DCT Filter
- cliputil.run_down(input_path: Path, output_path: Path, xn: int, yn: int, **kwargs)¶
CLIP down
- cliputil.run_eik(input_seeds_uint8_raw_path: Path, input_speed_uint8_raw_path: Path, output_folder_path: Path, xsize: int, ysize: int, *, minsteps: int = None, maxsteps: int = None, dt: float = None, spd: int = None, spr: int = None, communication_computation_overlap: bool = None, input_ic_path: Path = None, ntasks: int = None)¶
CLIP eik
- cliputil.run_evalp(input_path: Path, output_path: Path, **kwargs)¶
CLIP evalp Transform raw float32 values x to y = c0 + c1 * x + c2 * x * x. Optional: First saturate input values to interval [min, max].
- cliputil.run_f2i(input_path: Path, output_path: Path, **kwargs)¶
CLIP f2i
- cliputil.run_gi(input_float_raw_path: Path, output_float_raw_path: Path, xsize: int, ysize: int, yaw_count: int, pitch_count: int, *, e0: float = None, bspline_interpolation: bool = None, ntasks: int = None)¶
CLIP GI
- cliputil.run_glue(input_list_txt_path: Path, output_dir_path: Path, tilexcount: int, tilexsize: int, *, invframe: bool = None, verbose: int = None, overlap: int = None, accurate: bool = None, ntasks: int = None)¶
CLIP glue
- cliputil.run_i2f(input_path: Path, output_path: Path, **kwargs)¶
CLIP i2f
- cliputil.run_lapl(input_float_raw_path: Path, output_float_raw_path: Path, xsize: int, ysize: int, zsize: int)¶
CLIP lapl
- cliputil.run_mir(inout_path: Path, xn: int, yn: int, el_size: int, axis: str)¶
CLIP mir
- cliputil.run_morph_dilate_erode(inout_int8_raw_path: Path, tmp_raw_path: Path, xsize: int, ysize: int, margin: float, bit1: bool = None)¶
Use CLIP for morphological operations: * dilate: with margin > 0 * erode: with margin < 0
- cliputil.run_morph_open_close(inout_int8_raw_path: Path, tmp_raw_path: Path, xsize: int, ysize: int, margin: float, bit1: bool = None)¶
Use CLIP for morphological operations: * open: with margin > 0 * close: with margin < 0
- cliputil.run_msh_iso(input_float32_raw_path: Path, output_mesh_path: Path, xsize: int, ysize: int, isovalue: float, *, cap_mesh: bool = True, flip: bool = None, input_gi_float32_path: Path = None, input_aux_float32_path: Path = None, ntasks: int = None)¶
CLIP msh-iso
- cliputil.run_nlf(input_float_raw_path: Path, output_folder_path: Path, xsize: int, ysize: int, *, a: float = None, h: float = None, use_lq: bool = False, use_gpu: bool = True)¶
CLIP Non-Linear Denoising Filter
- cliputil.run_or(input_path: Path, input2_path: Path, output_path: Path, **kwargs)¶
CLIP or
- cliputil.run_pad(input_path: Path, output_path: Path, xn: int, yn: int, zn: int, xhi: int, yhi: int, zhi: int, **kwargs)¶
CLIP pad
- cliputil.run_poptop(input_path: Path, percent: float, **kwargs) PopTopInfo ¶
CLIP poptop
- cliputil.run_putroi(roi_raw_path: Path, **kwargs)¶
CLIP putroi
- cliputil.run_roi(raw_path: Path, xsize_source: int, ysize_source: int, zsize_source: int, xstart_roi: int, ystart_roi: int, zstart_roi: int, xsize_roi: int, ysize_roi: int, zsize_roi: int, out_path: Path, *, offset: int = None, element_size: int = None) CompletedProcess ¶
CLIP roi
- cliputil.run_runtop(input_path: Path, **kwargs) RunTopInfo ¶
CLIP runtop
- cliputil.run_sdt(input_path: Path, output_path: Path, xsize: int, ysize: int, *, all_in_core: bool = None, ntasks: int = None)¶
CLIP sdt
- cliputil.run_sdt_morph(inout_int8_raw_path: Path, tmp_raw_path: Path, xsize: int, ysize: int, margin: float, ca: bool = False)¶
CLIP sdt-morph.pl
- cliputil.run_sel(input_path: Path, input2_path: Path, output_path: Path, **kwargs)¶
CLIP sel
- cliputil.run_thk(input_sdt_float32_raw_path: Path, output_raw_path: Path, xsize: int, ysize: int, *, output_maxthk_txt_path: Path = None, fine_grained: bool = None, ntasks: int = None)¶
CLIP thk
- cliputil.run_thn(input_uint8_raw_path: Path, output_uint8_raw_path: Path, xsize: int, ysize: int, *, median_filt_iter: int = None, keep_ends: bool = None, read_only_path: Path = None, ntasks: int = None)¶
CLIP thn
- cliputil.run_thr(input_path: Path, output_path: Path, min: float = None, max: float = None, **kwargs)¶
CLIP thr
- cliputil.run_thrd(input_path: Path, output_path: Path, min: float = None, max: float = None, *, mkdir: bool = None, ntasks: int = None)¶
CLIP thrd
- cliputil.run_up(input_path: Path, output_path: Path, xn: int, yn: int, zn: int)¶
CLIP up
- cliputil.run_vec(skeleton_raw_path: Path, sdt_float_raw_path: Path, thickness_float_raw_path: Path, graph_folder_path: Path, xn: int, yn: int) CompletedProcess ¶
CLIP vec
- cliputil.run_xyt(input_path: Path, output_path: Path, xn: int, yn: int, size: int)¶
CLIP xyt
- cliputil.set_file_size(*args, **kwargs)¶
For backward compatibility. Use fileioutil instead.