Example #1
0
    def test_init(self):
        corrected = ImageSeries(name='corrected',
                                data=np.ones((1000, 100, 100)),
                                unit='na',
                                format='raw',
                                starting_time=0.0,
                                rate=1.0)

        xy_translation = TimeSeries(
            name='xy_translation',
            data=np.ones((1000, 2)),
            unit='pixels',
            starting_time=0.0,
            rate=1.0,
        )

        ip = create_imaging_plane()

        image_series = TwoPhotonSeries(name='TwoPhotonSeries1',
                                       data=np.ones((1000, 100, 100)),
                                       imaging_plane=ip,
                                       rate=1.0,
                                       unit='normalized amplitude')

        corrected_image_stack = CorrectedImageStack(
            corrected=corrected,
            original=image_series,
            xy_translation=xy_translation,
        )

        motion_correction = MotionCorrection(
            corrected_image_stacks=[corrected_image_stack])
        self.assertEqual(
            motion_correction.corrected_image_stacks['CorrectedImageStack'],
            corrected_image_stack)
Example #2
0
    def setUpContainer(self):
        """ Return the test ImagingPlane to read/write """

        self.device, self.optical_channel, self.imaging_plane = make_imaging_plane(
        )

        self.two_photon_series = TwoPhotonSeries(
            name='TwoPhotonSeries',
            data=np.ones((1000, 100, 100)),
            imaging_plane=self.imaging_plane,
            rate=1.0,
            unit='normalized amplitude')

        corrected = ImageSeries(name='corrected',
                                data=np.ones((1000, 100, 100)),
                                unit='na',
                                format='raw',
                                starting_time=0.0,
                                rate=1.0)

        xy_translation = TimeSeries(
            name='xy_translation',
            data=np.ones((1000, 2)),
            unit='pixels',
            starting_time=0.0,
            rate=1.0,
        )

        corrected_image_stack = CorrectedImageStack(
            corrected=corrected,
            original=self.two_photon_series,
            xy_translation=xy_translation,
        )

        return MotionCorrection(corrected_image_stacks=[corrected_image_stack])
Example #3
0
    def cicada_create_motion_correction(self):
        """  class pynwb.ophys.MotionCorrection(corrected_images_stacks={}, name='MotionCorrection')
        """

        # Nom du module où récupérer les infos de métadonnée
        name_module = "motion_correction_"

        corrected_images_stacks = {}

        self.motion_correction = MotionCorrection(
            corrected_images_stacks=corrected_images_stacks,
            name="MotionCorrection")

        self.mod.add_data_interface(self.motion_correction)
Example #4
0
 def test_init(self):
     MotionCorrection(list())
Example #5
0
 def test_init(self):
     mc = MotionCorrection('test_mc', list())
     self.assertEqual(mc.source, 'test_mc')
Example #6
0
xy_translation = TimeSeries(
    name='xy_translation',
    data=np.ones((1000, 2)),
    unit='pixels',
    starting_time=0.0,
    rate=1.0,
)

corrected_image_stack = CorrectedImageStack(
    corrected=corrected,
    original=image_series1,
    xy_translation=xy_translation,
)

motion_correction = MotionCorrection(
    corrected_image_stacks=[corrected_image_stack])

####################
# We will create a :py:class:`~pynwb.base.ProcessingModule` named "ophys" to store optical
# physiology data and add the motion correction data to the :py:class:`~pynwb.file.NWBFile`.
#

ophys_module = nwbfile.create_processing_module(
    name='ophys', description='optical physiology processed data')

ophys_module.add(motion_correction)

####################
# Plane Segmentation
# ---------------------------------
#