photon_mosaic_pipeline.paths_selection#

Functions

adapt_paths_to_output_pattern(...)

Convert raw TIFF paths to their expected preprocessed output paths.

find_raw_data_paths(project_path[, ...])

Find all raw TIFF files under a NeuroBlueprint-compliant project.

set_up_dff_targets(preproc_targets)

Generate dF/F target paths from preprocessed TIFF paths.

set_up_neuropil_targets(preproc_targets)

Generate neuropil correction target paths from preprocessed TIFF paths.

set_up_suite2p_targets(preproc_targets)

Generate Suite2p output target paths from preprocessed TIFF paths.

photon_mosaic_pipeline.paths_selection.find_raw_data_paths(project_path, tiff_patterns=['*.tif'], exclude_datasets=None, exclude_sessions=None)[source]#

Find all raw TIFF files under a NeuroBlueprint-compliant project.

Parameters:
  • project_path (Path) – Root of the project, expected to follow NeuroBlueprint format (i.e. contains a rawdata/sub-*/ses-*/funcimg/ structure).

  • tiff_patterns (list[str]) – Glob patterns for TIFF files to include (e.g. ["*_00001.tif"]).

  • exclude_datasets (list[str] | None) – Regex patterns matched against subject folder names to exclude (e.g. [“sub-test”, “sub-IAA.*”]).

  • exclude_sessions (list[str] | None) – Regex patterns matched against session folder names to exclude (e.g. [“.*protocol-screening.*”, “ses-screening.*”]).

Returns:

Sorted list of paths to all matching TIFF files.

Return type:

list[Path]

photon_mosaic_pipeline.paths_selection.adapt_paths_to_output_pattern(all_selected_tiff_paths, output_pattern)[source]#

Convert raw TIFF paths to their expected preprocessed output paths.

Replaces the rawdata directory component with derivatives and prepends output_pattern to the filename.

Parameters:
  • all_selected_tiff_paths (list[Path]) – Raw TIFF paths, expected to contain a rawdata component.

  • output_pattern (str) – String to prepend to the output filename (e.g. motion_corrected_).

Returns:

Corresponding output paths under the derivatives directory.

Return type:

list[str]

Raises:

ValueError – If a path does not contain a rawdata component.

photon_mosaic_pipeline.paths_selection.set_up_suite2p_targets(preproc_targets)[source]#

Generate Suite2p output target paths from preprocessed TIFF paths.

For each preprocessed TIFF, generates the expected Suite2p output files (F.npy and data.bin) under a suite2p/plane0/ subdirectory.

Parameters:

preproc_targets (list[str]) – Preprocessed TIFF paths (output of adapt_paths_to_output_pattern).

Returns:

Suite2p target paths (F.npy and data.bin for each input).

Return type:

list[str]

photon_mosaic_pipeline.paths_selection.set_up_neuropil_targets(preproc_targets)[source]#

Generate neuropil correction target paths from preprocessed TIFF paths.

For each preprocessed TIFF, generates the expected neuropil output files under a neuropil/plane0/ subdirectory.

Parameters:

preproc_targets (list[str]) – Preprocessed TIFF paths (output of adapt_paths_to_output_pattern).

Returns:

Neuropil target paths (Fc.npy for each input).

Return type:

list[str]

photon_mosaic_pipeline.paths_selection.set_up_dff_targets(preproc_targets)[source]#

Generate dF/F target paths from preprocessed TIFF paths.

For each preprocessed TIFF, generates the expected dFF output files under a dff/plane0/ subdirectory.

Parameters:

preproc_targets (list[str]) – Preprocessed TIFF paths (output of adapt_paths_to_output_pattern).

Returns:

dFF target paths (dFF.npy for each input).

Return type:

list[str]