def test_viewer_processplugin_multiple(self): AddNoise = ProcessPlugin(add_noise, 'Add noise', dock='right') + \ Slider('noise_level', 0, 100, 0, orientation='vertical') Reduce = ProcessPlugin(make_black_y, 'Make black', dock='left') + \ Slider('x', 0, 128, 0, value_type='int', orientation='vertical') viewer = Viewer(RandomReader(shape=(128, 128, 3))) + AddNoise + Reduce viewer.show()
def test_viewer_interactive_plotting(self): Locate = PlottingPlugin(tp_locate, 'Locate', dock='right') + \ Slider('radius', 1, 20, 7, value_type='int', orientation='vertical') + \ Slider('separation', 1, 20, 7, value_type='float', orientation='vertical') + \ Slider('noise_size', 1, 20, 1, value_type='int', orientation='vertical') + \ Slider('minmass', 1, 10000, 100, value_type='int', orientation='vertical') viewer = Viewer(RandomReader(shape=(128, 128))) + Locate viewer.show()
import trackpy as tp from os import path from pimsviewer import Viewer, AnnotatePlugin from pims import pipeline @pipeline def as_grey(frame): return 0.2125 * frame[:, :, 0] + 0.7154 * frame[:, :, 1] + 0.0721 * frame[:, :, 2] filename = path.join(path.dirname(path.realpath(__file__)), '../screenshot.png') viewer = Viewer(filename) f = tp.batch(as_grey(viewer.reader), diameter=15) plugin = AnnotatePlugin(viewer, f) viewer.run()
try: from nd2reader import ND2Reader except ImportError(ND2Reader): pass from pimsviewer import Viewer viewer = Viewer() viewer.show()
def run(filename): app = Viewer(filename) app.run()
def test_viewer_3d_multichannel(self): viewer = Viewer(RandomReader(shape=(3, 10, 128, 128))) viewer.show()
def test_viewer_3d_rgb(self): viewer = Viewer(RandomReader(shape=(10, 128, 128, 3))) viewer.show()
def test_viewer_2d(self): viewer = Viewer(RandomReader(shape=(128, 128))) viewer.show()
def test_viewer_noreader(self): viewer = Viewer() viewer.show()
def test_viewer_annotate_3d(self): f = pd.DataFrame(np.random.random((3000, 3)) * np.array([100, 100, 30]) + 10, columns=['x', 'y', 'z']) f['frame'] = np.repeat(np.arange(10), 300) f['particle'] = np.tile(np.arange(300), 10) (Viewer(RandomReader(shape=(50, 128, 128))) + AnnotatePlugin(f)).show()
def test_viewer_annotate_mp(self): f = pd.DataFrame(np.random.random((300, 2)) * 100 + 10, columns=['x', 'y']) f['frame'] = np.repeat(np.arange(30), 10) f['particle'] = np.tile(np.arange(10), 30) (Viewer(RandomReader(shape=(128, 128, 3))) + AnnotatePlugin(f, frame_axes='tc')).show()
def test_viewer_processplugin(self): AddNoise = ProcessPlugin(add_noise, 'Add noise', dock='right') + \ Slider('noise_level', 0, 100, 0, orientation='vertical') viewer = Viewer(RandomReader()) + AddNoise viewer.show()
from pimsviewer import Viewer viewer = Viewer() viewer.run()