napari_dmc_brainmap.padding package

Submodules

napari_dmc_brainmap.padding.padding module

DMC-BrainMap widget for padding .tif files to match atlas resolution.

2024 - FJ

class napari_dmc_brainmap.padding.padding.PaddingWidget(napari_viewer: Viewer)[source]

Bases: QWidget

QWidget for configuring and initiating the padding process for images.

progress_signal

Signal emitted to update the progress bar with an integer value.

napari_dmc_brainmap.padding.padding.count_images(input_path: Path, pad_folder: str, channels: List[str]) int[source]

Count the number of images in the specified folder and channels.

Parameters:
  • input_path (Path) – Path to the input directory.

  • pad_folder (str) – Name of the folder containing images to be padded.

  • channels (List[str]) – List of channels to count images for.

Returns:

The total count of images in the specified channels.

Return type:

int

napari_dmc_brainmap.padding.padding.do_padding(input_path: Path, channels: List[str], pad_folder: str, resolution: Tuple[int, int]) Generator[int, None, str][source]

Pad .tif images to match the atlas resolution.

Parameters:
  • input_path (Path) – Path to the input directory containing subfolders for images.

  • channels (List[str]) – List of channels to process.

  • pad_folder (str) – Name of the folder containing images to be padded.

  • resolution (Tuple[int, int]) – The desired resolution for padding.

Yields:

int – Progress value during padding.

Returns:

The animal ID of the processed images.

Return type:

str

napari_dmc_brainmap.padding.padding.initialize_widget() FunctionGui[source]

Initialize the MagicGUI widget for padding configuration.

Returns:

The initialized MagicGUI widget.

Return type:

FunctionGui

napari_dmc_brainmap.padding.padding.rename_image_files(tif_files: List[Path], input_path: Path, pad_folder: str, chan: str) None[source]

Rename image files to add ‘_stitched’ suffix if missing.

Parameters:
  • tif_files (List[Path]) – List of tif files to rename.

  • input_path (Path) – Path to the input directory.

  • pad_folder (str) – Name of the folder containing images to be renamed.

  • chan (str) – Channel name for which images are being renamed.

napari_dmc_brainmap.padding.padding.save_image_names_csv(tif_files: List[Path], input_path: Path) None[source]

Save the list of image names to ‘image_names.csv’ if it does not already exist.

Parameters:
  • tif_files (List[Path]) – List of tif files whose names are to be saved.

  • input_path (Path) – Path to the input directory.

Module contents