コード例 #1
0
def test_imaging_dataset_3d():
    global tmp_dir

    path = example_hdf5()
    seq = Sequence.create('HDF5', path, 'yxt')

    filepath = os.path.join(tmp_dir, "test_imaging_dataset_3d.sima")
    ds = ImagingDataset([seq, seq], filepath)
    assert_equal((ds.num_sequences,) + (ds.num_frames,) + ds.frame_shape,
                 (2, 40, 1, 128, 256, 1))
コード例 #2
0
def test_imaging_dataset_3d():
    global tmp_dir

    path = example_hdf5()
    seq = Sequence.create('HDF5', path, 'yxt')

    filepath = os.path.join(tmp_dir, "test_imaging_dataset_3d.sima")
    ds = ImagingDataset([seq, seq], filepath)
    assert_equal((ds.num_sequences, ) + (ds.num_frames, ) + ds.frame_shape,
                 (2, 40, 1, 128, 256, 1))
コード例 #3
0
ファイル: test__hmm.py プロジェクト: asaich/sima
    def setup(self):
        for frame in Sequence.create('HDF5', example_hdf5(), 'yxt'):
            break
        frame_shifts = [np.array([[[0, 0]], [[-5, -10]]])]
        self.frame_shifts = [np.array([[[5, 10]], [[0, 0]]])]
        self.correlations = [np.array([[1], [0.9301478]])]

        shifted = frame.copy()
        shifted = np.roll(shifted, -frame_shifts[0][1, 0, 1], axis=2)
        shifted = np.roll(shifted, -frame_shifts[0][1, 0, 0], axis=1)
        frames = np.array([frame, shifted])

        self.hm2d = hmm.HiddenMarkov2D(n_processes=1, verbose=False)
        self.dataset = sima.ImagingDataset(
            [Sequence.create('ndarray', frames)], None)
コード例 #4
0
ファイル: test_hmm.py プロジェクト: simone-codeluppi/sima
    def setup(self):
        for frame in Sequence.create('HDF5', example_hdf5(), 'yxt'):
            break
        frame_shifts = [np.array([[[0, 0]], [[-5, -10]]])]
        self.frame_shifts = [np.array([[[5, 10]], [[0, 0]]])]
        self.correlations = [np.array([[1], [0.9301478]])]

        shifted = frame.copy()
        shifted = np.roll(shifted, -frame_shifts[0][1, 0, 1], axis=2)
        shifted = np.roll(shifted, -frame_shifts[0][1, 0, 0], axis=1)
        frames = np.array([frame, shifted])

        self.hm2d = hmm.HiddenMarkov2D(n_processes=1, verbose=False)
        self.dataset = sima.ImagingDataset(
            [Sequence.create('ndarray', frames)], None)
コード例 #5
0
    def setup(self):
        global tmp_dir

        path = example_hdf5()
        seq = Sequence.create('HDF5', path, 'yxt')
        self.filepath = os.path.join(tmp_dir, "test_imaging_dataset.sima")
        self.ds = ImagingDataset([seq, seq], self.filepath)

        self.filepath_tiffs = os.path.join(tmp_dir, "test_dataset_tiffs.sima")
        seq = Sequence.create(
            'TIFFs', [[example_tiffs(), example_tiffs()],
                      [example_tiffs(), example_tiffs()],
                      [example_tiffs(), example_tiffs()],
                      [example_tiffs(), example_tiffs()]])
        self.ds_tiffs = ImagingDataset([seq, seq], self.filepath_tiffs)