tract_map#

class TractMapProcessor(sample_manager: SampleManager | None = None, config_coordinator: ConfigCoordinator | None = None, channel: str = '', registration_processor=None)[source]#

Bases: ChannelPipelineOrchestrator

static transformation(coords, source_shape, resampled_shape, results_directories)[source]#
binarize(clip_low, clip_high)[source]#
compute_clip_range(pixel_percents=(70, 99.999))[source]#
create_test_dataset(slicing)[source]#
export_df(asset_sub_type=None)[source]#
get_registration_sequence_channels(stop_channel='atlas')[source]#
intensities_to_percentiles(low_intensity, high_intensity)[source]#

Convert two intensity thresholds to their percentile ranks (0‒100], using the same nearest-rank convention as compute_clip_range.

Parameters:
  • low_intensity (scalar) – Intensity values (e.g. gray levels) whose positions in the global histogram are required.

  • high_intensity (scalar) – Intensity values (e.g. gray levels) whose positions in the global histogram are required.

Returns

list[float]

[low_percentile, high_percentile]

label()[source]#
mask_to_coordinates(as_memmap=False)[source]#
parallel_transform(processes=-1)[source]#
plot_binarization_levels(low_spin_box, high_spin_box)[source]#
plot_binary(debug=False)[source]#
plot_tracts_3d_scatter_w_atlas_colors(raw=False, coordinates_from_debug=False, plot_onto_debug=False, parent=None)[source]#
plot_voxelized_counts()[source]#
run_pipeline(tuning=False)[source]#
setup(sample_manager, channel_name, registration_processor)[source]#

Attach a sample manager and mark this processor as ready.

Parameters:

sample_manager (SampleManager, optional) – If provided, replaces the currently stored sample manager. When None, the previously stored instance is reused.

Raises:

ValueError – If the config section identified by config_name is absent.

shift_coordinates()[source]#

Shift the coordinates by the cropping amount to get the values in whole sample reference frame

voxelize()[source]#
block_re = ('Processing block', re.compile('.*?Processing block \\d+/\\d+.*?\\selapsed time:\\s\\d+:\\d+:\\d+\\.\\d+'))#
config_name = 'tract_map'#
label_re = ('Labeling', re.compile('.*?Label: processing \\d+/\\d+.*?\\selapsed time:\\s\\d+:\\d+:\\d+\\.\\d+'))#
where_re = ('Where', re.compile('.*?Where: processing \\d+/\\d+.*?\\selapsed time:\\s\\d+:\\d+:\\d+\\.\\d+'))#
label_points_wrapper(annotator, coords)[source]#