本文整理汇总了Python中CompuCell.getConcentrationField方法的典型用法代码示例。如果您正苦于以下问题:Python CompuCell.getConcentrationField方法的具体用法?Python CompuCell.getConcentrationField怎么用?Python CompuCell.getConcentrationField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CompuCell
的用法示例。
在下文中一共展示了CompuCell.getConcentrationField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: start
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getConcentrationField [as 别名]
def start(self):
self.pt=CompuCell.Point3D() # set uniform VEGF_ext field for ECM
self.tempvar=os.getcwd()+"/vasculo_steppableBasedMitosis_py_"+run_time+"_Data.txt"
totaldatafilename=open(self.tempvar, "w")
totaldatafilename.write("MCS\tId\tType\tVolume\tSurfaceArea\tX_Location\tY_Location\tVEGF165\tVEGF121\tTotalVEGF\tCXCL10\tCCL2\tGrowing\tArrested\tQuiescent\tApoptotic\tTotal Cell Number\n") #first row, tab delimited
totaldatafilename.close()
for x in range(self.dim.x):
for y in range(self.dim.y):
CompuCell.getConcentrationField(self.simulator,"VEGF_ext").set(self.pt,.05)
for cell in self.cellList:
if cell.type==1: # endothelial stalk cells
cell.targetVolume=30
cell.lambdaVolume=6.0
cell.targetSurface=4*sqrt(cell.targetVolume)
cell.lambdaSurface=4.0
if cell.type==2: # macrophage/inflammatory cells
cell.targetVolume=40
cell.lambdaVolume=6.0
cell.targetSurface=4*sqrt(cell.targetVolume)
cell.lambdaSurface=4.0
if cell.type==3: # mural/VSMC cells
cell.targetVolume=50
cell.lambdaVolume=6.0
cell.targetSurface=4*sqrt(cell.targetVolume)
cell.lambdaSurface=4.0
if cell.type==4: # endothelial tip cells
cell.targetVolume=30
cell.lambdaVolume=6.0
cell.targetSurface=5*sqrt(cell.targetVolume)
cell.lambdaSurface=8.0
示例2: step
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getConcentrationField [as 别名]
def step(self,mcs):
pass
# for cell in self.cellList:
# cell.targetVolume+=1
# alternatively if you want to make growth a function of chemical concentration uncomment lines below and comment lines above
O2field=CompuCell.getConcentrationField(self.simulator,"OXYGEN")
MMPfield=CompuCell.getConcentrationField(self.simulator,"MMP")
pt=CompuCell.Point3D()
for cell in self.cellList:
pt.x=int(cell.xCOM)
pt.y=int(cell.yCOM)
pt.z=int(cell.zCOM)
O2Conc=O2field.get(pt)
MMPConc=MMPfield.get(pt)
if O2Conc < 0: print('--------~~~~~~~~~-----> O2 VERY LOW')
print '------///------>',cell.targetVolume, O2Conc, MMPConc
if cell.type == self.NORM and MMPConc > 1:
print 'MMP CONC IS CRAZY!'
# raw_input('!')
cell.targetVolume -= 0.5
cell.lambdaVolume = 2
# raw_input('!-->removing a NORM cell')
else:
# if True:
if cell.type == self.TPROL and O2Conc < 0:
cell.type = self.TMIGR
continue
# O2Conc = np.abs(O2Conc)
cell.targetVolume+=0.01*O2Conc / (0.05 + O2Conc) # you can use here any fcn of concentrationAtCOM
示例3: step
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getConcentrationField [as 别名]
def step(self,mcs):
fieldVEGF2=CompuCell.getConcentrationField(self.simulator,self.fieldNameVEGF2)
fieldGlucose=CompuCell.getConcentrationField(self.simulator,self.fieldNameGlucose)
print mcs
for cell in self.cellList:
#print cell.volume
#NeoVascular
if cell.type == self.NEOVASCULAR:
totalArea = 0
# pt=CompuCell.Point3D()
# pt.x=int(round(cell.xCM/max(float(cell.volume),0.001)))
# pt.y=int(round(cell.yCM/max(float(cell.volume),0.001)))
# pt.z=int(round(cell.zCM/max(float(cell.volume),0.001)))
# VEGFConcentration=fieldVEGF2.get(pt)
VEGFConcentration=fieldVEGF2[int(round(cell.xCOM)),int(round(cell.yCOM)),int(round(cell.zCOM))]
# cellNeighborList=CellNeighborListAuto(self.nTrackerPlugin,cell)
cellNeighborList=self.getCellNeighbors(cell)
for neighborSurfaceData in cellNeighborList:
#Check to ensure cell neighbor is not medium
if neighborSurfaceData.neighborAddress:
if neighborSurfaceData.neighborAddress.type == self.VASCULAR or neighborSurfaceData.neighborAddress.type == self.NEOVASCULAR:
#sum up common surface area of cell with its neighbors
totalArea+=neighborSurfaceData.commonSurfaceArea
#print " commonSurfaceArea:",neighborSurfaceData.commonSurfaceArea
#print totalArea
if totalArea < 45:
#Growth rate equation
cell.targetVolume+=2.0*VEGFConcentration/(0.01 + VEGFConcentration)
print "totalArea", totalArea,"cell growth rate: ", 2.0*VEGFConcentration/(0.01 + VEGFConcentration),"cell Volume: ", cell.volume
#Proliferating Cells
if cell.type == self.PROLIFERATING:
# pt=CompuCell.Point3D()
# pt.x=int(round(cell.xCM/max(float(cell.volume),0.001)))
# pt.y=int(round(cell.yCM/max(float(cell.volume),0.001)))
# pt.z=int(round(cell.zCM/max(float(cell.volume),0.001)))
# GlucoseConcentration=fieldGlucose.get(pt)
GlucoseConcentration=fieldGlucose[int(round(cell.xCOM)),int(round(cell.yCOM)),int(round(cell.zCOM))]
# Proliferating Cells become Necrotic when GlucoseConcentration is low
if GlucoseConcentration < 0.001 and mcs>1000:
cell.type = self.NECROTIC
#set growth rate equation -- fastest cell cycle is 24hours or 1440 mcs--- 32voxels/1440mcs= 0.022 voxel/mcs
cell.targetVolume+=0.022*GlucoseConcentration/(0.05 + GlucoseConcentration)
#print "growth rate: ", 0.044*GlucoseConcentration/(0.05 + GlucoseConcentration), "GlucoseConcentration", GlucoseConcentration
#Necrotic Cells
if cell.type == self.NECROTIC:
#sNecrotic Cells shrink at a constant rate
cell.targetVolume-=0.1
示例4: getMinConcentrationFieldAtCellId
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getConcentrationField [as 别名]
def getMinConcentrationFieldAtCellId(self, fieldName, cellId):
cell = self.getCellWithId(cellId)
chemField=CompuCell.getConcentrationField(self.simulator,fieldName)
pixelList=CellPixelList(self.pixelTrackerPlugin,cell)
minConc = 1000000
for pixelData in pixelList:
pt=pixelData.pixel
conc = chemField.get(pt)
minConc = min(minConc, conc)
return minConc
示例5: getConcentrationFieldAtCell
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getConcentrationField [as 别名]
def getConcentrationFieldAtCell(self, fieldName, cell):
chemField=CompuCell.getConcentrationField(self.simulator,fieldName)
pt=CompuCell.Point3D()
pt.x=int(round(cell.xCOM))
pt.y=int(round(cell.yCOM))
pt.z=int(round(cell.zCOM))
# pt.x=int(round(cell.xCM/max(float(cell.volume),0.001)))
# pt.y=int(round(cell.yCM/max(float(cell.volume),0.001)))
# pt.z=int(round(cell.zCM/max(float(cell.volume),0.001)))
return chemField.get(pt)
示例6: step
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getConcentrationField [as 别名]
def step(self,mcs):
field=CompuCell.getConcentrationField(self.simulator,"FGF")
for cell in self.cellList:
if cell.type==self.CONDENSING and mcs < 1500: #Condensing cell
concentration=field[int(round(cell.xCOM)),int(round(cell.yCOM)),int(round(cell.zCOM))]
cell.targetVolume+=0.1*concentration # increase cell's target volume
if mcs > 1500: #removing all cells
cell.targetVolume-=1 # increase cell's target volume
if cell.targetVolume<0.0:
cell.targetVolume=0.0
示例7: start
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getConcentrationField [as 别名]
def start(self):
if self.hinder_anterior_cells == True:
self.gene_product_field = CompuCell.getConcentrationField(self.simulator,"EN_GENE_PRODUCT")
self.gene_product_secretor = self.getFieldSecretor("EN_GENE_PRODUCT")
for cell in self.cellList: # THIS BLOCK HAS BEEN JUSTIFIED OUTSIDE OF EARLIER "IF" STATEMENT (sdh)
self.stripe_y = 645 #375
if cell.yCOM < self.stripe_y+5 and cell.yCOM > self.stripe_y-5:
# cellDict["En_ON"] = True
cell.type = 2 # EN cell
if self.hinder_anterior_cells == True:
self.gene_product_secretor.secreteInsideCell(cell, 1)
示例8: start
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getConcentrationField [as 别名]
def start(self):
if self.hinder_anterior_cells == True:
self.gene_product_field = CompuCell.getConcentrationField(self.simulator,"EN_GENE_PRODUCT")
self.gene_product_secretor = self.getFieldSecretor("EN_GENE_PRODUCT")
for cell in self.cellList:
self.stripe_y = 375
if cell.yCOM < self.stripe_y+5 and cell.yCOM > self.stripe_y-5:
#cellDict["En_ON"] = True
cell.type = 2
if self.hinder_anterior_cells == True:
self.gene_product_secretor.secreteInsideCell(cell, 1)
示例9: start
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getConcentrationField [as 别名]
def start(self):
if self.hinder_anterior_cells:
self.gene_product_field = CompuCell.getConcentrationField(self.simulator,'EN_GENE_PRODUCT')
self.gene_product_secretor = self.getFieldSecretor('EN_GENE_PRODUCT')
for cell in self.cellList: # THIS BLOCK HAS BEEN JUSTIFIED OUTSIDE OF EARLIER 'IF' STATEMENT (sdh)
self.stripe_y = self.initial_stripe
if cell.yCOM < self.stripe_y+self.stripe_width/2 and cell.yCOM > self.stripe_y-self.stripe_width/2:
cell.type = 2 # EN cell
if self.hinder_anterior_cells == True:
self.gene_product_secretor.secreteInsideCell(cell, 1)
示例10: step
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getConcentrationField [as 别名]
def step(self,mcs):
fileName="diffusion_output/FGF_"+str(mcs)+".dat"
field=CompuCell.getConcentrationField(self.simulator,"FGF")
if field:
try:
import CompuCellSetup
fileHandle,fullFileName=CompuCellSetup.openFileInSimulationOutputDirectory(fileName,"w")
except IOError:
print "Could not open file ", fileName," for writing. Check if you have necessary permissions"
for i,j,k in self.everyPixel():
fileHandle.write("%d\t%d\t%d\t%f\n"%(i,j,k,field[i,j,k]))
fileHandle.close()
示例11: step
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getConcentrationField [as 别名]
def step(self,mcs):
print "INSIDE MITOSIS STEPPABLE"
self.fieldNeoVasc=CompuCell.getConcentrationField(self.simulator,self.fieldNameExternalVEGF)
self.fieldNeoVascSol=CompuCell.getConcentrationField(self.simulator,self.fieldNameSolubleVEGF)
cells_to_divide=[]
for cell in self.cellList:
vasculo_attributes=CompuCell.getPyAttrib(cell)
if cell.type==1:
if cell.volume>55:
cells_to_divide.append(cell)
if cell.type==3:
if cell.volume>90:
cells_to_divide.append(cell)
if cell.type==2:
if cell.volume>75:
cells_to_divide.append(cell)
for cell in cells_to_divide:
# to change mitosis mode leave one of the below lines uncommented
self.divideCellRandomOrientation(cell)
示例12: step
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getConcentrationField [as 别名]
def step(self, mcs):
field = CompuCell.getConcentrationField(self.simulator, "FGF")
comPt = CompuCell.Point3D()
for cell in self.cellList:
if cell.type == self.CONDENSING:
# get the coordinates of the current cells loation
comPt.x = int(round(cell.xCOM))
comPt.y = int(round(cell.yCOM))
comPt.z = int(round(cell.zCOM))
# use the point to get the concentration at this location
conc = field.get(comPt)
cell.targetVolume += 0.1 * conc
示例13: start
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getConcentrationField [as 别名]
def start(self):
#initial condition for diffusion field
self.field=CompuCell.getConcentrationField(self.simulator,"FGF")
# import numpy as np
# self.fieldNP = np.zeros(shape=(self.dim.x,self.dim.y,self.dim.z),dtype=np.float32)
# fieldNP[:]=field
#a bit slow - will write faster version
secrConst=10
for x,y,z in self.everyPixel(1,1,1):
cell=self.cellField[x,y,z]
if cell and cell.type==1:
# notice for steady state solver we do not add secretion const to existing concentration
# Also notice that secretion has to be negative (if we want positive secretion). This is how the solver is coded
self.field[x,y,z]=-secrConst
else:
# for steady state solver all field pixels which do not secrete or uptake must me set to 0.0. This is how the solver works:
# non-zero value of the field at the pixel indicates secretion rate
self.field[x,y,z]=0.0
示例14: step
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getConcentrationField [as 别名]
def step(self,mcs):
field=CompuCell.getConcentrationField(self.simulator,"Oxygen")
FiPyInteractor = FiPyInterface.FiPyInterfaceBase(2) #dimension of lattice (currently, 2D only works)
FiPyInteractor.fillArray3D(self.solver.phi._getArray(),field)
doNotDiffuseVec = FiPyInteractor.getDoNoDiffuseVec()
self.solver.setDoNotDiffuse(doNotDiffuseVec)
self.solver.iterateDiffusion()
pt=CompuCell.Point3D(0,0,0)
print '\n', field.get(pt),
sumField = 0
for i in xrange(self.dim.x):
for j in xrange(self.dim.y):
for k in xrange(self.dim.z):
pt.x=i
pt.y=j
pt.z=k
sumField += field.get(pt)
print sumField
示例15: start
# 需要导入模块: import CompuCell [as 别名]
# 或者: from CompuCell import getConcentrationField [as 别名]
def start(self):
# initial condition for diffusion field
field = CompuCell.getConcentrationField(self.simulator, "FGF")
field[26:28, 26:28, 0:5] = 2000.0