コード例 #1
0
ファイル: test_segment.py プロジェクト: llerussell/sima
def test_STICA():
    ds = ImagingDataset.load(example_data())
    method = segment.STICA(components=5)
    method.append(segment.SparseROIsFromMasks(min_size=50))
    method.append(segment.SmoothROIBoundaries(radius=3))
    method.append(segment.MergeOverlapping(0.5))
    ds.segment(method)
コード例 #2
0
ファイル: test_segment.py プロジェクト: zhounapeuw/sima
def test_STICA():
    ds = ImagingDataset.load(example_data())
    method = segment.STICA(components=5)
    method.append(segment.SparseROIsFromMasks(min_size=50))
    method.append(segment.SmoothROIBoundaries(tolerance=1, min_verts=8))
    method.append(segment.MergeOverlapping(0.5))
    ds.segment(method)
コード例 #3
0
ファイル: test__hmm.py プロジェクト: asaich/sima
 def test_hmm_tmp(self):  # TODO: remove when displacements.pkl is updated
     global tmp_dir
     frames = Sequence.create('TIFF', example_tiff())
     with warnings.catch_warnings():
         warnings.filterwarnings("ignore", category=DeprecationWarning)
         corrected = self.hm2d.correct(
             [frames], os.path.join(tmp_dir, 'test_hmm_2.sima'))
     with open(misc.example_data() + '/displacements.pkl', 'rb') as fh:
         displacements = [d.reshape((20, 1, 128, 2))
                          for d in pickle.load(fh)]
     displacements_ = [seq.displacements for seq in corrected]
     assert_(abs(displacements_[0] - displacements[0]).max() <= 1)
コード例 #4
0
ファイル: test__hmm.py プロジェクト: asaich/sima
    def test_hmm(self):
        global tmp_dir

        frames = Sequence.create('TIFF', example_tiff())
        with warnings.catch_warnings():
            warnings.filterwarnings("ignore", category=DeprecationWarning)
            corrected = self.hm2d.correct(
                [frames], os.path.join(tmp_dir, 'test_hmm.sima'))

        with open(misc.example_data() + '/displacements.pkl', 'rb') as fh:
            displacements = [d.reshape((20, 1, 128, 2))
                             for d in pickle.load(fh)]

        displacements_ = [seq.displacements for seq in corrected]
        assert_almost_equal(displacements_, displacements)
コード例 #5
0
 def test_hmm_tmp(self):  # TODO: remove when displacements.pkl is updated
     global tmp_dir
     frames = Sequence.create('TIFF', example_tiff())
     with warnings.catch_warnings():
         warnings.filterwarnings("ignore", category=DeprecationWarning)
         corrected = self.hm2d.correct(
             [frames], os.path.join(tmp_dir, 'test_hmm_2.sima'))
     with open(misc.example_data() + '/displacements.pkl', 'rb') as fh:
         displacements = [d.reshape((20, 1, 128, 2))
                          for d in pickle.load(fh)]
     displacements_ = [seq.displacements for seq in corrected]
     diffs = displacements_[0] - displacements[0]
     assert_(
         ((diffs - diffs.mean(axis=2).mean(axis=1).mean(axis=0)) > 1).mean()
         <= 0.001)
コード例 #6
0
    def test_hmm(self):
        global tmp_dir

        frames = Sequence.create('TIFF', example_tiff())
        with warnings.catch_warnings():
            warnings.filterwarnings("ignore", category=DeprecationWarning)
            corrected = self.hm2d.correct(
                [frames], os.path.join(tmp_dir, 'test_hmm.sima'))

        with open(misc.example_data() + '/displacements.pkl', 'rb') as fh:
            displacements = [d.reshape((20, 1, 128, 2))
                             for d in pickle.load(fh)]

        displacements_ = [seq.displacements for seq in corrected]
        assert_almost_equal(displacements_, displacements)
コード例 #7
0
ファイル: test_segment.py プロジェクト: llerussell/sima
def test_PlaneCA1PC():
    ds = ImagingDataset.load(example_data())[:, :, :, :50, :50]
    method = segment.PlaneCA1PC(num_pcs=5)
    ds.segment(method)
コード例 #8
0
ファイル: test_segment.py プロジェクト: llerussell/sima
def test_PlaneNormalizedCuts():
    ds = ImagingDataset.load(example_data())[:, :, :, :50, :50]
    affinty_method = segment.BasicAffinityMatrix(num_pcs=5)
    method = segment.PlaneWiseSegmentation(
        segment.PlaneNormalizedCuts(affinty_method))
    ds.segment(method)
コード例 #9
0
ファイル: test_segment.py プロジェクト: zhounapeuw/sima
def test_PlaneCA1PC():
    ds = ImagingDataset.load(example_data())[:, :, :, :50, :50]
    method = segment.PlaneCA1PC(num_pcs=5)
    ds.segment(method)
コード例 #10
0
ファイル: test_segment.py プロジェクト: zhounapeuw/sima
def test_PlaneNormalizedCuts():
    ds = ImagingDataset.load(example_data())[:, :, :, :50, :50]
    affinty_method = segment.BasicAffinityMatrix(num_pcs=5)
    method = segment.PlaneWiseSegmentation(
        segment.PlaneNormalizedCuts(affinty_method))
    ds.segment(method)
コード例 #11
0
ファイル: test_segment.py プロジェクト: csn92/sima
def test_STICA():
    ds = ImagingDataset.load(example_data())
    method = segment.STICA(components=5)
    ds.segment(method)
コード例 #12
0
ファイル: test_segment.py プロジェクト: darkmajere/sima
def test_PlaneSTICA():
    ds = ImagingDataset.load(example_data())
    method = segment.PlaneSTICA(components=5)
    ds.segment(method)