def __read_segment_list_v9(self):
"""
Read a list of Segments with comments.
This is version 9 of the data sequence.
This is the same as __read_segment_list_v8, but contains some
additional annotations. These annotations are added to the Segment.
--------------------------------------------------------
Returns a list of the Segments created with this method.
The returned objects are already added to the Block.
ID: 29120
"""
# segment_collection_v8 -- this is based off a segment_collection_v8
segments = self.__read_segment_list_v8()
# uint8
feature_type = np.fromfile(self._fsrc, dtype=np.uint8,
count=1)[0]
# uint8
go_by_closest_unit_center = np.fromfile(self._fsrc, dtype=np.bool8,
count=1)[0]
# uint8
include_unit_bounds = np.fromfile(self._fsrc, dtype=np.bool8,
count=1)[0]
# create a dictionary of the annotations
annotations = {'feature_type': feature_type,
'go_by_closest_unit_center': go_by_closest_unit_center,
'include_unit_bounds': include_unit_bounds}
# add the annotations to each Segment
for segment in segments:
segment.annotations.update(annotations)
return segments
评论列表
文章目录