Exemple #1
0
    def make_morphologies(self):
        """Creating a Morphology object for each biophysical model"""
        for node in self._local_nodes:
            if node.cell_type == CellTypes.Biophysical:
                node_type_id = node.node_type_id
                morphology_file = node.morphology_file
                if node_type_id in self.__morphologies_cache:
                    # create a single morphology object for each model_group which share that morphology
                    morph = self.__morphologies_cache[node_type_id]

                    # associate morphology with a cell
                    self._cells[node.node_id].set_morphology(morph)

                else:
                    hobj = self._cells[
                        node.
                        node_id].hobj  # get hoc object (hobj) from the first cell with a new morphologys
                    morph = Morphology(hobj)

                    # associate morphology with a cell
                    self._cells[node.node_id].set_morphology(morph)

                    # create a single morphology object for each model_group which share that morphology
                    self.__morphologies_cache[node_type_id] = morph

        io.print2log0("    Created morphologies")
        self._morphologies_built = True
Exemple #2
0
    def make_morphologies(self):
        """Creating a Morphology object for each biophysical model"""
        # TODO: Let Morphology take care of the cache
        # TODO: Let other types have morphologies
        # TODO: Get all available morphologies from TypesTable or group
        for gid, cell in self._rank_node_gids.items():
            if not isinstance(cell, BioCell):
                continue

            morphology_file = cell.morphology_file
            if morphology_file in self._morphologies_cache:
                # create a single morphology object for each model_group which share that morphology
                morph = self._morphologies_cache[morphology_file]

                # associate morphology with a cell
                cell.set_morphology(morph)
                self._morphology_lookup[morphology_file].append(cell.gid)

            else:
                hobj = cell.hobj  # get hoc object (hobj) from the first cell with a new morphologys
                morph = Morphology(hobj)

                # associate morphology with a cell
                cell.set_morphology(morph)

                # create a single morphology object for each model_group which share that morphology
                self._morphologies_cache[morphology_file] = morph
                self._morphology_lookup[morphology_file] = [cell.gid]

        self.io.barrier()
Exemple #3
0
    def __init__(self, swc_file, random_seed=10):
        nrn.load_neuron_modules(None, None)
        self._hobj = h.Biophys1(swc_file)
        self._morphology = Morphology(self._hobj)
        self._morphology.set_seg_props()
        self._morphology.calc_seg_coords()
        self._prng = np.random.RandomState(random_seed)

        self._secs = []
        self._save_sections()