def construct_auxiliary_section(self, parent_section, child_section): """Construct an auxiliary section that connects the parent to the child, and add it to the auxiliary sections list. :param parent_section: A reference to the parent section. :param child_section: A reference to the child section. """ # A list of samples section_samples_list = list() # Add the parent section samples section_samples_list.extend(parent_section.samples_list) # Add the child section samples section_samples_list.extend(child_section.samples_list) # Construct the section section = vasculature_section.VasculatureSection( -1, section_samples_list) section.name = 'section_' + str(parent_section.index) + '_' + str( child_section.index) # Add the section to the auxiliary sections list self.auxiliary_sections_list.append(section)
def build_sections_list(self): """Builds a list of all the sections in the morphology to be able to skeletonize it """ print('STATUS: Build sections list') # For each section in the morphology sections list for i_section in range(len(self.morphology_sections_list) - 1): # The index of the first segment (or edge) along the section initial_segment_index = self.morphology_sections_list[i_section] # The index of the last segment (or edge) along the section final_segment_index = self.morphology_sections_list[i_section + 1] # Get a list that has all the samples of the section section_samples_list = self.get_samples_on_section( initial_segment_index, final_segment_index) # Construct the section section = vasculature_section.VasculatureSection( i_section, section_samples_list) # Add the section to the final list self.sections_list.append(section)