How to build a circular wall?


47
views
0
20 days ago by
Yuan  
Hi, I try to build a circular wall to restrict the scope of cell motility. The codes are as follows. The results are surprisingly interesting. Not only the cell types are different, the keyword, "FREEZE", is also out of use.

Community: CompuCell3D

1 Answer


3
19 days ago by
File attached: image (285.65 KB)

I tried the same code and I have been able to construct the wall with a single cell type. So there could be an issue while you are initializing the other two cell types and something got overwritten. In this code, Freeze seems to work but if you want an alternate way you could set the volume constraint to be very large (cella.lambdaVolume=1000000) and that should essentially do the same thing.

It seems that the mitosis steppable is the cause. When the volume of the cell satisfies the dividing condition, the interesting phenomenon takes place. Does it mean that the "Freeze" is useless for mitosis? The codes are as follows.
class MitosisSteppable(MitosisSteppableBase):
    def __init__(self,_simulator,_frequency=1):
        MitosisSteppableBase.__init__(self,_simulator, _frequency)
                
        # 0 - parent child position will be randomized between mitosis event
        # negative integer - parent appears on the 'left' of the child
        # positive integer - parent appears on the 'right' of the child
        self.setParentChildPositionFlag(-1)       
    
    def step(self,mcs):
        # print "INSIDE MITOSIS STEPPABLE"
        cells_to_divide=[]
        for cell in self.cellList:
            if cell.volume>500:
                
                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)
            # self.divideCellOrientationVectorBased(cell,1,0,0)                 # this is a valid option
            # self.divideCellAlongMajorAxis(cell)                               # this is a valid option
            # self.divideCellAlongMinorAxis(cell)                               # this is a valid option

    def updateAttributes(self):
        self.parentCell.targetVolume /= 2.0 # reducing parent target volume                 
        self.cloneParent2Child()            

        if self.parentCell.type==self.CONDENSING:
            self.childCell.type=self.NONCONDENSING
        else:
            self.childCell.type=self.CONDENSING​
written 17 days ago by Yuan  
Do you want to divide your wall cell as well? Or is it an error? If you meant only condensing and noncondensing should divide, you can change your line for collecting cell types in the division array to

for cell in self.cellListByType(self.CONDENSING,self.NONCONDENSING):
  if(cell.volume>500):
    cells_to_divide.append(cell) ​

Then only these two types of cells will have updated Attributes. I don't know what kind of output you are getting for the wall cells now but could only be a conflict of current wall target volumes that you are reducing to half.

written 17 days ago by priyomadhyapok  
Yeah, thank you so much. It is an error since I misunderstand the function of "Freeze".
written 17 days ago by Yuan  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »