def __init__(self): AlgorithmPluginManager.register_plugins() # Algorithms self.algo_convert_img = ConvertImage("convert_image") self.algo_image_io = ImageIo("image_reader") self.algo_track_features = TrackFeatures("feature_tracker") # Other tool variables self.image_list_filepath = None self.mask_list_filepath = None self.invert_masks = False self.expect_multichannel_masks = False self.output_tracks_filepath = None
def base_algorithms(c=ConfigBlock()): """ Determine the algorithms and algorithm names used in this utility :type c: vital.ConfigBlock """ iio = ImageIo('image_reader') iio.set_config(c) ci = ConvertImage('convert_image') ci.set_config(c) tf = TrackFeatures('feature_tracker') tf.set_config(c) return iio, ci, tf
def test_image_load_save_diff(self): fd, tmp_filename = tempfile.mkstemp() c = ConfigBlock() c.set_value('iio:type', 'vxl') iio = ImageIo('iio') iio.set_config(c) nt.assert_true(osp.isfile(self.test_image_filepath), "Couldn't find image file") ic_orig = iio.load(self.test_image_filepath) iio.save(ic_orig, tmp_filename) ic_test = iio.load(tmp_filename) nt.assert_equal(ic_orig.size(), ic_test.size()) nt.assert_equal(ic_orig.width(), ic_test.width()) nt.assert_equal(ic_orig.height(), ic_test.height()) nt.assert_equal(ic_orig.depth(), ic_test.depth()) os.remove(tmp_filename) os.close(fd)