def getSingleSectionSoma(cls, rad=None, area=None): assert (rad or area) and not(rad and area) if area: area = convertToUnit(area, defaultUnit="um2" ).rescale("um2").magnitude rad = numpy.power((area / (4.0 * numpy.pi)), 1.0 / 2.0) else: assert isinstance(int,rad) or isinstance(float,rad) rad = convertToUnit(rad, defaultUnit="um" ).rescale("um").magnitude somaRegion = Region("soma") dummysection = Section(region=None, x=0.0, y=0.0, z=0.0, r=rad) dummysection.extrudeChildSection(region=somaRegion, x=rad * 2.0, y=0.0, z=0.0, r=rad, idTag="soma") cell = MorphologyTree("SimpleSomaMorph", dummysection=dummysection, metadata={}) return cell
def getSomaAxonMorph(cls, axonLength=1000.0, axonRad=0.3, somaRad=20.0, axonSections=10): somaRegion = Region("soma") axonRegion = Region("axon") axonSectionLength = float(axonLength) / float(axonSections) dummyRoot = Section(region=None, x=0.0, y=0.0, z=0.0, r=somaRad) soma = dummyRoot.extrudeChildSection(region=somaRegion, x=somaRad * 2.0, y=0.0, z=0.0, r=somaRad, idTag="soma") prevSection = soma for x in range(1, axonSections): axon = prevSection.extrudeChildSection(region=axonRegion, x=x * axonSectionLength + 2.0 * somaRad, y=0, z=0, r=axonRad, idTag="axon_%d" % x) prevSection = axon cell = MorphologyTree("SimpleSomaAxonMorph", dummysection=dummyRoot, metadata={}) return cell