Exemplo n.º 1
0
 def test_coordinate_corresponding_to_axon_tips_type_20_valid(self):
     test_morphology = morphology.Morphology([
         test_node(id=1, type=SOMA, parent_node_id=-1),
         test_node(id=2, type=AXON, x=0, y=0, z=0, parent_node_id=1)
     ],
                                             strict_validation=False)
     mv.validate([test_marker(x=0, y=0, z=0, name=AXON)], test_morphology)
Exemplo n.º 2
0
 def test_coordinate_corresponding_to_dendrite_tips_type_20_valid(self):
     for dendrite_type in [BASAL_DENDRITE, APICAL_DENDRITE]:
         test_morphology = morphology.Morphology([
             test_node(id=1, type=SOMA, parent_node_id=-1),
             test_node(
                 id=2, type=dendrite_type, x=0, y=0, z=0, parent_node_id=1)
         ],
                                                 strict_validation=False)
         mv.validate([test_marker(x=1, y=0, z=0, name=AXON)],
                     test_morphology)
Exemplo n.º 3
0
 def test_coordinate_corresponding_to_dendrite_tips_type_20_valid(self):
     for dendrite_type in [BASAL_DENDRITE, APICAL_DENDRITE]:
         nodes = [
             test_node(id=1, type=SOMA, parent_node_id=-1),
             test_node(id=2,
                       type=dendrite_type,
                       x=0,
                       y=0,
                       z=0,
                       parent_node_id=1)
         ]
         mv.validate([test_marker(x=1, y=0, z=0, name=AXON)],
                     test_tree(nodes))
Exemplo n.º 4
0
    def test_coordinate_corresponding_to_dendrite_tips_multiple_cut_dendrite_invalid(
            self):
        for dendrite_type in [BASAL_DENDRITE, APICAL_DENDRITE]:
            nodes = [
                test_node(id=1, type=SOMA, parent_node_id=-1),
                test_node(id=2,
                          type=dendrite_type,
                          x=0,
                          y=0,
                          z=0,
                          parent_node_id=1),
                test_node(id=2,
                          type=dendrite_type,
                          x=0,
                          y=0,
                          z=0,
                          parent_node_id=1)
            ]
            errors = mv.validate([
                test_marker(x=1, y=0, z=0, name=CUT_DENDRITE),
                test_marker(x=1, y=0, z=0, name=TYPE_30)
            ], test_tree(nodes))

            self.assertMarkerErrors(
                errors,
                "Coordinates for each dendrite (type 10) needs to correspond to "
                "a tip of a dendrite type (type 3 or 4) in the related morphology",
                [[{
                    'x': 1,
                    'y': 0,
                    'z': 0,
                    'name': CUT_DENDRITE
                }]])
Exemplo n.º 5
0
 def test_number_of_type_30_less_than_one(self):
     test_morphology = morphology.Morphology(
         [test_node(id=1, type=SOMA, parent_node_id=-1)],
         strict_validation=False)
     errors = mv.validate([test_marker(name=NO_RECONSTRUCTION)],
                          test_morphology)
     self.assertMarkerErrors(errors, "Total number of type 30s is 0",
                             [[{}]])
Exemplo n.º 6
0
 def test_number_of_type_30_more_than_one(self):
     nodes = [test_node(id=1, type=SOMA, parent_node_id=-1)]
     errors = mv.validate(
         [test_marker(name=TYPE_30),
          test_marker(name=TYPE_30)], test_tree(nodes))
     self.assertMarkerErrors(errors, "Total number of type 30s is 2",
                             [[{
                                 'x': 0,
                                 'y': 0,
                                 'z': 0,
                                 'name': TYPE_30
                             }], [{
                                 'x': 0,
                                 'y': 0,
                                 'z': 0,
                                 'name': TYPE_30
                             }]])
Exemplo n.º 7
0
 def test_number_of_no_reconstruction_more_than_one(self):
     nodes = [test_node(id=1, type=SOMA, parent_node_id=-1)]
     errors = mv.validate([
         test_marker(name=NO_RECONSTRUCTION),
         test_marker(name=NO_RECONSTRUCTION)
     ], test_tree(nodes))
     self.assertMarkerErrors(
         errors, "Total number of type 20s is more than one: 2",
         [[{
             'x': 0,
             'y': 0,
             'z': 0,
             'name': NO_RECONSTRUCTION
         }], [{
             'x': 0,
             'y': 0,
             'z': 0,
             'name': NO_RECONSTRUCTION
         }]])
Exemplo n.º 8
0
 def test_number_of_type_30_more_than_one(self):
     test_morphology = morphology.Morphology(
         [test_node(id=1, type=SOMA, parent_node_id=-1)],
         strict_validation=False)
     errors = mv.validate(
         [test_marker(name=TYPE_30),
          test_marker(name=TYPE_30)], test_morphology)
     self.assertMarkerErrors(errors, "Total number of type 30s is 2",
                             [[{
                                 'x': 0,
                                 'y': 0,
                                 'z': 0,
                                 'name': TYPE_30
                             }], [{
                                 'x': 0,
                                 'y': 0,
                                 'z': 0,
                                 'name': TYPE_30
                             }]])
Exemplo n.º 9
0
    def test_coordinate_corresponding_to_axon_tips_no_reconstruction_invalid(
            self):
        nodes = [
            test_node(id=1, type=SOMA, parent_node_id=-1),
            test_node(id=2, type=AXON, x=0, y=0, z=0, parent_node_id=1)
        ]
        errors = mv.validate([
            test_marker(x=1, y=0, z=0, name=NO_RECONSTRUCTION),
            test_marker(x=1, y=0, z=0, name=TYPE_30)
        ], test_tree(nodes))

        self.assertMarkerErrors(
            errors,
            "Coordinates for each axon (type 20) needs to correspond to "
            "a tip of an axon type (type 2) in the related morphology",
            [[{
                'x': 1,
                'y': 0,
                'z': 0,
                'name': NO_RECONSTRUCTION
            }]])
Exemplo n.º 10
0
 def test_number_of_no_reconstruction_more_than_one(self):
     test_morphology = morphology.Morphology(
         [test_node(id=1, type=SOMA, parent_node_id=-1)],
         strict_validation=False)
     errors = mv.validate([
         test_marker(name=NO_RECONSTRUCTION),
         test_marker(name=NO_RECONSTRUCTION)
     ], test_morphology)
     self.assertMarkerErrors(
         errors, "Total number of type 20s is more than one: 2",
         [[{
             'x': 0,
             'y': 0,
             'z': 0,
             'name': NO_RECONSTRUCTION
         }], [{
             'x': 0,
             'y': 0,
             'z': 0,
             'name': NO_RECONSTRUCTION
         }]])
Exemplo n.º 11
0
 def test_coordinate_corresponding_to_axon_tips_type_20_valid(self):
     nodes = [
         test_node(id=1, type=SOMA, parent_node_id=-1),
         test_node(id=2, type=AXON, x=0, y=0, z=0, parent_node_id=1)
     ]
     mv.validate([test_marker(x=0, y=0, z=0, name=AXON)], test_tree(nodes))
Exemplo n.º 12
0
 def test_number_of_no_reconstruction_zero(self):
     nodes = [test_node(id=1, type=SOMA, parent_node_id=-1)]
     mv.validate([test_marker(name=CUT_DENDRITE)], test_tree(nodes))
Exemplo n.º 13
0
 def test_number_of_no_reconstruction_one(self):
     nodes = [test_node(id=1, type=SOMA, parent_node_id=-1)]
     mv.validate([test_marker(name=NO_RECONSTRUCTION)], test_tree(nodes))
Exemplo n.º 14
0
 def test_number_of_type_30_less_than_one(self):
     nodes = [test_node(id=1, type=SOMA, parent_node_id=-1)]
     errors = mv.validate([test_marker(name=NO_RECONSTRUCTION)],
                          test_tree(nodes))
     self.assertMarkerErrors(errors, "Total number of type 30s is 0",
                             [[{}]])
Exemplo n.º 15
0
 def test_number_of_type_30_one(self):
     nodes = [test_node(id=1, type=SOMA, parent_node_id=-1)]
     mv.validate([test_marker(name=TYPE_30)], test_tree(nodes))
Exemplo n.º 16
0
 def test_number_of_type_30_one(self):
     test_morphology = morphology.Morphology(
         [test_node(id=1, type=SOMA, parent_node_id=-1)],
         strict_validation=False)
     mv.validate([test_marker(name=TYPE_30)], test_morphology)
Exemplo n.º 17
0
 def test_number_of_no_reconstruction_zero(self):
     test_morphology = morphology.Morphology(
         [test_node(id=1, type=SOMA, parent_node_id=-1)],
         strict_validation=False)
     mv.validate([test_marker(name=CUT_DENDRITE)], test_morphology)
Exemplo n.º 18
0
 def test_number_of_no_reconstruction_one(self):
     test_morphology = morphology.Morphology(
         [test_node(id=1, type=SOMA, parent_node_id=-1)],
         strict_validation=False)
     mv.validate([test_marker(name=NO_RECONSTRUCTION)], test_morphology)