registration_orchestrator#

class MiniBrain[source]#

Bases: TypedDict

A downscaled brain for quick visualization It includes the downscaled image and the scaling factors

array: ndarray#
scaling: tuple[float, float, float]#
class RegistrationProcessor(sample_manager: SampleManager, cfg_coordinator: ConfigCoordinator)[source]#

Bases: PipelineOrchestrator

This class is used to manage the registration process Perform image registration operations. Manage atlas setup and transformations. Handle registration configurations.

add_pipeline()[source]#
align(*args, _force=False, **kwargs)#
align_channel(channel)[source]#
channel_was_registered(channel)[source]#
channels_to_register()[source]#
channels_to_resample()[source]#
clear_landmarks(channel=None)[source]#

Clear (remove) the landmarks files

create_atlas_asset(annotator, channel_spec)[source]#
get(asset_type, channel='current', asset_sub_type=None, **kwargs)[source]#

Get an asset, automatically resolving registration template variables for asset types that require parametrisation (e.g. registration (Elastix) assets, where moving/fixed channels are conditional).

Parameters:
  • asset_type (str) – The asset type name.

  • channel (str) – The channel name.

  • asset_sub_type (str or None) – Optional sub-type.

  • **kwargs – Forwarded to the parent get.

Returns

Asset

The resolved asset.

get_align_with(channel)[source]#
get_aligned_image(channel)[source]#
get_atlas_files()[source]#
get_elx_asset(asset_type, channel)[source]#
get_fixed_image(channel)[source]#
get_fixed_moving_channels(channel)[source]#
get_img_to_register(channel, other_channel)[source]#
get_moving_channel(channel: str) str[source]#

Get the moving channel for a given channel

Warning

Contrary to get_fixed_moving_channels, this method does not check for the existence of the fixed channel. It simply returns the moving channel as specified in the config.

Parameters:

channel (str) – The channel to get the moving channel for

Returns

str

The moving channel

get_moving_image(channel)[source]#
get_registration_sequence_channels(first_channel, stop_channel='atlas')[source]#
parametrize_assets()[source]#
plot_atlas(channel)[source]#
plot_registration_results(channel, composite=False, parent=None)[source]#
project_mini_brain(channel)[source]#

Project the mini brain of the channel as a mask and a surface projection

Parameters:

channel (str) – The channel to project

Returns

np.ndarray, np.ndarray

The mask and the projection

registration_status()[source]#
resample_channel(channel, increment_main=False)[source]#
resample_for_registration(*args, _force=False, **kwargs)#
setup(sample_manager: SampleManager | None = None)[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.

setup_atlases(event=None)[source]#
update_atlas_asset(channel, annotator=None)[source]#
annotators: Dict[str, Annotation]#
property channels#
config_name = 'registration'#
mini_brains: Dict[str, MiniBrain]#
property n_registration_steps#
progress_watcher: 'ProgressWatcher' | None#
property ref_channel_cfg#
property registration_params_files#
sample_manager: SampleManager#
setup_complete: bool#
property was_registered#
class RegistrationStatus(value)[source]#

Bases: Enum

MISSING_OUTPUTS = 1#
NOT_SELECTED = 0#
REGISTERED = 2#
setup_mini_brain(atlas_base_name, mini_brain_scaling=(5, 5, 5))[source]#

Create a downsampled version of the Allen Brain Atlas for the mini brain widget

Parameters:

mini_brain_scaling (tuple(int, int, int)) – The scaling factors for the mini brain. Default is (5, 5, 5)

Returns

tuple(scale, downsampled_array)