From 79a347afa8b1e1c75355625f55d4de26848ef752 Mon Sep 17 00:00:00 2001 From: weiglszonja Date: Sat, 18 Nov 2023 21:14:41 +0100 Subject: [PATCH 1/6] add current version of motion correction --- .../widefield/utils/__init__.py | 1 + .../widefield/utils/motion_correction.py | 55 +++++++++++++++++++ .../widefield/widefieldnwbconverter.py | 51 +++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 src/pinto_lab_to_nwb/widefield/utils/__init__.py create mode 100644 src/pinto_lab_to_nwb/widefield/utils/motion_correction.py diff --git a/src/pinto_lab_to_nwb/widefield/utils/__init__.py b/src/pinto_lab_to_nwb/widefield/utils/__init__.py new file mode 100644 index 0000000..02c7ac8 --- /dev/null +++ b/src/pinto_lab_to_nwb/widefield/utils/__init__.py @@ -0,0 +1 @@ +from .motion_correction import load_motion_correction_data diff --git a/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py b/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py new file mode 100644 index 0000000..da9e816 --- /dev/null +++ b/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py @@ -0,0 +1,55 @@ +from pathlib import Path +from typing import List + +import natsort +import numpy as np +import pymatreader + + +def load_motion_correction_data(file_paths: List[str]) -> np.ndarray: + """Load motion correction data from mat files. + + Parameters + ---------- + file_paths: List[str] + A list of paths to the motion correction files. + + Returns + ------- + motion_correction_data: numpy.ndarray + The concatenated yx shifts from all the files. + """ + motion_correction_data = np.concatenate( + [get_yx_shifts(file_path=str(file)) for file in file_paths], axis=0) + return motion_correction_data + + +def get_yx_shifts(file_path: str) -> np.ndarray: + """Get the yx shifts from the motion correction file. + + Parameters + ---------- + file_path: str + The path to the motion correction file. + + Returns + ------- + motion_correction: numpy.ndarray + The first column is the y shifts. The second column is the x shifts. + """ + motion_correction_data = pymatreader.read_mat(file_path) + motion_correction = np.column_stack((motion_correction_data["yShifts"], motion_correction_data["xShifts"])) + return motion_correction + + +folder_path = Path("/Users/weian/data/widefield") +files = natsort.natsorted(folder_path.glob("*mcorr_1.mat")) +print(len(files)) +for file in files: + xy = get_yx_shifts(file_path=str(file)) + if not np.any(xy): + continue + for t in xy: + if np.any(t): + print(t) + print(file) diff --git a/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py b/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py index f97c922..9779801 100644 --- a/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py +++ b/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py @@ -1,7 +1,14 @@ """Primary NWBConverter class for this dataset.""" +from pathlib import Path +from typing import Optional, Dict + +from natsort import natsorted from neuroconv import NWBConverter +from neuroconv.tools import get_module +from pynwb import NWBFile, TimeSeries from pinto_lab_to_nwb.widefield.interfaces import WidefieldImagingInterface, WidefieldProcessedImagingInterface +from pinto_lab_to_nwb.widefield.utils import load_motion_correction_data class WideFieldNWBConverter(NWBConverter): @@ -13,3 +20,47 @@ class WideFieldNWBConverter(NWBConverter): ProcessedImagingBlue=WidefieldProcessedImagingInterface, ProcessedImagingViolet=WidefieldProcessedImagingInterface, ) + + def __init__(self, source_data: Dict[str, dict], verbose: bool = True): + super().__init__(source_data, verbose) + + # Load motion correction data + imaging_interface = self.data_interface_objects["ImagingBlue"] + imaging_folder_path = imaging_interface.source_data["folder_path"] + motion_correction_mat_files = natsorted(Path(imaging_folder_path).glob("*mcorr_1.mat")) + assert motion_correction_mat_files, f"No motion correction files found in {imaging_folder_path}." + self._motion_correction_data = load_motion_correction_data(file_paths=motion_correction_mat_files) + + def add_to_nwbfile(self, nwbfile: NWBFile, metadata, conversion_options: Optional[dict] = None) -> None: + super().add_to_nwbfile(nwbfile=nwbfile, metadata=metadata, conversion_options=conversion_options) + + # Add motion correction for blue and violet frames + interface_names = ["ImagingBlue", "ImagingViolet"] + for interface_name in interface_names: + channel_name = interface_name.replace("Imaging", "") + motion_correction_series_name = f"MotionCorrectionSeries{channel_name}" + assert motion_correction_series_name not in nwbfile.acquisition, (f"Motion correction series '{motion_correction_series_name}' already exists in NWBFile.") + imaging_interface = self.data_interface_objects[interface_name] + frame_indices = imaging_interface.imaging_extractor.frame_indices + + motion_correction = self._motion_correction_data[frame_indices, :] + num_frames = imaging_interface.imaging_extractor.get_num_frames() + if interface_name in conversion_options: + if "stub_test" in conversion_options[interface_name]: + if conversion_options[interface_name]["stub_test"]: + num_frames = 100 + motion_correction = motion_correction[:num_frames, :] + + assert motion_correction.shape[ + 0] == num_frames, f"The number of frames for motion correction ({motion_correction.shape[0]}) does not match the number of frames ({num_frames}) from the {interface_name} imaging interface." + + one_photon_series = nwbfile.acquisition[f"OnePhotonSeries{channel_name}"] + yx_time_series = TimeSeries( + name=motion_correction_series_name, + description=f"The yx shifts for the {channel_name.lower()} frames.", + data=motion_correction, + unit="px", + timestamps=one_photon_series.timestamps, + ) + ophys = get_module(nwbfile, "ophys") + ophys.add(yx_time_series) From 054ccb51f1fa469aabb7f0ef3dc8d75c0db74569 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 18 Nov 2023 21:19:12 +0000 Subject: [PATCH 2/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../widefield/utils/motion_correction.py | 3 +-- src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py b/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py index da9e816..66fc7be 100644 --- a/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py +++ b/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py @@ -19,8 +19,7 @@ def load_motion_correction_data(file_paths: List[str]) -> np.ndarray: motion_correction_data: numpy.ndarray The concatenated yx shifts from all the files. """ - motion_correction_data = np.concatenate( - [get_yx_shifts(file_path=str(file)) for file in file_paths], axis=0) + motion_correction_data = np.concatenate([get_yx_shifts(file_path=str(file)) for file in file_paths], axis=0) return motion_correction_data diff --git a/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py b/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py index 9779801..e9b4b7c 100644 --- a/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py +++ b/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py @@ -39,7 +39,9 @@ def add_to_nwbfile(self, nwbfile: NWBFile, metadata, conversion_options: Optiona for interface_name in interface_names: channel_name = interface_name.replace("Imaging", "") motion_correction_series_name = f"MotionCorrectionSeries{channel_name}" - assert motion_correction_series_name not in nwbfile.acquisition, (f"Motion correction series '{motion_correction_series_name}' already exists in NWBFile.") + assert ( + motion_correction_series_name not in nwbfile.acquisition + ), f"Motion correction series '{motion_correction_series_name}' already exists in NWBFile." imaging_interface = self.data_interface_objects[interface_name] frame_indices = imaging_interface.imaging_extractor.frame_indices @@ -51,8 +53,9 @@ def add_to_nwbfile(self, nwbfile: NWBFile, metadata, conversion_options: Optiona num_frames = 100 motion_correction = motion_correction[:num_frames, :] - assert motion_correction.shape[ - 0] == num_frames, f"The number of frames for motion correction ({motion_correction.shape[0]}) does not match the number of frames ({num_frames}) from the {interface_name} imaging interface." + assert ( + motion_correction.shape[0] == num_frames + ), f"The number of frames for motion correction ({motion_correction.shape[0]}) does not match the number of frames ({num_frames}) from the {interface_name} imaging interface." one_photon_series = nwbfile.acquisition[f"OnePhotonSeries{channel_name}"] yx_time_series = TimeSeries( From 50577af5b724ec38962804d90a1052d6b159b2c1 Mon Sep 17 00:00:00 2001 From: weiglszonja Date: Wed, 22 Nov 2023 14:30:52 +0100 Subject: [PATCH 3/6] fix motion correction to be added as x, y dimension order --- .../widefield/utils/motion_correction.py | 65 +++++++++++++------ .../widefield/widefield_requirements.txt | 1 + .../widefield/widefieldnwbconverter.py | 34 +++------- 3 files changed, 54 insertions(+), 46 deletions(-) diff --git a/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py b/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py index 66fc7be..853c444 100644 --- a/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py +++ b/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py @@ -1,9 +1,45 @@ -from pathlib import Path from typing import List -import natsort import numpy as np import pymatreader +from neuroconv.tools import get_module +from pynwb import NWBFile, TimeSeries + + +def add_motion_correction(nwbfile: NWBFile, motion_correction_series: np.ndarray, one_photon_series_name: str) -> None: + """Add motion correction data to the NWBFile. + + The x, y shifts for the imaging data (identified by 'one_photon_series_name' are added to the NWBFile as a TimeSeries. + The series is added to the 'ophys' processing module. + + Parameters + ---------- + nwbfile: NWBFile + The NWBFile where the motion correction time series will be added to. + motion_correction_series: numpy.ndarray + The x, y shifts for the imaging data. + one_photon_series_name: str + The name of the one photon series in the NWBFile. + """ + + assert one_photon_series_name in nwbfile.acquisition, f"The one photon series '{one_photon_series_name}' does not exist in the NWBFile." + name_suffix = one_photon_series_name.replace("OnePhotonSeries", "") + motion_correction_time_series_name = "MotionCorrectionSeries" + name_suffix + ophys = get_module(nwbfile, "ophys") + if motion_correction_time_series_name in ophys.data_interfaces: + raise ValueError(f"The motion correction time series '{motion_correction_time_series_name}' already exists in the NWBFile.") + + one_photon_series = nwbfile.acquisition[one_photon_series_name] + num_frames = one_photon_series.data.maxshape[0] + assert num_frames == motion_correction_series.shape[0], f"The number of frames for motion correction ({motion_correction_series.shape[0]}) does not match the number of frames ({num_frames}) from the {one_photon_series_name} imaging data." + xy_translation = TimeSeries( + name="MotionCorrectionSeries" + name_suffix, + description=f"The x, y shifts for the {one_photon_series_name} imaging data.", + data=motion_correction_series, + unit="px", + timestamps=one_photon_series.timestamps, + ) + ophys.add(xy_translation) def load_motion_correction_data(file_paths: List[str]) -> np.ndarray: @@ -17,14 +53,14 @@ def load_motion_correction_data(file_paths: List[str]) -> np.ndarray: Returns ------- motion_correction_data: numpy.ndarray - The concatenated yx shifts from all the files. + The concatenated xy shifts from all the files. """ - motion_correction_data = np.concatenate([get_yx_shifts(file_path=str(file)) for file in file_paths], axis=0) + motion_correction_data = np.concatenate([get_xy_shifts(file_path=str(file)) for file in file_paths], axis=0) return motion_correction_data -def get_yx_shifts(file_path: str) -> np.ndarray: - """Get the yx shifts from the motion correction file. +def get_xy_shifts(file_path: str) -> np.ndarray: + """Get the x, y (column, row) shifts from the motion correction file. Parameters ---------- @@ -34,21 +70,8 @@ def get_yx_shifts(file_path: str) -> np.ndarray: Returns ------- motion_correction: numpy.ndarray - The first column is the y shifts. The second column is the x shifts. + The first column is the x shifts. The second column is the y shifts. """ motion_correction_data = pymatreader.read_mat(file_path) - motion_correction = np.column_stack((motion_correction_data["yShifts"], motion_correction_data["xShifts"])) + motion_correction = np.column_stack((motion_correction_data["xShifts"], motion_correction_data["yShifts"])) return motion_correction - - -folder_path = Path("/Users/weian/data/widefield") -files = natsort.natsorted(folder_path.glob("*mcorr_1.mat")) -print(len(files)) -for file in files: - xy = get_yx_shifts(file_path=str(file)) - if not np.any(xy): - continue - for t in xy: - if np.any(t): - print(t) - print(file) diff --git a/src/pinto_lab_to_nwb/widefield/widefield_requirements.txt b/src/pinto_lab_to_nwb/widefield/widefield_requirements.txt index 686587a..5d0fa33 100644 --- a/src/pinto_lab_to_nwb/widefield/widefield_requirements.txt +++ b/src/pinto_lab_to_nwb/widefield/widefield_requirements.txt @@ -1 +1,2 @@ neuroconv[micromanagertiff] +pymatreader>=0.0.32 diff --git a/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py b/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py index e9b4b7c..4479896 100644 --- a/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py +++ b/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py @@ -4,11 +4,11 @@ from natsort import natsorted from neuroconv import NWBConverter -from neuroconv.tools import get_module -from pynwb import NWBFile, TimeSeries +from pynwb import NWBFile from pinto_lab_to_nwb.widefield.interfaces import WidefieldImagingInterface, WidefieldProcessedImagingInterface from pinto_lab_to_nwb.widefield.utils import load_motion_correction_data +from pinto_lab_to_nwb.widefield.utils.motion_correction import add_motion_correction class WideFieldNWBConverter(NWBConverter): @@ -35,35 +35,19 @@ def add_to_nwbfile(self, nwbfile: NWBFile, metadata, conversion_options: Optiona super().add_to_nwbfile(nwbfile=nwbfile, metadata=metadata, conversion_options=conversion_options) # Add motion correction for blue and violet frames - interface_names = ["ImagingBlue", "ImagingViolet"] - for interface_name in interface_names: - channel_name = interface_name.replace("Imaging", "") - motion_correction_series_name = f"MotionCorrectionSeries{channel_name}" - assert ( - motion_correction_series_name not in nwbfile.acquisition - ), f"Motion correction series '{motion_correction_series_name}' already exists in NWBFile." + imaging_interface_names = ["ImagingBlue", "ImagingViolet"] + for interface_name in imaging_interface_names: + photon_series_index = conversion_options[interface_name]["photon_series_index"] + one_photon_series_name = metadata["Ophys"]["OnePhotonSeries"][photon_series_index]["name"] + imaging_interface = self.data_interface_objects[interface_name] frame_indices = imaging_interface.imaging_extractor.frame_indices - + # filter motion correction for blue/violet frames motion_correction = self._motion_correction_data[frame_indices, :] - num_frames = imaging_interface.imaging_extractor.get_num_frames() if interface_name in conversion_options: if "stub_test" in conversion_options[interface_name]: if conversion_options[interface_name]["stub_test"]: num_frames = 100 motion_correction = motion_correction[:num_frames, :] - assert ( - motion_correction.shape[0] == num_frames - ), f"The number of frames for motion correction ({motion_correction.shape[0]}) does not match the number of frames ({num_frames}) from the {interface_name} imaging interface." - - one_photon_series = nwbfile.acquisition[f"OnePhotonSeries{channel_name}"] - yx_time_series = TimeSeries( - name=motion_correction_series_name, - description=f"The yx shifts for the {channel_name.lower()} frames.", - data=motion_correction, - unit="px", - timestamps=one_photon_series.timestamps, - ) - ophys = get_module(nwbfile, "ophys") - ophys.add(yx_time_series) + add_motion_correction(nwbfile=nwbfile, motion_correction_series=motion_correction, one_photon_series_name=one_photon_series_name) From ff3ba779fa664fdfaea60676a59fbba1c2bd76c3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:28:05 +0000 Subject: [PATCH 4/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../widefield/utils/motion_correction.py | 12 +++++++++--- .../widefield/widefieldnwbconverter.py | 6 +++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py b/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py index 853c444..e1d8ee3 100644 --- a/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py +++ b/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py @@ -22,16 +22,22 @@ def add_motion_correction(nwbfile: NWBFile, motion_correction_series: np.ndarray The name of the one photon series in the NWBFile. """ - assert one_photon_series_name in nwbfile.acquisition, f"The one photon series '{one_photon_series_name}' does not exist in the NWBFile." + assert ( + one_photon_series_name in nwbfile.acquisition + ), f"The one photon series '{one_photon_series_name}' does not exist in the NWBFile." name_suffix = one_photon_series_name.replace("OnePhotonSeries", "") motion_correction_time_series_name = "MotionCorrectionSeries" + name_suffix ophys = get_module(nwbfile, "ophys") if motion_correction_time_series_name in ophys.data_interfaces: - raise ValueError(f"The motion correction time series '{motion_correction_time_series_name}' already exists in the NWBFile.") + raise ValueError( + f"The motion correction time series '{motion_correction_time_series_name}' already exists in the NWBFile." + ) one_photon_series = nwbfile.acquisition[one_photon_series_name] num_frames = one_photon_series.data.maxshape[0] - assert num_frames == motion_correction_series.shape[0], f"The number of frames for motion correction ({motion_correction_series.shape[0]}) does not match the number of frames ({num_frames}) from the {one_photon_series_name} imaging data." + assert ( + num_frames == motion_correction_series.shape[0] + ), f"The number of frames for motion correction ({motion_correction_series.shape[0]}) does not match the number of frames ({num_frames}) from the {one_photon_series_name} imaging data." xy_translation = TimeSeries( name="MotionCorrectionSeries" + name_suffix, description=f"The x, y shifts for the {one_photon_series_name} imaging data.", diff --git a/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py b/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py index 7393304..b363ed7 100644 --- a/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py +++ b/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py @@ -60,4 +60,8 @@ def add_to_nwbfile(self, nwbfile: NWBFile, metadata, conversion_options: Optiona num_frames = 100 motion_correction = motion_correction[:num_frames, :] - add_motion_correction(nwbfile=nwbfile, motion_correction_series=motion_correction, one_photon_series_name=one_photon_series_name) + add_motion_correction( + nwbfile=nwbfile, + motion_correction_series=motion_correction, + one_photon_series_name=one_photon_series_name, + ) From 9747d59aaff2dff45db455e4ff24aded936b9a76 Mon Sep 17 00:00:00 2001 From: weiglszonja Date: Thu, 23 Nov 2023 15:47:08 +0100 Subject: [PATCH 5/6] add dtype conversion to motion correction data --- .../widefield/utils/motion_correction.py | 13 +++++++++++-- .../widefield/widefieldnwbconverter.py | 5 ++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py b/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py index e1d8ee3..2facf76 100644 --- a/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py +++ b/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py @@ -4,9 +4,15 @@ import pymatreader from neuroconv.tools import get_module from pynwb import NWBFile, TimeSeries +from roiextractors.extraction_tools import DtypeType -def add_motion_correction(nwbfile: NWBFile, motion_correction_series: np.ndarray, one_photon_series_name: str) -> None: +def add_motion_correction( + nwbfile: NWBFile, + motion_correction_series: np.ndarray, + one_photon_series_name: str, + convert_to_dtype: DtypeType = None, +) -> None: """Add motion correction data to the NWBFile. The x, y shifts for the imaging data (identified by 'one_photon_series_name' are added to the NWBFile as a TimeSeries. @@ -20,7 +26,10 @@ def add_motion_correction(nwbfile: NWBFile, motion_correction_series: np.ndarray The x, y shifts for the imaging data. one_photon_series_name: str The name of the one photon series in the NWBFile. + convert_to_dtype: DtypeType, optional + The dtype to convert the motion correction series to. """ + convert_to_dtype = convert_to_dtype or np.uint16 assert ( one_photon_series_name in nwbfile.acquisition @@ -41,7 +50,7 @@ def add_motion_correction(nwbfile: NWBFile, motion_correction_series: np.ndarray xy_translation = TimeSeries( name="MotionCorrectionSeries" + name_suffix, description=f"The x, y shifts for the {one_photon_series_name} imaging data.", - data=motion_correction_series, + data=motion_correction_series.astype(dtype=convert_to_dtype), unit="px", timestamps=one_photon_series.timestamps, ) diff --git a/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py b/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py index b363ed7..2d96310 100644 --- a/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py +++ b/src/pinto_lab_to_nwb/widefield/widefieldnwbconverter.py @@ -2,6 +2,7 @@ from pathlib import Path from typing import Optional, Dict +import numpy as np from natsort import natsorted from neuroconv import NWBConverter from pynwb import NWBFile @@ -37,7 +38,8 @@ def __init__(self, source_data: Dict[str, dict], verbose: bool = True): # Load motion correction data imaging_interface = self.data_interface_objects["ImagingBlue"] imaging_folder_path = imaging_interface.source_data["folder_path"] - motion_correction_mat_files = natsorted(Path(imaging_folder_path).glob("*mcorr_1.mat")) + imaging_folder_name = Path(imaging_folder_path).stem + motion_correction_mat_files = natsorted(Path(imaging_folder_path).glob(f"{imaging_folder_name}*mcorr_1.mat")) assert motion_correction_mat_files, f"No motion correction files found in {imaging_folder_path}." self._motion_correction_data = load_motion_correction_data(file_paths=motion_correction_mat_files) @@ -64,4 +66,5 @@ def add_to_nwbfile(self, nwbfile: NWBFile, metadata, conversion_options: Optiona nwbfile=nwbfile, motion_correction_series=motion_correction, one_photon_series_name=one_photon_series_name, + convert_to_dtype=np.uint16, ) From 76636c98a8cb5cedfc09b431fb196637571d5530 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 14:50:30 +0000 Subject: [PATCH 6/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/pinto_lab_to_nwb/widefield/utils/motion_correction.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py b/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py index 2facf76..320be1f 100644 --- a/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py +++ b/src/pinto_lab_to_nwb/widefield/utils/motion_correction.py @@ -8,10 +8,10 @@ def add_motion_correction( - nwbfile: NWBFile, - motion_correction_series: np.ndarray, - one_photon_series_name: str, - convert_to_dtype: DtypeType = None, + nwbfile: NWBFile, + motion_correction_series: np.ndarray, + one_photon_series_name: str, + convert_to_dtype: DtypeType = None, ) -> None: """Add motion correction data to the NWBFile.