예제 #1
0
    def test_get_conf(self):
        ci = ConvertImage('ci')
        c = ci.get_config()
        nt.assert_list_equal(c.available_keys(), ['ci:type'])
        nt.assert_equal(c.get_value('ci:type'), '')

        ci = ConvertImage.create('ci', 'bypass')
        c = ci.get_config()
        nt.assert_equal(c.get_value('ci:type'), 'bypass')
예제 #2
0
    def test_set_name(self):
        algo_name = 'ci'
        other_name = "other_name"

        ci = ConvertImage(algo_name)
        nt.assert_equal(ci.name, algo_name)
        ci.set_name(other_name)
        nt.assert_not_equal(ci.name, algo_name)
        nt.assert_equal(ci.name, other_name)
예제 #3
0
    def test_set_conf(self):
        ci = ConvertImage('ci')
        nt.assert_false(ci)
        nt.assert_is_none(ci.impl_name())

        c = ConfigBlock()
        c.set_value('ci:type', 'bypass')
        ci.set_config(c)
        nt.assert_true(ci)
        nt.assert_equal(ci.impl_name(), 'bypass')
예제 #4
0
    def test_check_conf(self):
        ci = ConvertImage('ci')
        c = ConfigBlock()
        nt.assert_false(ci.check_config(c))

        c.set_value('ci:type', '')
        nt.assert_false(ci.check_config(c))

        c.set_value('ci:type', 'not_an_impl')
        nt.assert_false(ci.check_config(c))

        c.set_value('ci:type', 'bypass')
        nt.assert_true(ci.check_config(c))
예제 #5
0
    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
예제 #6
0
 def test_typename(self):
     ci = ConvertImage('ci')
     nt.assert_equal(ci.type_name(), "convert_image")
예제 #7
0
 def test_new(self):
     ci = ConvertImage('ci')
     nt.assert_false(ci)
     nt.assert_false(ci.c_pointer)
예제 #8
0
 def test_from_c_ptr_copy(self):
     ci = ConvertImage('ci')
     ci_new = ConvertImage.from_c_pointer(ci.c_pointer, ci)
     nt.assert_is(ci.c_pointer, ci_new.c_pointer)
     nt.assert_equal(ci_new.name, ci.name)
예제 #9
0
 def test_clone_empty(self):
     ci_empty = ConvertImage('ci')
     ci_empty2 = ci_empty.clone()
     nt.assert_false(ci_empty)
     nt.assert_false(ci_empty2)
예제 #10
0
 def test_impl_name(self):
     ci_empty = ConvertImage('ci')
     nt.assert_is_none(ci_empty.impl_name())
     ci_bypass = ConvertImage.create('ci', 'bypass')
     nt.assert_equal(ci_bypass.impl_name(), 'bypass')
예제 #11
0
 def test_name(self):
     name = 'algo_name'
     ci = ConvertImage(name)
     nt.assert_equal(ci.name, name)