Пример #1
0
def configureSimulation(sim):
    import CompuCellSetup
    from XMLUtils import ElementCC3D

    cc3d = ElementCC3D("CompuCell3D")
    potts = cc3d.ElementCC3D("Potts")
    potts.ElementCC3D("Dimensions", {"x": 55, "y": 55, "z": 1})
    potts.ElementCC3D("Steps", {}, 1000)
    potts.ElementCC3D("Temperature", {}, 0)
    potts.ElementCC3D("Flip2DimRatio", {}, 0.0)

    cellType = cc3d.ElementCC3D("Plugin", {"Name": "CellType"})
    cellType.ElementCC3D("CellType", {"TypeName": "Medium", "TypeId": "0"})

    flexDiffSolver = cc3d.ElementCC3D("Steppable",
                                      {"Type": "DiffusionSolverFE"})
    diffusionField = flexDiffSolver.ElementCC3D("DiffusionField")
    diffusionData = diffusionField.ElementCC3D("DiffusionData")
    diffusionData.ElementCC3D("FieldName", {}, "FGF")
    diffusionData.ElementCC3D("DiffusionConstant", {}, 0.10)
    diffusionData.ElementCC3D("DecayConstant", {}, 0.0)
    diffusionData.ElementCC3D("ConcentrationFileName", {},
                              "Simulation/diffusion_2D.pulse.txt")

    CompuCellSetup.setSimulationXMLDescription(cc3d)
Пример #2
0
    def saveAsXML(self, _fileName):
        print '_fileName=',_fileName
        import XMLUtils
        from XMLUtils import ElementCC3D
        import Version
        xml2ObjConverter = XMLUtils.Xml2Obj()
        plSetElem = ElementCC3D('PlayerSettings',{'version':Version.getVersionAsString()})
        # print '\n\n\nself.__typeSettingDictDict.keys() = ', self.__typeSettingDictDict.keys()
        # print '__typeSettingDictDict=',self.__typeSettingDictDict
        for typeName , settingDict in self.__typeSettingDictDict.iteritems():

            typeContainerElem = plSetElem.ElementCC3D( 'Settings', {'Type':typeName} )
            # print 'typeName=',typeName
            # if typeName =='FieldParams':
            #     print 'typeName=',typeName, ' settingDict=',settingDict

            for settingName, setting in sorted(settingDict.iteritems()):  # keys are sorted before outputting to XML
                # if settingName=='ShowPlotAxes':
                #
                #     try:
                #         print 'settingName=', settingName, ' setting=', setting, 'typeContainerElem=',typeName
                #     except:
                #         pass

                setting.toXML(typeContainerElem)

        fileFullPath = os.path.abspath(_fileName)
        plSetElem.CC3DXMLElement.saveXML(fileFullPath)
Пример #3
0
 def writeScreenshotDescriptionFile(self,_fileName):
     from XMLUtils import ElementCC3D
     
     screenshotFileElement=ElementCC3D("CompuCell3DScreenshots")
     
     for name in self.screenshotDataDict:
         scrData=self.screenshotDataDict[name]
         if scrData.spaceDimension=="2D":
             scrDescElement=screenshotFileElement.ElementCC3D("ScreenshotDescription")
             scrDescElement.ElementCC3D("Dimension", {}, str(scrData.spaceDimension))
             scrDescElement.ElementCC3D("Plot", {"PlotType":str(scrData.plotData[1]),"PlotName":str(scrData.plotData[0])})
             scrDescElement.ElementCC3D("Projection", {"ProjectionPlane":scrData.projection,"ProjectionPosition":str(scrData.projectionPosition)})
             scrDescElement.ElementCC3D("Size", {"Width":str(scrData.screenshotGraphicsWidget.size().width()),"Height":str(scrData.screenshotGraphicsWidget.size().height())})
             
         if scrData.spaceDimension=="3D":
             scrDescElement=screenshotFileElement.ElementCC3D("ScreenshotDescription")                
             scrDescElement.ElementCC3D("Dimension", {}, str(scrData.spaceDimension))
             scrDescElement.ElementCC3D("Plot", {"PlotType":str(scrData.plotData[1]),"PlotName":str(scrData.plotData[0])})
             scrDescElement.ElementCC3D("CameraClippingRange", {"Min":str(scrData.clippingRange[0]),"Max":str(scrData.clippingRange[1])})
             scrDescElement.ElementCC3D("CameraFocalPoint", {"x":str(scrData.focalPoint[0]),"y":str(scrData.focalPoint[1]),"z":str(scrData.focalPoint[2])})
             scrDescElement.ElementCC3D("CameraPosition", {"x":str(scrData.position[0]),"y":str(scrData.position[1]),"z":str(scrData.position[2])})
             scrDescElement.ElementCC3D("CameraViewUp", {"x":str(scrData.viewUp[0]),"y":str(scrData.viewUp[1]),"z":str(scrData.viewUp[2])})
             scrDescElement.ElementCC3D("Size", {"Width":str(scrData.screenshotGraphicsWidget.size().width()),"Height":str(scrData.screenshotGraphicsWidget.size().height())})
             
     screenshotFileElement.CC3DXMLElement.saveXML(str(_fileName))
Пример #4
0
 def writeXMLDescriptionFile(self,_fileName=""):
     from os.path import join
     """
     This function will write XML description of the stored fields. It has to be called after 
     initialization of theCMLFieldHandler is completed
     """
     import CompuCellSetup
     latticeTypeStr = CompuCellSetup.ExtractLatticeType()
     if latticeTypeStr=="":
         latticeTypeStr = "Square"
     
     typeIdTypeNameDict = CompuCellSetup.ExtractTypeNamesAndIds()
     print "typeIdTypeNameDict",typeIdTypeNameDict
     
     from XMLUtils import ElementCC3D
     dim = self.sim.getPotts().getCellFieldG().getDim()
     numberOfSteps = self.sim.getNumSteps()
     latticeDataXMLElement=ElementCC3D("CompuCell3DLatticeData",{"Version":"1.0"})
     latticeDataXMLElement.ElementCC3D("Dimensions",{"x":str(dim.x),"y":str(dim.y),"z":str(dim.z)})
     latticeDataXMLElement.ElementCC3D("Lattice",{"Type":latticeTypeStr})
     latticeDataXMLElement.ElementCC3D("Output",{"Frequency":str(self.outputFrequency),"NumberOfSteps":str(numberOfSteps),"CoreFileName":self.outputFileCoreName,"Directory":self.outputDirName})
     #output information about cell type names and cell ids. It is necessary during generation of the PIF files from VTK output
     for typeId in typeIdTypeNameDict.keys():
         latticeDataXMLElement.ElementCC3D("CellType",{"TypeName":str(typeIdTypeNameDict[typeId]),"TypeId":str(typeId)})
         
     fieldsXMLElement=latticeDataXMLElement.ElementCC3D("Fields")
     for fieldName in self.fieldTypes.keys():
         fieldsXMLElement.ElementCC3D("Field",{"Name":fieldName,"Type":self.fieldTypes[fieldName]})
     # writing XML description to the disk
     if _fileName!="":
         latticeDataXMLElement.CC3DXMLElement.saveXML(str(_fileName))
     else:
         latticeDataFileName = join(self.outputDirName,self.outputFileCoreName+"LDF.dml")
         latticeDataXMLElement.CC3DXMLElement.saveXML(str(latticeDataFileName))
def configureSimulation(sim):
    import CompuCellSetup
    from XMLUtils import ElementCC3D

    cc3d = ElementCC3D("CompuCell3D")
    potts = cc3d.ElementCC3D("Potts")
    potts.ElementCC3D("Dimensions", {"x": 100, "y": 100, "z": 1})
    potts.ElementCC3D("Steps", {}, 10000)
    potts.ElementCC3D("Temperature", {}, 5)
    potts.ElementCC3D("NeighborOrder", {}, 2)
    potts.ElementCC3D("Boundary_x", {}, "Periodic")

    cellType = cc3d.ElementCC3D("Plugin", {"Name": "CellType"})
    cellType.ElementCC3D("CellType", {"TypeName": "Medium", "TypeId": "0"})
    cellType.ElementCC3D("CellType", {"TypeName": "Body1", "TypeId": "1"})
    cellType.ElementCC3D("CellType", {"TypeName": "Body2", "TypeId": "2"})
    cellType.ElementCC3D("CellType", {"TypeName": "Body3", "TypeId": "3"})

    volume = cc3d.ElementCC3D("Plugin", {"Name": "Volume"})
    volume.ElementCC3D("TargetVolume", {}, 25)
    volume.ElementCC3D("LambdaVolume", {}, 4.0)

    contact = cc3d.ElementCC3D("Plugin", {"Name": "Contact"})
    contact.ElementCC3D("Energy", {"Type1": "Medium", "Type2": "Medium"}, 0)
    contact.ElementCC3D("Energy", {"Type1": "Body1", "Type2": "Body1"}, 16)
    contact.ElementCC3D("Energy", {"Type1": "Body1", "Type2": "Medium"}, 4)
    contact.ElementCC3D("Energy", {"Type1": "Body2", "Type2": "Body2"}, 16)
    contact.ElementCC3D("Energy", {"Type1": "Body2", "Type2": "Medium"}, 4)
    contact.ElementCC3D("Energy", {"Type1": "Body3", "Type2": "Body3"}, 16)
    contact.ElementCC3D("Energy", {"Type1": "Body3", "Type2": "Medium"}, 4)
    contact.ElementCC3D("Energy", {"Type1": "Body1", "Type2": "Body2"}, 16)
    contact.ElementCC3D("Energy", {"Type1": "Body1", "Type2": "Body3"}, 16)
    contact.ElementCC3D("Energy", {"Type1": "Body2", "Type2": "Body3"}, 16)
    contact.ElementCC3D("neighborOrder", {}, 2)

    centerOfMass = cc3d.ElementCC3D("Plugin", {"Name": "CenterOfMass"})

    elasticityTracker = cc3d.ElementCC3D("Plugin",
                                         {"Name": "ElasticityTracker"})
    elasticityTracker.ElementCC3D("IncludeType", {}, "Body1")
    elasticityTracker.ElementCC3D("IncludeType", {}, "Body2")
    elasticityTracker.ElementCC3D("IncludeType", {}, "Body3")

    elasticityEnergy = cc3d.ElementCC3D("Plugin", {"Name": "ElasticityEnergy"})
    elasticityEnergy.ElementCC3D("Local", {})
    # elasticityEnergy.ElementCC3D("LambdaElasticity",{},200.0)
    # elasticityEnergy.ElementCC3D("TargetLengthElasticity",{},6)

    externalPotential = cc3d.ElementCC3D("Plugin",
                                         {"Name": "ExternalPotential"})
    externalPotential.ElementCC3D("Lambda", {"x": -10, "y": 0, "z": 0})

    pifInitializer = cc3d.ElementCC3D("Steppable", {"Type": "PIFInitializer"})
    pifInitializer.ElementCC3D("PIFName", {}, "Simulation/elasticitytest.piff")

    CompuCellSetup.setSimulationXMLDescription(cc3d)
def configureSimulation(sim):
    import CompuCellSetup
    from XMLUtils import ElementCC3D

    cc3d = ElementCC3D("CompuCell3D")
    potts = cc3d.ElementCC3D("Potts")
    potts.ElementCC3D("Dimensions", {"x": 100, "y": 100, "z": 1})
    potts.ElementCC3D("Steps", {}, 1000)
    potts.ElementCC3D("Temperature", {}, 10)
    potts.ElementCC3D("NeighborOrder", {}, 2)

    cellType = cc3d.ElementCC3D("Plugin", {"Name": "CellType"})
    cellType.ElementCC3D("CellType", {"TypeName": "Medium", "TypeId": "0"})
    cellType.ElementCC3D("CellType", {"TypeName": "Condensing", "TypeId": "1"})
    cellType.ElementCC3D("CellType", {
        "TypeName": "NonCondensing",
        "TypeId": "2"
    })

    volume = cc3d.ElementCC3D("Plugin", {"Name": "Volume"})
    volume.ElementCC3D("TargetVolume", {}, 25)
    volume.ElementCC3D("LambdaVolume", {}, 2.0)

    contact = cc3d.ElementCC3D("Plugin", {"Name": "Contact"})
    contact.ElementCC3D("Energy", {"Type1": "Medium", "Type2": "Medium"}, 0)
    contact.ElementCC3D("Energy", {
        "Type1": "NonCondensing",
        "Type2": "NonCondensing"
    }, 16)
    contact.ElementCC3D("Energy", {
        "Type1": "Condensing",
        "Type2": "Condensing"
    }, 2)
    contact.ElementCC3D("Energy", {
        "Type1": "NonCondensing",
        "Type2": "Condensing"
    }, 11)
    contact.ElementCC3D("Energy", {
        "Type1": "NonCondensing",
        "Type2": "Medium"
    }, 16)
    contact.ElementCC3D("Energy", {
        "Type1": "Condensing",
        "Type2": "Medium"
    }, 16)

    blobInitializer = cc3d.ElementCC3D("Steppable",
                                       {"Type": "BlobInitializer"})
    blobInitializer.ElementCC3D("Gap", {}, 0)
    blobInitializer.ElementCC3D("Width", {}, 5)
    blobInitializer.ElementCC3D("CellSortInit", {}, "yes")
    blobInitializer.ElementCC3D("Radius", {}, 40)

    CompuCellSetup.setSimulationXMLDescription(cc3d)
    def __init__(self, simulationDir, simulationName):
        self.simulationDir = simulationDir
        self.simulationName = simulationName

        self.fileName = os.path.join(str(self.simulationDir), str(self.simulationName) + ".xml")
        self.generalPropertiesDict = {}

        self.cellTypeTable = [["Medium", False]]
        self.cc3d = ElementCC3D("CompuCell3D", {"version": "3.6.0"})
        self.afMolecules = []
        self.afFormula = 'min(Molecule1,Molecule2)'
        self.cmcCadherins = []
        self.chemFieldsTable = []
        self.secretionTable = {}
        self.chemotaxisTable = {}
Пример #8
0
    def saveAsXML(self, _fileName):
        import XMLUtils
        from XMLUtils import ElementCC3D
        import Version
        xml2ObjConverter = XMLUtils.Xml2Obj()
        plSetElem = ElementCC3D('PlayerSettings',
                                {'version': Version.getVersionAsString()})
        # print '\n\n\nself.__typeSettingDictDict.keys() = ', self.__typeSettingDictDict.keys()
        for typeName, settingDict in self.__typeSettingDictDict.iteritems():

            typeContainerElem = plSetElem.ElementCC3D('Settings',
                                                      {'Type': typeName})

            for settingName, setting in sorted(settingDict.iteritems(
            )):  # keys are sorted before outputting to XML
                setting.toXML(typeContainerElem)

        fileFullPath = os.path.abspath(_fileName)
        plSetElem.CC3DXMLElement.saveXML(fileFullPath)
 def configureSimulation(sim):
   import CompuCellSetup
   from XMLUtils import ElementCC3D
   cc3d=ElementCC3D("CompuCell3D")
   
   Globals=cc3d.ElementCC3D("Globals")
   for key in sorted(globals(), key=str.lower):
     if key not in Old:
       Globals.ElementCC3D(key,{},globals()[key])
       keys.append(key)
   
   md=cc3d.ElementCC3D("Metadata")
   md.ElementCC3D("VirtualProcessingUnits",{"ThreadsPerVPU":2},2)
   md.ElementCC3D("DebugOutputFrequency",{},0)
   
   potts=cc3d.ElementCC3D("Potts")
   potts.ElementCC3D("Dimensions",{"x":Lx,"y":Ly,"z":Lz})
   potts.ElementCC3D("Steps",{},Time)
   potts.ElementCC3D("Temperature",{},int(T))
   potts.ElementCC3D("NeighborOrder",{},2)
   
   #CELL TYPES:
   cellType=cc3d.ElementCC3D("Plugin",{"Name":"CellType"})
   cellType.ElementCC3D("CellType", {"TypeName":"Medium","TypeId":"0"})
   cellType.ElementCC3D("CellType", {"TypeName":"cyto",  "TypeId":"1"})
   
   #CELL COLORS:
   playSet=cc3d.ElementCC3D("Plugin",{"Name":"PlayerSettings"})
   playSet.ElementCC3D("Cell", {"Type":"0", "Color":"#000000"}) #black
   playSet.ElementCC3D("Cell", {"Type":"1", "Color":"#FFFFFF"}) #white
    
   #CONTACT ENERGIES:
   contact=cc3d.ElementCC3D("Plugin",{"Name":"Contact"})
   contact.ElementCC3D("Energy", {"Type1":"Medium", "Type2":"Medium"},0)
   contact.ElementCC3D("Energy", {"Type1":"Medium", "Type2":"cyto"  },10)
   #
   contact.ElementCC3D("Energy", {"Type1":"cyto", "Type2":"cyto"},10)
   #-neighbor order
   contact.ElementCC3D("NeighborOrder",{},nOrder)
   
   CompuCellSetup.setSimulationXMLDescription(cc3d)
Пример #10
0
    def generateXML(self):

        from XMLUtils import ElementCC3D
        mElement = ElementCC3D('Potts')
        mElement.addComment("newline")
        mElement.addComment("Basic properties of CPM (GGH) algorithm")

        mElement.ElementCC3D(
            "Dimensions", {
                "x": self.xDimSB.value(),
                "y": self.yDimSB.value(),
                "z": self.zDimSB.value()
            })
        mElement.ElementCC3D("Steps", {}, self.mcsSB.value())

        if self.anneal_mcsSB.value() != 0:
            mElement.ElementCC3D("Anneal", {}, self.anneal_mcsSB.value())

        mElement.ElementCC3D("Temperature", {},
                             float(str(self.membraneFluctuationsLE.text())))
        mElement.ElementCC3D("NeighborOrder", {}, self.neighborOrderSB.value())
        if str(self.latticeTypeCB.currentText()) != "Square":
            mElement.ElementCC3D("LatticeType", {},
                                 str(self.latticeTypeCB.currentText()))

        for dim_name_bc_widget, dim_name in [(self.xbcCB, 'x'),
                                             (self.ybcCB, 'y'),
                                             (self.zbcCB, 'z')]:
            try:
                if str(dim_name_bc_widget.currentText()) == 'Periodic':
                    mElement.ElementCC3D('Boundary_' + dim_name, {},
                                         'Periodic')
            except KeyError:
                pass
                # mElement.ElementCC3D('Boundary_' + dim_name, {}, 'NoFlux')

        if self.auto_gen_rand_seed_CB.isChecked():
            mElement.ElementCC3D('RandomSeed', {}, randint(0, sys.maxint))

        return mElement
Пример #11
0
    def writeXMLDescriptionFile(self,_fileName=""):
        """
        This function will write XML description of the stored fields. It has to be called after 
        initializetion of theCMLFieldHandler is completed
        """

        
        from XMLUtils import ElementCC3D
        dim=self.sim.getPotts().getCellFieldG().getDim()        
        latticeDataXMLElement=ElementCC3D("CompuCell3DLatticeData",{"Version":"1.0"})
        latticeDataXMLElement.ElementCC3D("Dimensions",{"x":str(dim.x),"y":str(dim.y),"z":str(dim.z)})
        latticeDataXMLElement.ElementCC3D("Output",{"Frequency":str(self.outputFrequency),"CoreFileName":self.outputFileCoreName,"Directory":self.outputDirName})
        
        fieldsXMLElement=latticeDataXMLElement.ElementCC3D("Fields")
        for fieldName in self.fieldTypes.keys():
            fieldsXMLElement.ElementCC3D("Field",{"Name":fieldName,"Type":self.fieldTypes[fieldName]})
        # writing XML description to the disk
        if _fileName!="":
            latticeDataXMLElement.CC3DXMLElement.saveXML(str(_fileName))
        else:
            latticeDataFileName=os.path.join(self.outputDirName,self.outputFileCoreName+"LDF.dml")
            latticeDataXMLElement.CC3DXMLElement.saveXML(str(latticeDataFileName))
def configureSimulation(sim):
    import CompuCellSetup
    from XMLUtils import ElementCC3D
    cc3d = ElementCC3D("CompuCell3D")
    potts = cc3d.ElementCC3D("Potts")
    potts.ElementCC3D("Dimensions", {"x": 42, "y": 42, "z": 1})
    potts.ElementCC3D("Steps", {}, 10000)
    potts.ElementCC3D("Anneal", {}, 10)
    potts.ElementCC3D("Temperature", {}, 10)
    potts.ElementCC3D("NeighborOrder", {}, 2)
    potts.ElementCC3D("Boundary_x", {}, "Periodic")
    potts.ElementCC3D("Boundary_y", {}, "Periodic")

    cellType = cc3d.ElementCC3D("Plugin", {"Name": "CellType"})
    cellType.ElementCC3D("CellType", {"TypeName": "Medium", "TypeId": "0"})
    cellType.ElementCC3D("CellType", {"TypeName": "TypeA", "TypeId": "1"})

    contact = cc3d.ElementCC3D("Plugin", {"Name": "Contact"})
    contact.ElementCC3D("Energy", {"Type1": "Medium", "Type2": "Medium"}, 0)
    contact.ElementCC3D("Energy", {"Type1": "Medium", "Type2": "TypeA"}, 5)
    contact.ElementCC3D("Energy", {"Type1": "TypeA", "Type2": "TypeA"}, 5)
    contact.ElementCC3D("NeighborOrder", {}, 4)

    vp = cc3d.ElementCC3D("Plugin", {"Name": "Volume"})
    vp.ElementCC3D("TargetVolume", {}, 49)
    vp.ElementCC3D("LambdaVolume", {}, 5)

    ntp = cc3d.ElementCC3D("Plugin", {"Name": "NeighborTracker"})

    uipd = cc3d.ElementCC3D("Steppable", {"Type": "UniformInitializer"})
    region = uipd.ElementCC3D("Region")
    region.ElementCC3D("BoxMin", {"x": 0, "y": 0, "z": 0})
    region.ElementCC3D("BoxMax", {"x": 42, "y": 42, "z": 1})
    region.ElementCC3D("Types", {}, "TypeA")
    region.ElementCC3D("Width", {}, 7)

    CompuCellSetup.setSimulationXMLDescription(cc3d)
Пример #13
0
    
    def writeCC3DFileFormat(self,_fileName):        
#         print '\n\n\n will write ',_fileName
        from XMLUtils import ElementCC3D
        csd=self.cc3dSimulationData
        simulationElement = ElementCC3D("Simulation",{"version":csd.version})
        
        if csd.xmlScriptResource.path!="":
            elName,attributeDict,path = self.formatResourceElement(csd.xmlScriptResource,"XMLScript")
#             print 'ADDING XML ',path
            simulationElement.ElementCC3D(elName,attributeDict,path)
            
        if csd.pythonScriptResource.path!="":
            elName,attributeDict,path = self.formatResourceElement(csd.pythonScriptResource,"PythonScript")
#             print 'ADDING PYTHON ',path
            simulationElement.ElementCC3D(elName,attributeDict,path)
            
        if csd.pifFileResource.path!="":
            elName,attributeDict,path = self.formatResourceElement(csd.pifFileResource,"PIFFile")
#             print 'ADDING PIF ',path
            simulationElement.ElementCC3D(elName,attributeDict,path)
            
        if csd.windowScriptResource.path!="":
            elName,attributeDict,path = self.formatResourceElement(csd.windowScriptResource,"WindowScript")
            simulationElement.ElementCC3D(elName,attributeDict,path)
            
        
        resourcesDict={}
        #storing resources in a dictionary using resource type as a key   
        for resourceKey, resource in csd.resources.iteritems():
            if resource.type=="PIFFile" and csd.pifFileResource.path==resource.path:
                print MODULENAME,"IGNORING RESOURCE =",resource.path
                continue
            
            try:
                resourcesDict[resource.type].append(resource)
            except LookupError,e:
Пример #14
0
def configureSimulation(sim, Lx, Ly, Lz, Temp, Time, NOrder, CNOrder,
                        debugFreq):

    import CompuCellSetup
    from XMLUtils import ElementCC3D

    CompuCell3DElement = ElementCC3D("CompuCell3D", {"Version": "3.7.5"})

    # Basic properties of CPM (GGH) algorithm
    potts = CompuCell3DElement.ElementCC3D("Potts")
    potts.ElementCC3D("Dimensions", {"x": 500, "y": 500, "z": 10})
    potts.ElementCC3D("Temperature", {}, 50)
    potts.ElementCC3D("Steps", {}, Time)
    potts.ElementCC3D("NeighborOrder", {}, 1)
    potts.ElementCC3D("DebugOutputFrequency", {}, debugFreq)

    # Setting periodic boundary conditions to all directions
    potts.ElementCC3D("Boundary_x", {}, "Periodic")
    potts.ElementCC3D("Boundary_y", {}, "Periodic")
    potts.ElementCC3D("Boundary_z", {}, "Periodic")

    # Cell Types -> Epidermis, Progenitors, PPap, QPap, PRet, QRet, Adipocytes, ECM, Lumen
    cellType = CompuCell3DElement.ElementCC3D("Plugin", {"Name": "CellType"})
    cellType.ElementCC3D("CellType", {"TypeName": "Medium", "TypeId": 0})
    cellType.ElementCC3D("CellType", {"TypeName": "Epidermis", "TypeId": 1})
    cellType.ElementCC3D("CellType", {"TypeName": "Progenitors", "TypeId": 2})
    cellType.ElementCC3D("CellType", {"TypeName": "PPap", "TypeId": 3})
    cellType.ElementCC3D("CellType", {"TypeName": "QPap", "TypeId": 4})
    cellType.ElementCC3D("CellType", {"TypeName": "PRet", "TypeId": 5})
    cellType.ElementCC3D("CellType", {"TypeName": "QRet", "TypeId": 6})
    cellType.ElementCC3D("CellType", {"TypeName": "Adipocytes", "TypeId": 7})
    cellType.ElementCC3D("CellType", {"TypeName": "ECM", "TypeId": 8})
    cellType.ElementCC3D("CellType", {"TypeName": "Lumen", "TypeId": 9})
    cellType.ElementCC3D("CellType", {"TypeName": "MyoF", "TypeId": 10})
    cellType.ElementCC3D("CellType", {"TypeName": "QMyoF", "TypeId": 11})
    cellType.ElementCC3D("CellType", {"TypeName": "BC", "TypeId": 12})
    cellType.ElementCC3D("CellType", {"TypeName": "IC", "TypeId": 13})
    cellType.ElementCC3D("CellType", {"TypeName": "Fatty", "TypeId": 14})

    # CELL COLORS --> not working
    cellColor = CompuCell3DElement.ElementCC3D("Plugin",
                                               {"Name": "PlayerSettings"})
    cellColor.ElementCC3D("Cell", {
        "Type": 0,
        "Color": "#000000"
    })  # Black        -> Medium
    cellColor.ElementCC3D("Cell", {
        "Type": 1,
        "Color": "#008000"
    })  # Green        -> Epidermis
    cellColor.ElementCC3D("Cell", {
        "Type": 2,
        "Color": "#0000FF"
    })  # Blue         -> Progenitors
    cellColor.ElementCC3D("Cell", {
        "Type": 3,
        "Color": "#FF0000"
    })  # Red          -> PPap
    cellColor.ElementCC3D("Cell", {
        "Type": 4,
        "Color": "#990000"
    })  # Dark red     -> QPap
    cellColor.ElementCC3D("Cell", {
        "Type": 5,
        "Color": "#FFFF00"
    })  # Yellow       -> PRet
    cellColor.ElementCC3D("Cell", {
        "Type": 6,
        "Color": "#CCCC00"
    })  # Dark Yellow  -> QRet
    cellColor.ElementCC3D("Cell", {
        "Type": 7,
        "Color": "#00E6E6"
    })  # Light blue   -> Adipocytes
    cellColor.ElementCC3D("Cell", {
        "Type": 8,
        "Color": "#8B1A89"
    })  # Purple       -> ECM
    cellColor.ElementCC3D("Cell", {
        "Type": 9,
        "Color": "#D3D3D3"
    })  # Light grey   -> Lumen
    cellColor.ElementCC3D("Cell", {
        "Type": 10,
        "Color": "#D3D3D3"
    })  # Light grey  -> MyoF
    cellColor.ElementCC3D("Cell", {
        "Type": 11,
        "Color": "#FF0000"
    })  # Red         -> BC
    cellColor.ElementCC3D("Cell", {
        "Type": 12,
        "Color": "#FF0000"
    })  # Red         -> IC
    cellColor.ElementCC3D("Cell", {
        "Type": 13,
        "Color": "#00E6E6"
    })  # Light blue   -> Fatty
    #     cellColor.ElementCC3D("TypesInvisibleIn3D",{"Types":"0,9"})   # Don't show Medium and Lumen
    cellColor.ElementCC3D("VisualControl", {
        "ScreenshotFrequency": 250,
        "ScreenUpdateFrequency": 10
    })

    #     # Cell Colors
    #     cellColor=CompuCell3DElement.ElementCC3D("Plugin",{"Name":"PlayerSettings"})
    #     cellColor.ElementCC3D("Cell",{"Type":0,"Color":"#000000"}) # Black        -> Medium
    #     cellColor.ElementCC3D("Cell",{"Type":1,"Color":"black"}) # Green        -> Epidermis
    #     cellColor.ElementCC3D("Cell",{"Type":2,"Color":"blue"}) # Blue         -> Progenitors
    #     cellColor.ElementCC3D("Cell",{"Type":3,"Color":"green"}) # Red          -> PPap
    #     cellColor.ElementCC3D("Cell",{"Type":4,"Color":"#990000"}) # Dark red     -> QPap
    #     cellColor.ElementCC3D("Cell",{"Type":5,"Color":"cyan"}) # Yellow       -> PRet
    #     cellColor.ElementCC3D("Cell",{"Type":6,"Color":"#CCCC00"}) # Dark Yellow  -> QRet
    #     cellColor.ElementCC3D("Cell",{"Type":7,"Color":"#00E6E6"}) # Light blue   -> Adipocytes
    #     cellColor.ElementCC3D("Cell",{"Type":8,"Color":"#8B1A89"}) # Purple       -> ECM
    #     cellColor.ElementCC3D("Cell",{"Type":9,"Color":"#D3D3D3"}) # Light grey   -> Lumen
    #     cellColor.ElementCC3D("Cell",{"Type":10,"Color":"#D3D3D3"}) # Light grey  -> MyoF
    #     cellColor.ElementCC3D("Cell",{"Type":11,"Color":"red"}) # Red         -> BC
    #     cellColor.ElementCC3D("Cell",{"Type":12,"Color":"red"}) # Red         -> BCtop
    # #     cellColor.ElementCC3D("TypesInvisibleIn3D",{"Types":"0,9"})   # Don't show Medium and Lumen
    #     cellColor.ElementCC3D("VisualControl",{"ScreenshotFrequency":250,"ScreenUpdateFrequency":10})

    # Specification of adhesion energies
    contact = CompuCell3DElement.ElementCC3D("Plugin", {"Name": "Contact"})

    #     #MEDIUM
    #     contact.ElementCC3D("Energy",{"Type1":"Medium","Type2":"Medium"},0)
    #     contact.ElementCC3D("Energy",{"Type1":"Medium","Type2":"Epidermis"},2)
    #     contact.ElementCC3D("Energy",{"Type1":"Medium","Type2":"Progenitors"},100)
    #     contact.ElementCC3D("Energy",{"Type1":"Medium","Type2":"PPap"},100)
    #     contact.ElementCC3D("Energy",{"Type1":"Medium","Type2":"QPap"},100)
    #     contact.ElementCC3D("Energy",{"Type1":"Medium","Type2":"PRet"},100)
    #     contact.ElementCC3D("Energy",{"Type1":"Medium","Type2":"QRet"},100)
    #     contact.ElementCC3D("Energy",{"Type1":"Medium","Type2":"Adipocytes"},100)
    #     contact.ElementCC3D("Energy",{"Type1":"Medium","Type2":"ECM"},100)
    #     contact.ElementCC3D("Energy",{"Type1":"Medium","Type2":"Lumen"},100)

    #     #ECM
    #     contact.ElementCC3D("Energy",{"Type1":"ECM","Type2":"ECM"},1)
    #     contact.ElementCC3D("Energy",{"Type1":"ECM","Type2":"Epidermis"},50)
    #     contact.ElementCC3D("Energy",{"Type1":"ECM","Type2":"Progenitors"},20)
    #     contact.ElementCC3D("Energy",{"Type1":"ECM","Type2":"PPap"},2)
    #     contact.ElementCC3D("Energy",{"Type1":"ECM","Type2":"QPap"},20)
    #     contact.ElementCC3D("Energy",{"Type1":"ECM","Type2":"PRet"},2)
    #     contact.ElementCC3D("Energy",{"Type1":"ECM","Type2":"QRet"},1)
    #     contact.ElementCC3D("Energy",{"Type1":"ECM","Type2":"Adipocytes"},50)
    #     contact.ElementCC3D("Energy",{"Type1":"ECM","Type2":"Lumen"},20)

    #     #EPIDERMIS
    #     contact.ElementCC3D("Energy",{"Type1":"Epidermis","Type2":"Epidermis"},2)
    #     contact.ElementCC3D("Energy",{"Type1":"Epidermis","Type2":"Progenitors"},5)
    #     contact.ElementCC3D("Energy",{"Type1":"Epidermis","Type2":"PPap"},10)
    #     contact.ElementCC3D("Energy",{"Type1":"Epidermis","Type2":"QPap"},10)
    #     contact.ElementCC3D("Energy",{"Type1":"Epidermis","Type2":"PRet"},20)
    #     contact.ElementCC3D("Energy",{"Type1":"Epidermis","Type2":"QRet"},20)
    #     contact.ElementCC3D("Energy",{"Type1":"Epidermis","Type2":"Adipocytes"},100)
    #     contact.ElementCC3D("Energy",{"Type1":"Epidermis","Type2":"Lumen"},100)

    #     #PROGENITORS
    #     contact.ElementCC3D("Energy",{"Type1":"Progenitors","Type2":"Progenitors"},10)
    #     contact.ElementCC3D("Energy",{"Type1":"Progenitors","Type2":"PPap"},10)
    #     contact.ElementCC3D("Energy",{"Type1":"Progenitors","Type2":"QPap"},10)
    #     contact.ElementCC3D("Energy",{"Type1":"Progenitors","Type2":"PRet"},10)
    #     contact.ElementCC3D("Energy",{"Type1":"Progenitors","Type2":"QRet"},10)
    #     contact.ElementCC3D("Energy",{"Type1":"Progenitors","Type2":"Adipocytes"},10)
    #     contact.ElementCC3D("Energy",{"Type1":"Progenitors","Type2":"Lumen"},100)

    #     #PPAP
    #     contact.ElementCC3D("Energy",{"Type1":"PPap","Type2":"PPap"},20)
    #     contact.ElementCC3D("Energy",{"Type1":"PPap","Type2":"QPap"},10)
    #     contact.ElementCC3D("Energy",{"Type1":"PPap","Type2":"PRet"},10)
    #     contact.ElementCC3D("Energy",{"Type1":"PPap","Type2":"QRet"},20)
    #     contact.ElementCC3D("Energy",{"Type1":"PPap","Type2":"Adipocytes"},100)
    #     contact.ElementCC3D("Energy",{"Type1":"PPap","Type2":"Lumen"},100)

    #     #QPAP
    #     contact.ElementCC3D("Energy",{"Type1":"QPap","Type2":"QPap"},10)
    #     contact.ElementCC3D("Energy",{"Type1":"QPap","Type2":"PRet"},20)
    #     contact.ElementCC3D("Energy",{"Type1":"QPap","Type2":"QRet"},10)
    #     contact.ElementCC3D("Energy",{"Type1":"QPap","Type2":"Adipocytes"},100)
    #     contact.ElementCC3D("Energy",{"Type1":"QPap","Type2":"Lumen"},100)

    #     #PRET
    #     contact.ElementCC3D("Energy",{"Type1":"PRet","Type2":"PRet"},10)
    #     contact.ElementCC3D("Energy",{"Type1":"PRet","Type2":"QRet"},10)
    #     contact.ElementCC3D("Energy",{"Type1":"PRet","Type2":"Adipocytes"},100)
    #     contact.ElementCC3D("Energy",{"Type1":"PRet","Type2":"Lumen"},100)

    #     #QRET
    #     # 24/01/2017: considere increase QRet QRet
    #     contact.ElementCC3D("Energy",{"Type1":"QRet","Type2":"QRet"},20)
    #     contact.ElementCC3D("Energy",{"Type1":"QRet","Type2":"Adipocytes"},50)
    #     contact.ElementCC3D("Energy",{"Type1":"QRet","Type2":"Lumen"},100)

    #     #ADIPOCYTES
    #     contact.ElementCC3D("Energy",{"Type1":"Adipocytes","Type2":"Adipocytes"},2)
    #     contact.ElementCC3D("Energy",{"Type1":"Adipocytes","Type2":"Lumen"},10)

    #     #LUMEN
    #     contact.ElementCC3D("Energy",{"Type1":"Lumen","Type2":"Lumen"},1)

    ############# bellow is the current code ##############

    #MEDIUM
    contact.ElementCC3D("Energy", {"Type1": "Medium", "Type2": "Medium"}, 0)
    contact.ElementCC3D("Energy", {"Type1": "Medium", "Type2": "Epidermis"}, 2)
    contact.ElementCC3D("Energy", {
        "Type1": "Medium",
        "Type2": "Progenitors"
    }, 50)
    contact.ElementCC3D("Energy", {"Type1": "Medium", "Type2": "PPap"}, 50)
    contact.ElementCC3D("Energy", {"Type1": "Medium", "Type2": "QPap"}, 50)
    contact.ElementCC3D("Energy", {"Type1": "Medium", "Type2": "PRet"}, 50)
    contact.ElementCC3D("Energy", {"Type1": "Medium", "Type2": "QRet"}, 50)
    contact.ElementCC3D("Energy", {
        "Type1": "Medium",
        "Type2": "Adipocytes"
    }, 50)
    contact.ElementCC3D("Energy", {"Type1": "Medium", "Type2": "ECM"}, 50)
    contact.ElementCC3D("Energy", {"Type1": "Medium", "Type2": "Lumen"}, 50)

    #ECM
    contact.ElementCC3D("Energy", {"Type1": "ECM", "Type2": "ECM"}, 5)
    contact.ElementCC3D("Energy", {"Type1": "ECM", "Type2": "Epidermis"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "ECM", "Type2": "Progenitors"}, 2)
    contact.ElementCC3D("Energy", {"Type1": "ECM", "Type2": "PPap"}, 2)
    contact.ElementCC3D("Energy", {"Type1": "ECM", "Type2": "QPap"}, 2)
    contact.ElementCC3D("Energy", {"Type1": "ECM", "Type2": "PRet"}, 2)
    contact.ElementCC3D("Energy", {"Type1": "ECM", "Type2": "QRet"}, 2)
    contact.ElementCC3D("Energy", {
        "Type1": "ECM",
        "Type2": "Adipocytes"
    }, 30)  #changed from 50
    contact.ElementCC3D("Energy", {"Type1": "ECM", "Type2": "Lumen"}, 30)

    #EPIDERMIS
    contact.ElementCC3D("Energy", {
        "Type1": "Epidermis",
        "Type2": "Epidermis"
    }, 2)
    contact.ElementCC3D("Energy", {
        "Type1": "Epidermis",
        "Type2": "Progenitors"
    }, 5)
    contact.ElementCC3D("Energy", {"Type1": "Epidermis", "Type2": "PPap"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "Epidermis", "Type2": "QPap"}, 10)
    contact.ElementCC3D("Energy", {
        "Type1": "Epidermis",
        "Type2": "PRet"
    }, 10)  #changed from 20
    contact.ElementCC3D("Energy", {
        "Type1": "Epidermis",
        "Type2": "QRet"
    }, 10)  #changed from 20
    contact.ElementCC3D("Energy", {
        "Type1": "Epidermis",
        "Type2": "Adipocytes"
    }, 30)  #changed from 100
    contact.ElementCC3D("Energy", {
        "Type1": "Epidermis",
        "Type2": "Lumen"
    }, 50)  #changed from100

    #PROGENITORS
    contact.ElementCC3D("Energy", {
        "Type1": "Progenitors",
        "Type2": "Progenitors"
    }, 10)
    contact.ElementCC3D("Energy", {
        "Type1": "Progenitors",
        "Type2": "PPap"
    }, 10)
    contact.ElementCC3D("Energy", {
        "Type1": "Progenitors",
        "Type2": "QPap"
    }, 10)
    contact.ElementCC3D("Energy", {
        "Type1": "Progenitors",
        "Type2": "PRet"
    }, 10)
    contact.ElementCC3D("Energy", {
        "Type1": "Progenitors",
        "Type2": "QRet"
    }, 10)
    contact.ElementCC3D("Energy", {
        "Type1": "Progenitors",
        "Type2": "Adipocytes"
    }, 30)  # changed from 10
    contact.ElementCC3D("Energy", {
        "Type1": "Progenitors",
        "Type2": "Lumen"
    }, 50)

    #PPAP
    contact.ElementCC3D("Energy", {
        "Type1": "PPap",
        "Type2": "PPap"
    }, 5)  # changed from 20
    contact.ElementCC3D("Energy", {"Type1": "PPap", "Type2": "QPap"}, 5)
    contact.ElementCC3D("Energy", {
        "Type1": "PPap",
        "Type2": "PRet"
    }, 5)  # changed from 10
    contact.ElementCC3D("Energy", {
        "Type1": "PPap",
        "Type2": "QRet"
    }, 5)  # changed from 20
    contact.ElementCC3D("Energy", {
        "Type1": "PPap",
        "Type2": "Adipocytes"
    }, 30)  #changed from 100
    contact.ElementCC3D("Energy", {
        "Type1": "PPap",
        "Type2": "Lumen"
    }, 50)  #changed from 100

    #QPAP
    contact.ElementCC3D("Energy", {
        "Type1": "QPap",
        "Type2": "QPap"
    }, 5)  # changed from 10
    contact.ElementCC3D("Energy", {
        "Type1": "QPap",
        "Type2": "PRet"
    }, 5)  # changed from 20
    contact.ElementCC3D("Energy", {
        "Type1": "QPap",
        "Type2": "QRet"
    }, 5)  # changed from 10
    contact.ElementCC3D("Energy", {
        "Type1": "QPap",
        "Type2": "Adipocytes"
    }, 30)  #changed from 100
    contact.ElementCC3D("Energy", {
        "Type1": "QPap",
        "Type2": "Lumen"
    }, 30)  #changed from 100

    #PRET
    contact.ElementCC3D("Energy", {
        "Type1": "PRet",
        "Type2": "PRet"
    }, 5)  #changed from 5
    contact.ElementCC3D("Energy", {"Type1": "PRet", "Type2": "QRet"}, 5)
    contact.ElementCC3D("Energy", {
        "Type1": "PRet",
        "Type2": "Adipocytes"
    }, 30)  #changed from 100
    contact.ElementCC3D("Energy", {
        "Type1": "PRet",
        "Type2": "Lumen"
    }, 50)  #changed from 100

    #QRET
    contact.ElementCC3D("Energy", {
        "Type1": "QRet",
        "Type2": "QRet"
    }, 5)  # changed from 20
    contact.ElementCC3D("Energy", {
        "Type1": "QRet",
        "Type2": "Adipocytes"
    }, 30)  # changed from 50
    contact.ElementCC3D("Energy", {
        "Type1": "QRet",
        "Type2": "Lumen"
    }, 30)  # changed from 100

    #ADIPOCYTES
    contact.ElementCC3D("Energy", {
        "Type1": "Adipocytes",
        "Type2": "Adipocytes"
    }, 2)
    contact.ElementCC3D("Energy", {
        "Type1": "Adipocytes",
        "Type2": "Lumen"
    }, 10)

    #LUMEN
    contact.ElementCC3D("Energy", {"Type1": "Lumen", "Type2": "Lumen"}, 1)

    #FATTYs
    contact.ElementCC3D("Energy", {"Type1": "Fatty", "Type2": "Fatty"}, 2)
    contact.ElementCC3D("Energy", {"Type1": "Fatty", "Type2": "IC"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "Fatty", "Type2": "BC"}, 100)
    contact.ElementCC3D("Energy", {"Type1": "Fatty", "Type2": "Medium"}, 100)
    contact.ElementCC3D("Energy", {"Type1": "Fatty", "Type2": "ECM"}, 5)
    contact.ElementCC3D("Energy", {"Type1": "Fatty", "Type2": "Epidermis"}, 30)
    contact.ElementCC3D("Energy", {
        "Type1": "Fatty",
        "Type2": "Progenitors"
    }, 10)
    contact.ElementCC3D("Energy", {"Type1": "Fatty", "Type2": "PPap"}, 30)
    contact.ElementCC3D("Energy", {"Type1": "Fatty", "Type2": "QPap"}, 30)
    contact.ElementCC3D("Energy", {"Type1": "Fatty", "Type2": "PRet"}, 30)
    contact.ElementCC3D("Energy", {"Type1": "Fatty", "Type2": "QRet"}, 30)
    contact.ElementCC3D("Energy", {"Type1": "Fatty", "Type2": "Adipocytes"}, 2)
    contact.ElementCC3D("Energy", {"Type1": "Fatty", "Type2": "Lumen"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "Fatty", "Type2": "MyoF"}, 20)
    contact.ElementCC3D("Energy", {"Type1": "Fatty", "Type2": "QMyoF"}, 20)

    #MYOF
    contact.ElementCC3D("Energy", {"Type1": "MyoF", "Type2": "MyoF"}, 2)
    contact.ElementCC3D("Energy", {"Type1": "MyoF", "Type2": "Medium"}, 100)
    contact.ElementCC3D("Energy", {"Type1": "MyoF", "Type2": "ECM"}, 100)
    contact.ElementCC3D("Energy", {"Type1": "MyoF", "Type2": "Epidermis"}, 10)
    contact.ElementCC3D("Energy", {
        "Type1": "MyoF",
        "Type2": "Progenitors"
    }, 10)
    contact.ElementCC3D("Energy", {"Type1": "MyoF", "Type2": "PPap"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "MyoF", "Type2": "QPap"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "MyoF", "Type2": "PRet"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "MyoF", "Type2": "QRet"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "MyoF", "Type2": "Adipocytes"}, 20)
    contact.ElementCC3D("Energy", {"Type1": "MyoF", "Type2": "Lumen"}, 100)

    #QMYOF
    contact.ElementCC3D("Energy", {"Type1": "QMyoF", "Type2": "QMyoF"}, 5)
    contact.ElementCC3D("Energy", {"Type1": "QMyoF", "Type2": "Medium"}, 50)
    contact.ElementCC3D("Energy", {
        "Type1": "QMyoF",
        "Type2": "ECM"
    }, 1)  #changed from 100
    contact.ElementCC3D("Energy", {"Type1": "QMyoF", "Type2": "Epidermis"}, 10)
    contact.ElementCC3D("Energy", {
        "Type1": "QMyoF",
        "Type2": "Progenitors"
    }, 10)
    contact.ElementCC3D("Energy", {"Type1": "QMyoF", "Type2": "PPap"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "QMyoF", "Type2": "QPap"}, 5)
    contact.ElementCC3D("Energy", {"Type1": "QMyoF", "Type2": "PRet"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "QMyoF", "Type2": "QRet"}, 5)
    contact.ElementCC3D("Energy", {
        "Type1": "QMyoF",
        "Type2": "Adipocytes"
    }, 20)
    contact.ElementCC3D("Energy", {"Type1": "QMyoF", "Type2": "Lumen"}, 20)
    contact.ElementCC3D("Energy", {"Type1": "QMyoF", "Type2": "MyoF"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "QMyoF", "Type2": "BC"}, 100)
    contact.ElementCC3D("Energy", {"Type1": "QMyoF", "Type2": "IC"}, 10)

    #BLOOD CLOT
    contact.ElementCC3D("Energy", {"Type1": "BC", "Type2": "BC"}, 2)
    contact.ElementCC3D("Energy", {"Type1": "BC", "Type2": "Medium"}, 2)
    contact.ElementCC3D("Energy", {"Type1": "BC", "Type2": "ECM"}, 100)
    contact.ElementCC3D("Energy", {"Type1": "BC", "Type2": "Epidermis"}, 30)
    contact.ElementCC3D("Energy", {"Type1": "BC", "Type2": "Progenitors"}, 100)
    contact.ElementCC3D("Energy", {"Type1": "BC", "Type2": "PPap"}, 100)
    contact.ElementCC3D("Energy", {"Type1": "BC", "Type2": "QPap"}, 100)
    contact.ElementCC3D("Energy", {"Type1": "BC", "Type2": "PRet"}, 100)
    contact.ElementCC3D("Energy", {"Type1": "BC", "Type2": "QRet"}, 100)
    contact.ElementCC3D("Energy", {"Type1": "BC", "Type2": "Adipocytes"}, 100)
    contact.ElementCC3D("Energy", {"Type1": "BC", "Type2": "Lumen"}, 100)
    contact.ElementCC3D("Energy", {"Type1": "BC", "Type2": "MyoF"}, 100)

    #IMMUNE CELLS & COMPANY
    contact.ElementCC3D("Energy", {"Type1": "IC", "Type2": "IC"}, 5)
    contact.ElementCC3D("Energy", {"Type1": "IC", "Type2": "BC"}, 100)
    contact.ElementCC3D("Energy", {"Type1": "IC", "Type2": "Medium"}, 100)
    contact.ElementCC3D("Energy", {"Type1": "IC", "Type2": "ECM"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "IC", "Type2": "Epidermis"}, 30)
    contact.ElementCC3D("Energy", {"Type1": "IC", "Type2": "Progenitors"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "IC", "Type2": "PPap"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "IC", "Type2": "QPap"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "IC", "Type2": "PRet"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "IC", "Type2": "QRet"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "IC", "Type2": "Adipocytes"}, 10)
    contact.ElementCC3D("Energy", {"Type1": "IC", "Type2": "Lumen"}, 50)
    contact.ElementCC3D("Energy", {"Type1": "IC", "Type2": "MyoF"}, 2)

    #Neighbor order
    contact.ElementCC3D("NeighborOrder", {},
                        CNOrder)  # changed to CNOrder instead of 5

    #OTHER PLUGINS

    boundaryPTracker = CompuCell3DElement.ElementCC3D(
        "Plugin", {"Name": "BoundaryPixelTracker"})
    #     boundaryPTracker.ElementCC3D("NeighborOrder",{},"1")

    vlFlex = CompuCell3DElement.ElementCC3D("Plugin",
                                            {"Name": "VolumeLocalFlex"})

    coMass = CompuCell3DElement.ElementCC3D("Plugin", {"Name": "CenterOfMass"})

    neighborTracker = CompuCell3DElement.ElementCC3D(
        "Plugin", {"Name": "NeighborTracker"})

    SteppableElmnt = CompuCell3DElement.ElementCC3D("Steppable",
                                                    {"Type": "BoxWatcher"})

    # Module tracing boundaries of the minimal box enclosing all the cells. May speed up calculations. May have no effect for parallel version
    SteppableElmnt.ElementCC3D("XMargin", {}, "5")
    SteppableElmnt.ElementCC3D("YMargin", {}, "5")
    SteppableElmnt.ElementCC3D("ZMargin", {}, "5")

    # Secretion
    secretion = CompuCell3DElement.ElementCC3D("Plugin", {"Name": "Secretion"})
    #     secretionchemicalField1=secretion.ElementCC3D("Field", {"Name":"EpidermalGrowthSignal"})
    #     secretionchemicalField1.ElementCC3D("Secretion",{"Type":"Epidermis"},"10.0")
    #     secretionchemicalField2=secretion.ElementCC3D("Field", {"Name":"ECMSignal"})
    #     secretionchemicalField2.ElementCC3D("Secretion",{"Type":"Lumen"},"100.0")
    # #     secretionchemicalField2.ElementCC3D("Secretion",{"Type":"ECM"},"5.0")
    #     secretionchemicalField2.ElementCC3D("Secretion",{"Type":"QRet"},"5.0")
    #     secretionchemicalField2.ElementCC3D("Secretion",{"Type":"QPap"},"5.0")
    secretionchemicalField3 = secretion.ElementCC3D(
        "Field", {"Name": "WoundHealingSignal"})
    secretionchemicalField3.ElementCC3D("Secretion", {"Type": "IC"}, "1.0")
    #     secretionchemicalField3.ElementCC3D("SecretionOnContact",{"SecreteOnContactWith":"Progenitors, PPap, QRet","Type":"MyoF"},"50.0")

    # Chemotaxis
    chemotaxis = CompuCell3DElement.ElementCC3D("Plugin",
                                                {"Name": "Chemotaxis"})
    #     chemicalFieldEGF=chemotaxis.ElementCC3D("ChemicalField", {"Source":"DiffusionSolverFE", "Name":"EpidermalGrowthSignal"})
    chemicalFieldWH = chemotaxis.ElementCC3D("ChemicalField", {
        "Source": "DiffusionSolverFE",
        "Name": "WoundHealingSignal"
    })
    chemicalFieldWH.ElementCC3D("ChemotaxisByType", {
        "Type": "MyoF",
        "Lambda": -10
    })
    chemicalFieldWH.ElementCC3D("ChemotaxisByType", {
        "Type": "MyoF",
        "Epidermis": -100
    })

    # Specification of PDE solvers
    flexDiffSolver1 = CompuCell3DElement.ElementCC3D(
        "Steppable", {"Type": "SteadyStateDiffusionSolver2D"})
    diffusionFieldEGF = flexDiffSolver1.ElementCC3D("DiffusionField")
    diffusionDataEGF = diffusionFieldEGF.ElementCC3D("DiffusionData")
    diffusionDataEGF.ElementCC3D("FieldName", {}, "EpidermalGrowthSignal")
    #     diffusionDataEGF.ElementCC3D("GlobalDiffusionConstant",{},1e-1)
    #     diffusionDataEGF.ElementCC3D("GlobalDecayConstant",{},1e-3)
    diffusionDataEGF.ElementCC3D("DiffusionConstant", {}, 1e-1)
    diffusionDataEGF.ElementCC3D("DecayConstant", {}, 1e-3)
    diffusionDataEGF.ElementCC3D("DoNotDiffuseTo", {}, "Medium")
    diffusionDataEGF.ElementCC3D("DoNotDiffuseTo", {}, "Lumen")
    secretionDataEGF = diffusionFieldEGF.ElementCC3D("SecretionData")
    # When secretion is defined inside DissufionSolverFEall secretio nconstants are scaled automaticly to account for extra calls of the solver when handling large diffusion constants
    # Uniform secretion Definition
    secretionDataEGF.ElementCC3D("Secretion", {"Type": "Epidermis"}, "10.")
    BoundaryConditionsEGF = diffusionFieldEGF.ElementCC3D("BoundaryConditions")
    BoundaryConditionsEGF_X = BoundaryConditionsEGF.ElementCC3D(
        "Plane", {"Axis": "X"})
    BoundaryConditionsEGF_X.ElementCC3D("ConstantValue", {
        "PlanePosition": "Min",
        "Value": "0.0"
    })
    BoundaryConditionsEGF_X.ElementCC3D("ConstantValue", {
        "PlanePosition": "Max",
        "Value": "0.0"
    })
    BoundaryConditionsEGF_Y = BoundaryConditionsEGF.ElementCC3D(
        "Plane", {"Axis": "Y"})
    BoundaryConditionsEGF_Y.ElementCC3D("ConstantValue", {
        "PlanePosition": "Min",
        "Value": "0.0"
    })
    BoundaryConditionsEGF_Y.ElementCC3D("ConstantValue", {
        "PlanePosition": "Max",
        "Value": "0.0"
    })
    BoundaryConditionsEGF_Z = BoundaryConditionsEGF.ElementCC3D(
        "Plane", {"Axis": "Z"})
    BoundaryConditionsEGF_Z.ElementCC3D("ConstantDerivative", {
        "PlanePosition": "Min",
        "Value": "0.0"
    })
    BoundaryConditionsEGF_Z.ElementCC3D("ConstantDerivative", {
        "PlanePosition": "Max",
        "Value": "0.0"
    })

    flexDiffSolver = CompuCell3DElement.ElementCC3D(
        "Steppable", {"Type": "DiffusionSolverFE"})
    #     diffusionFieldECM=flexDiffSolver.ElementCC3D("DiffusionField")
    #     diffusionDataECM=diffusionFieldECM.ElementCC3D("DiffusionData")
    #     diffusionDataECM.ElementCC3D("FieldName",{},"ECMSignal")
    #     diffusionDataECM.ElementCC3D("DiffusionConstant",{},1e0)
    #     diffusionDataECM.ElementCC3D("DecayConstant",{},1e-5)
    # #     diffusionDataECM.ElementCC3D("DoNotDiffuseTo",{},"PPap")
    # #     diffusionDataECM.ElementCC3D("DoNotDiffuseTo",{},"Epidermis")
    #     diffusionDataECM.ElementCC3D("DoNotDiffuseTo",{},"Medium")
    #     diffusionDataECM.ElementCC3D("DoNotDiffuseTo",{},"Lumen")
    # #     diffusionDataECM.ElementCC3D("DecayConstant",{"CellType":"Lumen"},100)
    #     secretionDataECM=diffusionFieldEGF.ElementCC3D("SecretionData")
    #     # When secretion is defined inside DissufionSolverFEall secretio nconstants are scaled automaticly to account for extra calls of the solver when handling large diffusion constants
    #     # Uniform secretion Definition
    #     secretionDataECM.ElementCC3D("Secretion",{"Type":"Lumen"},"5.")
    # #     secretionDataECM.ElementCC3D("Secretion",{"Type":"QRet"},"1.")
    #     BoundaryConditionsECM=diffusionFieldECM.ElementCC3D("BoundaryConditions")
    #     BoundaryConditionsECM_X=BoundaryConditionsEGF.ElementCC3D("Plane",{"Axis":"X"})
    #     BoundaryConditionsECM_X.ElementCC3D("ConstantValue",{"PlanePosition":"Min","Value":"0.0"})
    #     BoundaryConditionsECM_X.ElementCC3D("ConstantValue",{"PlanePosition":"Max","Value":"0.0"})
    #     BoundaryConditionsECM_Y=BoundaryConditionsECM.ElementCC3D("Plane",{"Axis":"Y"})
    #     BoundaryConditionsECM_Y.ElementCC3D("ConstantValue",{"PlanePosition":"Min","Value":"0.0"})
    #     BoundaryConditionsECM_Y.ElementCC3D("ConstantValue",{"PlanePosition":"Max","Value":"0.0"})
    #     BoundaryConditionsECM_Z=BoundaryConditionsECM.ElementCC3D("Plane",{"Axis":"Z"})
    #     BoundaryConditionsECM_Z.ElementCC3D("ConstantDerivative",{"PlanePosition":"Min","Value":"0.0"})
    #     BoundaryConditionsECM_Z.ElementCC3D("ConstantDerivative",{"PlanePosition":"Max","Value":"0.0"})

    diffusionFieldWH = flexDiffSolver.ElementCC3D("DiffusionField")
    diffusionDataWH = diffusionFieldWH.ElementCC3D("DiffusionData")
    diffusionDataWH.ElementCC3D("FieldName", {}, "WoundHealingSignal")
    diffusionDataWH.ElementCC3D("DiffusionConstant", {}, 1e-0)
    diffusionDataWH.ElementCC3D("DecayConstant", {}, 1e-2)
    #     diffusionDataWH.ElementCC3D("DoNotDiffuseTo",{},"Medium")
    diffusionDataWH.ElementCC3D("DoNotDiffuseTo", {}, "Lumen")

    #     pifInitializer=CompuCell3DElement.ElementCC3D("Steppable",{"Type":"PIFInitializer"})
    #     pifInitializer.ElementCC3D("PIFName",{},"DermisMaturationCurrentConfiguration.piff01700.pif")

    #     pifDumper=CompuCell3DElement.ElementCC3D("Steppable",{"Type":"PIFDumper","Frequency":100})
    #     pifDumper.ElementCC3D("PIFName",{},"DermisMaturationCurrentConfiguration.piff")

    CompuCellSetup.setSimulationXMLDescription(CompuCell3DElement)
Пример #15
0
def configureSimulation(sim):
    import CompuCellSetup
    from XMLUtils import ElementCC3D

    CompuCell3DElmnt = ElementCC3D("CompuCell3D", {"version": "3.7.5"})
Пример #16
0
def configureSimulation(sim):
    import CompuCellSetup
    from XMLUtils import ElementCC3D
    from numpy import sqrt as nsqrt

    CompuCell3DElmnt = ElementCC3D("CompuCell3D", {
        "Revision": "20190430",
        "Version": "3.7.9"
    })

    PottsElmnt = CompuCell3DElmnt.ElementCC3D("Potts")
    PottsElmnt.ElementCC3D("Dimensions", {"x": "256", "y": "256", "z": "1"})
    PottsElmnt.ElementCC3D("Steps", {}, "10001")
    PottsElmnt.ElementCC3D("Temperature", {}, "10.0")
    PottsElmnt.ElementCC3D("NeighborOrder", {}, str(G_interact_range_G))

    PluginElmnt = CompuCell3DElmnt.ElementCC3D("Plugin", {"Name": "CellType"})
    PluginElmnt.ElementCC3D("CellType", {"TypeId": "0", "TypeName": "Medium"})
    PluginElmnt.ElementCC3D("CellType", {"TypeId": "1", "TypeName": "dark"})
    PluginElmnt.ElementCC3D("CellType", {"TypeId": "2", "TypeName": "light"})

    MetadataElmnt = CompuCell3DElmnt.ElementCC3D("Metadata")
    MetadataElmnt.ElementCC3D("DebugOutputFrequency", {}, "100")

    PluginElmnt_1 = CompuCell3DElmnt.ElementCC3D("Plugin", {"Name": "Volume"})
    PluginElmnt_1.ElementCC3D(
        "VolumeEnergyParameters", {
            "CellType": "dark",
            "LambdaVolume": str(G_lambdaVol_dark_G),
            "TargetVolume": str(G_targetVol_dark_G)
        })
    PluginElmnt_1.ElementCC3D(
        "VolumeEnergyParameters", {
            "CellType": "light",
            "LambdaVolume": str(G_lambdaVol_light_G),
            "TargetVolume": str(G_targetVol_light_G)
        })

    CompuCell3DElmnt.ElementCC3D("Plugin", {"Name": "CenterOfMass"})
    CompuCell3DElmnt.ElementCC3D("Plugin", {"Name": "NeighborTracker"})

    PluginElmnt_2 = CompuCell3DElmnt.ElementCC3D("Plugin", {"Name": "Contact"})
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "Medium",
        "Type2": "Medium"
    }, "10.0")
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "Medium",
        "Type2": "dark"
    }, str(G_J_dm_G))
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "Medium",
        "Type2": "light"
    }, str(G_J_lm_G))
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "dark",
        "Type2": "dark"
    }, str(G_J_dd_G))
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "dark",
        "Type2": "light"
    }, str(G_J_dl_G))
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "light",
        "Type2": "light"
    }, str(G_J_ll_G))
    PluginElmnt_2.ElementCC3D("NeighborOrder", {}, str(G_interact_range_G))

    SteppableElmnt = CompuCell3DElmnt.ElementCC3D("Steppable",
                                                  {"Type": "BlobInitializer"})
    RegionElmnt = SteppableElmnt.ElementCC3D("Region")
    RegionElmnt.ElementCC3D("Center", {"x": "128", "y": "128", "z": "0"})
    RegionElmnt.ElementCC3D("Radius", {}, "112")
    RegionElmnt.ElementCC3D("Gap", {}, "0")
    RegionElmnt.ElementCC3D(
        "Width", {}, str(int(round(nsqrt(G_targetVol_light_G))))
    )  #this way they will be about the right size to begin with
    RegionElmnt.ElementCC3D("Types", {}, "dark,light")

    CompuCellSetup.setSimulationXMLDescription(CompuCell3DElmnt)
Пример #17
0
def configureSimulation(sim):
    import CompuCellSetup
    from XMLUtils import ElementCC3D
    import NewSimulation_parameters as p

    CompuCell3DElmnt = ElementCC3D("CompuCell3D", {
        "Revision": "20180621",
        "Version": "3.7.8"
    })
    PottsElmnt = CompuCell3DElmnt.ElementCC3D("Potts")
    PottsElmnt.ElementCC3D("Dimensions", {"x": "111", "y": "111", "z": "111"})
    PottsElmnt.ElementCC3D("Steps", {}, p.mcs)
    PottsElmnt.ElementCC3D("Temperature", {}, "20.0")
    PottsElmnt.ElementCC3D("NeighborOrder", {}, "3")
    PluginElmnt = CompuCell3DElmnt.ElementCC3D(
        "Plugin", {"Name": "CellType"},
        "      !-- Listing all cell types in the simulation -->")
    PluginElmnt.ElementCC3D("CellType", {"TypeId": "0", "TypeName": "Medium"})
    PluginElmnt.ElementCC3D("CellType", {"TypeId": "1", "TypeName": "NPCells"})
    PluginElmnt.ElementCC3D("CellType", {"TypeId": "2", "TypeName": "ACells"})
    PluginElmnt.ElementCC3D("CellType", {
        "Freeze": "",
        "TypeId": "3",
        "TypeName": "Wall"
    })
    PluginElmnt_1 = CompuCell3DElmnt.ElementCC3D("Plugin", {"Name": "Volume"})
    PluginElmnt_1.ElementCC3D("VolumeEnergyParameters", {
        "CellType": "NPCells",
        "LambdaVolume": "50.0",
        "TargetVolume": "300"
    })
    PluginElmnt_1.ElementCC3D("VolumeEnergyParameters", {
        "CellType": "ACells",
        "LambdaVolume": "50.0",
        "TargetVolume": "300"
    })
    CompuCell3DElmnt.ElementCC3D("Plugin", {"Name": "CenterOfMass"})
    PluginElmnt_2 = CompuCell3DElmnt.ElementCC3D(
        "Plugin", {"Name": "Contact"},
        "       Specification of adhesion energies ")
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "Medium",
        "Type2": "Medium"
    }, "0.0")
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "Medium",
        "Type2": "NPCells"
    }, "5.0")
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "Medium",
        "Type2": "ACells"
    }, "5.0")
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "NPCells",
        "Type2": "NPCells"
    }, "5.0")
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "NPCells",
        "Type2": "ACells"
    }, p.AED)
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "ACells",
        "Type2": "ACells"
    }, "5.0")
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "Wall",
        "Type2": "Wall"
    }, "5.0")
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "Wall",
        "Type2": "NPCells"
    }, "5.0")
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "Wall",
        "Type2": "ACells"
    }, "5.0")
    PluginElmnt_2.ElementCC3D("NeighborOrder", {}, "2")

    #   PluginElmnt_2a=CompuCell3DElmnt.ElementCC3D("Plugin",{"Name":"CenterOfMass"})     # jps needed to get cell's center of mass
    PluginElmnt_2b = CompuCell3DElmnt.ElementCC3D(
        "Plugin",
        {"Name": "NeighborTracker"})  # jps needed to get cell's  neighbors
    #   PluginElmnt_2c=CompuCell3DElmnt.ElementCC3D("Plugin",{"Name":"PixelTracker"})     # jps Module tracking pixels of each cell
    #   PluginElmnt_2d=CompuCell3DElmnt.ElementCC3D("Plugin",{"Name":"BoundaryPixelTracker"})# jps Module tracking boundary pixels of each cell
    #   PluginElmnt_2d.ElementCC3D("NeighborOrder",{},"1")

    PluginElmnt_3 = CompuCell3DElmnt.ElementCC3D("Plugin",
                                                 {"Name": "Chemotaxis"})
    ChemicalFieldElmnt = PluginElmnt_3.ElementCC3D(
        "ChemicalField", {
            "Name": "Wnt9b",
            "Source": "DiffusionSolverFE"
        })
    ChemicalFieldElmnt.ElementCC3D("ChemotaxisByType", {
        "Lambda": p.CL,
        "Type": "NPCells"
    })
    PluginElmnt_4 = CompuCell3DElmnt.ElementCC3D("Plugin",
                                                 {"Name": "Secretion"})
    FieldElmnt = PluginElmnt_4.ElementCC3D("Field", {"Name": "Wnt9b"})
    FieldElmnt.ElementCC3D("Secretion", {"Type": "Wall"}, p.SR)
    FieldElmnt.ElementCC3D("Secretion", {"Type": "NPCells"}, p.SR)
    SteppableElmnt = CompuCell3DElmnt.ElementCC3D(
        "Steppable", {"Type": "DiffusionSolverFE"})
    DiffusionFieldElmnt = SteppableElmnt.ElementCC3D("DiffusionField",
                                                     {"Name": "Wnt9b"})
    DiffusionDataElmnt = DiffusionFieldElmnt.ElementCC3D("DiffusionData")
    DiffusionDataElmnt.ElementCC3D("FieldName", {}, "Wnt9b")
    DiffusionDataElmnt.ElementCC3D("GlobalDiffusionConstant", {}, p.GDC)
    DiffusionDataElmnt.ElementCC3D("GlobalDecayConstant", {}, p.decay)
    DiffusionDataElmnt.ElementCC3D("ExtraTimesPerMCS", {}, "8")
    DiffusionDataElmnt.ElementCC3D("DoNotDiffuseTo", {}, "Wall")
    SteppableElmnt_1 = CompuCell3DElmnt.ElementCC3D("Steppable",
                                                    {"Type": "PIFInitializer"})
    SteppableElmnt_1.ElementCC3D("PIFName", {},
                                 "Simulation/all cells uniform3d_v2.piff")

    CompuCellSetup.setSimulationXMLDescription(CompuCell3DElmnt)
Пример #18
0
def configureSimulation(sim):
    import CompuCellSetup
    from XMLUtils import ElementCC3D

    CompuCell3DElmnt = ElementCC3D("CompuCell3D", {
        "Revision": "20190430",
        "Version": "3.7.9"
    })

    PottsElmnt = CompuCell3DElmnt.ElementCC3D("Potts")

    # Basic properties of CPM (GGH) algorithm
    PottsElmnt.ElementCC3D("Dimensions", {"x": "100", "y": "100", "z": "1"})
    PottsElmnt.ElementCC3D("Steps", {}, "1000")
    PottsElmnt.ElementCC3D("Temperature", {}, "10.0")
    PottsElmnt.ElementCC3D("NeighborOrder", {}, "1")

    PluginElmnt = CompuCell3DElmnt.ElementCC3D("Plugin", {"Name": "CellType"})

    # Listing all cell types in the simulation
    PluginElmnt.ElementCC3D("CellType", {"TypeId": "0", "TypeName": "Medium"})
    PluginElmnt.ElementCC3D("CellType", {"TypeId": "1", "TypeName": "cell2"})
    PluginElmnt.ElementCC3D("CellType", {"TypeId": "2", "TypeName": "cell1"})

    PluginElmnt_1 = CompuCell3DElmnt.ElementCC3D("Plugin", {"Name": "Volume"})
    PluginElmnt_1.ElementCC3D("VolumeEnergyParameters", {
        "CellType": "cell2",
        "LambdaVolume": "2.0",
        "TargetVolume": "25"
    })
    PluginElmnt_1.ElementCC3D("VolumeEnergyParameters", {
        "CellType": "cell1",
        "LambdaVolume": "2.0",
        "TargetVolume": "25"
    })

    PluginElmnt_2 = CompuCell3DElmnt.ElementCC3D("Plugin",
                                                 {"Name": "CenterOfMass"})

    # Module tracking center of mass of each cell

    PluginElmnt_3 = CompuCell3DElmnt.ElementCC3D("Plugin", {"Name": "Contact"})
    # Specification of adhesion energies
    PluginElmnt_3.ElementCC3D("Energy", {
        "Type1": "Medium",
        "Type2": "Medium"
    }, "10.0")
    PluginElmnt_3.ElementCC3D("Energy", {
        "Type1": "Medium",
        "Type2": "cell2"
    }, "10.0")
    PluginElmnt_3.ElementCC3D("Energy", {
        "Type1": "Medium",
        "Type2": "cell1"
    }, "10.0")
    PluginElmnt_3.ElementCC3D("Energy", {
        "Type1": "cell2",
        "Type2": "cell2"
    }, "10.0")
    PluginElmnt_3.ElementCC3D("Energy", {
        "Type1": "cell2",
        "Type2": "cell1"
    }, "10.0")
    PluginElmnt_3.ElementCC3D("Energy", {
        "Type1": "cell1",
        "Type2": "cell1"
    }, "10.0")
    PluginElmnt_3.ElementCC3D("NeighborOrder", {}, "1")

    SteppableElmnt = CompuCell3DElmnt.ElementCC3D("Steppable",
                                                  {"Type": "BlobInitializer"})

    # Initial layout of cells in the form of spherical (circular in 2D) blob
    RegionElmnt = SteppableElmnt.ElementCC3D("Region")
    RegionElmnt.ElementCC3D("Center", {"x": "50", "y": "50", "z": "0"})
    RegionElmnt.ElementCC3D("Radius", {}, "20")
    RegionElmnt.ElementCC3D("Gap", {}, "0")
    RegionElmnt.ElementCC3D("Width", {}, "5")
    RegionElmnt.ElementCC3D("Types", {}, "cell2,cell1")

    CompuCellSetup.setSimulationXMLDescription(CompuCell3DElmnt)

    CompuCellSetup.setSimulationXMLDescription(CompuCell3DElmnt)
Пример #19
0
def configureSimulation(sim):
    import CompuCellSetup
    from XMLUtils import ElementCC3D

    ## ********** Import Parameters Here 
    print '>>>>>>>>>>>>>>>> Before imports >>>>>>>>>>>>>>>>'
    print 'Current directory', os.getcwd()
    from Stats import ParamsContainer
    global params_container; params_container = ParamsContainer()
    params_dict = params_container.inputParamsFromFile('../tcseg/Simulation/params')

    global Dx; Dx = params_container.getNumberParam('Dx')
    global Dy; Dy = params_container.getNumberParam('Dy')
    global speed_up_sim; speed_up_sim = params_container.getBooleanParam('speed_up_sim')
    global batch; batch = params_container.getBooleanParam('batch')
    global hinder_cells_near_EN; hinder_cells_near_EN = params_container.getBooleanParam('hinder_cells_near_EN')
    global y_target_offset; y_target_offset = params_container.getNumberParam('y_target_offset')
    global pull_force_magnitude; pull_force_magnitude = params_container.getNumberParam('pull_force_magnitude')
    global pinch_force_relative_center; pinch_force_relative_center = params_container.getNumberParam('pinch_force_relative_center')
    global pinch_force_mag; pinch_force_mag = params_container.getNumberParam('pinch_force_mag')
    global pinch_force_falloff_sharpness; pinch_force_falloff_sharpness = params_container.getNumberParam('pinch_force_falloff_sharpness')
    global regional_mitosis; regional_mitosis = params_container.getNumberParam('regional_mitosis')

    print '>>>>>>>>>>>>>>>> After imports >>>>>>>>>>>>>>>>'
    CompuCell3DElmnt=ElementCC3D("CompuCell3D",{"Revision":"20140724","Version":"3.7.2"})
    PottsElmnt=CompuCell3DElmnt.ElementCC3D("Potts")
    
    # Basic properties of CPM (GGH) algorithm
    PottsElmnt.ElementCC3D("Dimensions",{"x":Dx,"y":Dy,"z":1})
    PottsElmnt.ElementCC3D("Steps",{},"2001")
    PottsElmnt.ElementCC3D("Temperature",{},"10.0")
    PottsElmnt.ElementCC3D("NeighborOrder",{},"1")
    
    PluginElmnt=CompuCell3DElmnt.ElementCC3D("Plugin",{"Name":"CellType"}) # Listing all cell types in the simulation
    PluginElmnt.ElementCC3D("CellType",{"TypeId":"0","TypeName":"Medium"})
    PluginElmnt.ElementCC3D("CellType",{"TypeId":"1","TypeName":"AnteriorLobe"})
    PluginElmnt.ElementCC3D("CellType",{"TypeId":"2","TypeName":"EN"})
    PluginElmnt.ElementCC3D("CellType",{"TypeId":"3","TypeName":"GZ"})
    PluginElmnt.ElementCC3D("CellType",{"TypeId":"4","TypeName":"Mitosing"})
    PluginElmnt.ElementCC3D("CellType",{"TypeId":"5","TypeName":"Segmented"})
    
    PluginElmnt_1=CompuCell3DElmnt.ElementCC3D("Plugin",{"Name":"Volume"}) # Cell property trackers and manipulators
    PluginElmnt_2=CompuCell3DElmnt.ElementCC3D("Plugin",{"Name":"Surface"})
    extPotential=CompuCell3DElmnt.ElementCC3D("Plugin",{"Name":"ExternalPotential"})
    PluginElmnt_4=CompuCell3DElmnt.ElementCC3D("Plugin",{"Name":"CenterOfMass"})
    PluginElmnt_6=CompuCell3DElmnt.ElementCC3D("Plugin",{"Name":"NeighborTracker"})
    PluginElmnt_6=CompuCell3DElmnt.ElementCC3D("Plugin",{"Name":"Secretion"})
    
    PluginElmnt_5=CompuCell3DElmnt.ElementCC3D("Plugin",{"Name":"Contact"}) # Specification of adhesion energies
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"Medium","Type2":"Medium"},"100.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"Medium","Type2":"AnteriorLobe"},"100.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"Medium","Type2":"EN"},"100.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"Medium","Type2":"GZ"},"100.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"Medium","Type2":"Mitosing"},"100.0")    
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"Medium","Type2":"Segmented"},"100.0")    
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"AnteriorLobe","Type2":"AnteriorLobe"},"10.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"AnteriorLobe","Type2":"EN"},"10.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"AnteriorLobe","Type2":"GZ"},"10.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"AnteriorLobe","Type2":"Mitosing"},"10.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"AnteriorLobe","Type2":"Segmented"},"10.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"EN","Type2":"EN"},"10.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"EN","Type2":"GZ"},"10.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"EN","Type2":"Mitosing"},"10.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"EN","Type2":"Segmented"},"10.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"GZ","Type2":"GZ"},"10.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"GZ","Type2":"Mitosing"},"10.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"GZ","Type2":"Segmented"},"10.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"Mitosing","Type2":"Mitosing"},"10.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"Mitosing","Type2":"Segmented"},"10.0")
    PluginElmnt_5.ElementCC3D("Energy",{"Type1":"Segmented","Type2":"Segmented"},"10.0")
    PluginElmnt_5.ElementCC3D("NeighborOrder",{},"1")

    
    ## EN GENE PRODUCT FIELD NOT ACCOMPLISHING ANYTHING MECHANISTIC, AND SLOWING DOWN SIMULATION A LOT
    ## ***** Define the properties of the Engrailed gene product ***** ##

    if hinder_cells_near_EN: # THIS IS TO AVOID SLOWDOWN WHEN FIELD NOT NECESSARY (sdh)
      SteppableElmnt=CompuCell3DElmnt.ElementCC3D("Steppable",{"Type":"DiffusionSolverFE"})
      DiffusionFieldElmnt=SteppableElmnt.ElementCC3D("DiffusionField",{"Name":"EN_GENE_PRODUCT"})
      DiffusionDataElmnt=DiffusionFieldElmnt.ElementCC3D("DiffusionData")
      DiffusionDataElmnt.ElementCC3D("FieldName",{},"EN_GENE_PRODUCT")
      DiffusionDataElmnt.ElementCC3D("GlobalDiffusionConstant",{},"10.0") # 0.05 for anterior retardation; 0.5 for bidirectional retardation
      DiffusionDataElmnt.ElementCC3D("GlobalDecayConstant",{},"0.05") # 0.005 for anterior retardation; 0.05 for bidirectional retardation

    ## ***** ##
    
    SteppableElmnt=CompuCell3DElmnt.ElementCC3D("Steppable",{"Type":"PIFInitializer"})
    
    # Initial layout of cells using PIFF file. Piff files can be generated using PIFGEnerator
    SteppableElmnt.ElementCC3D("PIFName",{},"Simulation/Dec2014_v02.piff")

    CompuCellSetup.setSimulationXMLDescription(CompuCell3DElmnt)
def configureSimulation(sim):
    import CompuCellSetup
    from XMLUtils import ElementCC3D

    CompuCell3DElmnt = ElementCC3D("CompuCell3D", {"version": "3.6.0"})

    # Basic properties of CPM (GGH) algorithm
    PottsElmnt = CompuCell3DElmnt.ElementCC3D("Potts")
    PottsElmnt.ElementCC3D("Dimensions", {"x": "50", "y": "50", "z": "50"})
    PottsElmnt.ElementCC3D("Steps", {}, "10000")
    PottsElmnt.ElementCC3D("Temperature", {}, "20.0")
    PottsElmnt.ElementCC3D("NeighborOrder", {}, "3")
    PottsElmnt.ElementCC3D("Boundary_x", {}, "Periodic")
    PottsElmnt.ElementCC3D("Boundary_y", {}, "Periodic")
    PottsElmnt.ElementCC3D("Boundary_z", {}, "Periodic")

    # Listing all cell types in the simulation
    PluginElmnt = CompuCell3DElmnt.ElementCC3D("Plugin", {"Name": "CellType"})
    PluginElmnt.ElementCC3D("CellType", {"TypeId": "0", "TypeName": "Medium"})
    PluginElmnt.ElementCC3D("CellType", {
        "TypeId": "1",
        "TypeName": "Endothelial"
    })

    # Constraint on cell volume. Each cell type has different constraint.
    # For more flexible specification of the constraint (done in Python) please use VolumeLocalFlex plugin
    PluginElmnt_1 = CompuCell3DElmnt.ElementCC3D("Plugin", {"Name": "Volume"})
    PluginElmnt_1.ElementCC3D("VolumeEnergyParameters", {
        "CellType": "Endothelial",
        "LambdaVolume": "20.0",
        "TargetVolume": "74"
    })

    # Specification of adhesion energies
    PluginElmnt_2 = CompuCell3DElmnt.ElementCC3D("Plugin", {"Name": "Contact"})
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "Medium",
        "Type2": "Medium"
    }, "0")
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "Medium",
        "Type2": "Endothelial"
    }, "12")
    PluginElmnt_2.ElementCC3D("Energy", {
        "Type1": "Endothelial",
        "Type2": "Endothelial"
    }, "5")
    PluginElmnt_2.ElementCC3D("NeighborOrder", {}, "4")

    # Specification of chemotaxis properties of select cell types.
    PluginElmnt_3 = CompuCell3DElmnt.ElementCC3D("Plugin",
                                                 {"Name": "Chemotaxis"})
    ChemicalFieldElmnt = PluginElmnt_3.ElementCC3D(
        "ChemicalField", {
            "Name": "VEGF",
            "Source": "FlexibleDiffusionSolverFE"
        })
    ChemicalFieldElmnt.ElementCC3D("ChemotaxisByType", {
        "ChemotactTowards": "Medium",
        "Lambda": "6000.0",
        "Type": "Endothelial"
    })

    # Specification of secretion properties of select cell types.
    # Specification of secretion properties of individual cells can be done in Python
    PluginElmnt_4 = CompuCell3DElmnt.ElementCC3D("Plugin",
                                                 {"Name": "Secretion"})
    FieldElmnt = PluginElmnt_4.ElementCC3D("Field", {"Name": "VEGF"})
    FieldElmnt.ElementCC3D("Secretion", {"Type": "Endothelial"}, "0.013")

    # Module allowing multiple calls of the PDE solver. By default number of extra calls is set to 0.
    # Change these settings to desired values after consulting CC3D manual on how to work with large diffusion constants (>0.16 in 3D with DeltaX=1.0 and DeltaT=1.0)
    PluginElmnt_5 = CompuCell3DElmnt.ElementCC3D("Plugin",
                                                 {"Name": "PDESolverCaller"})
    PluginElmnt_5.ElementCC3D("CallPDE", {
        "ExtraTimesPerMC": "0",
        "PDESolverName": "FlexibleDiffusionSolverFE"
    })

    # Specification of PDE solvers
    SteppableElmnt = CompuCell3DElmnt.ElementCC3D(
        "Steppable", {"Type": "FlexibleDiffusionSolverFE"})
    DiffusionFieldElmnt = SteppableElmnt.ElementCC3D("DiffusionField")
    DiffusionDataElmnt = DiffusionFieldElmnt.ElementCC3D("DiffusionData")
    DiffusionDataElmnt.ElementCC3D("FieldName", {}, "VEGF")
    DiffusionDataElmnt.ElementCC3D("DiffusionConstant", {}, "0.16")
    DiffusionDataElmnt.ElementCC3D("DecayConstant", {}, "0.016")
    # Additional options are:
    #DiffusionDataElmnt.ElementCC3D("DoNotDiffuseTo",{},"LIST YOUR CELL TYPES HERE")
    DiffusionDataElmnt.ElementCC3D("DoNotDecayIn", {}, "Endothelial")
    # DiffusionDataElmnt.ElementCC3D("ConcentrationFileName",{},"INITIAL CONCENTRATION FIELD - typically a file with path Simulation/NAME_OF_THE_FILE.txt")
    # To run solver for large diffusion constants you typically call solver multiple times - ExtraTimesPerMCS to specify additional calls to the solver in each MCS
    # IMPORTANT: make sure not to mix this setting with the PDESolverCaller module! See manual for more information
    # DiffusionDataElmnt.ElementCC3D("ExtraTimesPerMCS",{},"0")
    DiffusionDataElmnt.ElementCC3D("DeltaX", {}, "1.0")
    DiffusionDataElmnt.ElementCC3D("DeltaT", {}, "1.0")

    # Initial layout of cells in the form of rectangular slab
    SteppableElmnt_1 = CompuCell3DElmnt.ElementCC3D(
        "Steppable", {"Type": "UniformInitializer"})
    RegionElmnt = SteppableElmnt_1.ElementCC3D("Region")
    RegionElmnt.ElementCC3D("BoxMin", {"x": "15", "y": "15", "z": "15"})
    RegionElmnt.ElementCC3D("BoxMax", {"x": "35", "y": "35", "z": "35"})
    RegionElmnt.ElementCC3D("Gap", {}, "0")
    RegionElmnt.ElementCC3D("Width", {}, "4")
    RegionElmnt.ElementCC3D("Types", {}, "Endothelial")

    CompuCellSetup.setSimulationXMLDescription(CompuCell3DElmnt)
Пример #21
0
    def writeScreenshotDescriptionFile_XML(self, fileName):
        from XMLUtils import ElementCC3D

        screenshotFileElement = ElementCC3D("CompuCell3DScreenshots")

        for name in self.screenshotDataDict:
            scrData = self.screenshotDataDict[name]
            scrDescElement = screenshotFileElement.ElementCC3D("ScreenshotDescription")
            if scrData.spaceDimension == "2D":
                scrDescElement.ElementCC3D("Dimension", {}, str(scrData.spaceDimension))
                scrDescElement.ElementCC3D("Plot",
                                           {"PlotType": str(scrData.plotData[1]), "PlotName": str(scrData.plotData[0])})
                scrDescElement.ElementCC3D("Projection", {"ProjectionPlane": scrData.projection,
                                                          "ProjectionPosition": str(scrData.projectionPosition)})

            if scrData.spaceDimension == "3D":
                scrDescElement.ElementCC3D("Dimension", {}, str(scrData.spaceDimension))
                scrDescElement.ElementCC3D("Plot",
                                           {"PlotType": str(scrData.plotData[1]), "PlotName": str(scrData.plotData[0])})
                scrDescElement.ElementCC3D("CameraClippingRange",
                                           {"Min": str(scrData.clippingRange[0]), "Max": str(scrData.clippingRange[1])})
                scrDescElement.ElementCC3D("CameraFocalPoint",
                                           {"x": str(scrData.focalPoint[0]), "y": str(scrData.focalPoint[1]),
                                            "z": str(scrData.focalPoint[2])})
                scrDescElement.ElementCC3D("CameraPosition",
                                           {"x": str(scrData.position[0]), "y": str(scrData.position[1]),
                                            "z": str(scrData.position[2])})
                scrDescElement.ElementCC3D("CameraViewUp", {"x": str(scrData.viewUp[0]), "y": str(scrData.viewUp[1]),
                                                            "z": str(scrData.viewUp[2])})

            scrDescElement.ElementCC3D("Size", {"Width": str(scrData.win_width),
                                                "Height": str(scrData.win_height)})

            # saving complete visulaization gui settings
            self.appendBoolChildElement(elem=scrDescElement, elem_label='CellBorders',
                                        elem_value=scrData.cell_borders_on)
            self.appendBoolChildElement(elem=scrDescElement, elem_label='Cells',
                                        elem_value=scrData.cells_on)
            self.appendBoolChildElement(elem=scrDescElement, elem_label='ClusterBorders',
                                        elem_value=scrData.cluster_borders_on)
            self.appendBoolChildElement(elem=scrDescElement, elem_label='CellGlyphs',
                                        elem_value=scrData.cell_glyphs_on)
            self.appendBoolChildElement(elem=scrDescElement, elem_label='FPPLinks',
                                        elem_value=scrData.fpp_links_on)
            self.appendBoolChildElement(elem=scrDescElement, elem_label='BoundingBox',
                                        elem_value=scrData.bounding_box_on)

            self.appendBoolChildElement(elem=scrDescElement, elem_label='LatticeAxes',
                                        elem_value=scrData.lattice_axes_on)

            self.appendBoolChildElement(elem=scrDescElement, elem_label='LatticeAxesLabels',
                                        elem_value=scrData.lattice_axes_labels_on)

            invisible_types_str = ''
            if scrData.invisible_types is not None:
                invisible_types_str = ','.join(list(map(lambda x:str(x), scrData.invisible_types)))

            scrDescElement.ElementCC3D("TypesInvisible", {},invisible_types_str)


            # scrDescElement.ElementCC3D("TypesInvisible", {},
            #                            scrData.invisible_types if scrData.invisible_types is not None and len(scrData.invisible_types) else '')

            # scrDescElement.ElementCC3D("CellBorders", {"On": 1 if scrData.cell_borders_on else 0})

        screenshotFileElement.CC3DXMLElement.saveXML(str(fileName))
Пример #22
0
def configureSimulation(sim):
    import CompuCellSetup
    from XMLUtils import ElementCC3D

    cc3d = ElementCC3D("CompuCell3D")
    potts = cc3d.ElementCC3D("Potts")
    potts.ElementCC3D("Dimensions", {"x": 55, "y": 55, "z": 1})
    potts.ElementCC3D("Steps", {}, 1000)
    potts.ElementCC3D("Temperature", {}, 15)
    potts.ElementCC3D("Boundary_y", {}, "Periodic")

    cellType = cc3d.ElementCC3D("Plugin", {"Name": "CellType"})
    cellType.ElementCC3D("CellType", {"TypeName": "Medium", "TypeId": "0"})
    cellType.ElementCC3D("CellType", {"TypeName": "Amoeba", "TypeId": "1"})
    cellType.ElementCC3D("CellType", {"TypeName": "Bacteria", "TypeId": "2"})

    volume = cc3d.ElementCC3D("Plugin", {"Name": "Volume"})
    volume.ElementCC3D("TargetVolume", {}, 25)
    volume.ElementCC3D("LambdaVolume", {}, 15.0)

    surface = cc3d.ElementCC3D("Plugin", {"Name": "Surface"})
    surface.ElementCC3D("TargetSurface", {}, 25)
    surface.ElementCC3D("LambdaSurface", {}, 2.0)

    contact = cc3d.ElementCC3D("Plugin", {"Name": "Contact"})
    contact.ElementCC3D("Energy", {"Type1": "Medium", "Type2": "Medium"}, 0)
    contact.ElementCC3D("Energy", {"Type1": "Amoeba", "Type2": "Amoeba"}, 15)
    contact.ElementCC3D("Energy", {"Type1": "Amoeba", "Type2": "Medium"}, 8)
    contact.ElementCC3D("Energy", {
        "Type1": "Bacteria",
        "Type2": "Bacteria"
    }, 15)
    contact.ElementCC3D("Energy", {"Type1": "Bacteria", "Type2": "Amoeba"}, 15)
    contact.ElementCC3D("Energy", {"Type1": "Bacteria", "Type2": "Medium"}, 8)
    contact.ElementCC3D("NeighborOrder", {}, 2)

    chemotaxis = cc3d.ElementCC3D("Plugin", {"Name": "Chemotaxis"})
    chemicalField = chemotaxis.ElementCC3D("ChemicalField", {
        "Source": "DiffusionSolverFE",
        "Name": "FGF"
    })
    chemicalField.ElementCC3D("ChemotaxisByType", {
        "Type": "Amoeba",
        "Lambda": 3
    })
    chemicalField.ElementCC3D("ChemotaxisByType", {
        "Type": "Bacteria",
        "Lambda": 2
    })

    flexDiffSolver = cc3d.ElementCC3D("Steppable",
                                      {"Type": "DiffusionSolverFE"})
    diffusionField = flexDiffSolver.ElementCC3D("DiffusionField")
    diffusionData = diffusionField.ElementCC3D("DiffusionData")
    diffusionData.ElementCC3D("FieldName", {}, "FGF")
    diffusionData.ElementCC3D("DiffusionConstant", {}, 0.0)
    diffusionData.ElementCC3D("DecayConstant", {}, 0.0)
    diffusionData.ElementCC3D("ConcentrationFileName", {},
                              "Simulation/amoebaConcentrationField_2D.txt")

    pifInitializer = cc3d.ElementCC3D("Steppable", {"Type": "PIFInitializer"})
    pifInitializer.ElementCC3D("PIFName", {}, "Simulation/amoebae_2D.piff")

    CompuCellSetup.setSimulationXMLDescription(cc3d)
Пример #23
0
def configureSimulation(sim):
    import CompuCellSetup
    from XMLUtils import ElementCC3D

    cc3d = ElementCC3D("CompuCell3D")
    potts = cc3d.ElementCC3D("Potts")
    potts.ElementCC3D("Dimensions", {"x": 100, "y": 100, "z": 1})
    potts.ElementCC3D("Steps", {}, 10000)
    potts.ElementCC3D("Temperature", {}, 15)
    potts.ElementCC3D("NeighborOrder", {}, 2)

    cellType = cc3d.ElementCC3D("Plugin", {"Name": "CellType"})
    cellType.ElementCC3D("CellType", {"TypeName": "Medium", "TypeId": "0"})
    cellType.ElementCC3D("CellType", {"TypeName": "Bacterium", "TypeId": "1"})
    cellType.ElementCC3D("CellType", {"TypeName": "Macrophage", "TypeId": "2"})
    cellType.ElementCC3D("CellType", {
        "TypeName": "Wall",
        "TypeId": "3",
        "Freeze": ""
    })

    volume = cc3d.ElementCC3D("Plugin", {"Name": "Volume"})
    volume.ElementCC3D("TargetVolume", {}, 25)
    volume.ElementCC3D("LambdaVolume", {}, 15.0)

    surface = cc3d.ElementCC3D("Plugin", {"Name": "Surface"})
    surface.ElementCC3D("TargetSurface", {}, 20)
    surface.ElementCC3D("LambdaSurface", {}, 4.0)

    contact = cc3d.ElementCC3D("Plugin", {"Name": "Contact"})
    contact.ElementCC3D("Energy", {"Type1": "Medium", "Type2": "Medium"}, 0)
    contact.ElementCC3D("Energy", {
        "Type1": "Macrophage",
        "Type2": "Macrophage"
    }, 15)
    contact.ElementCC3D("Energy", {
        "Type1": "Macrophage",
        "Type2": "Medium"
    }, 8)
    contact.ElementCC3D("Energy", {
        "Type1": "Bacterium",
        "Type2": "Bacterium"
    }, 15)
    contact.ElementCC3D("Energy", {
        "Type1": "Bacterium",
        "Type2": "Macrophage"
    }, 15)
    contact.ElementCC3D("Energy", {"Type1": "Bacterium", "Type2": "Medium"}, 8)
    contact.ElementCC3D("Energy", {"Type1": "Wall", "Type2": "Wall"}, 0)
    contact.ElementCC3D("Energy", {"Type1": "Wall", "Type2": "Medium"}, 0)
    contact.ElementCC3D("Energy", {"Type1": "Wall", "Type2": "Bacterium"}, 50)
    contact.ElementCC3D("Energy", {"Type1": "Wall", "Type2": "Macrophage"}, 50)

    chemotaxis = cc3d.ElementCC3D("Plugin", {"Name": "Chemotaxis"})
    chemicalField = chemotaxis.ElementCC3D("ChemicalField", {
        "Source": "DiffusionSolverFE",
        "Name": "ATTR"
    })
    chemicalField.ElementCC3D("ChemotaxisByType", {
        "Type": "Macrophage",
        "Lambda": 200
    })

    flexDiffSolver = cc3d.ElementCC3D("Steppable",
                                      {"Type": "DiffusionSolverFE"})
    diffusionField = flexDiffSolver.ElementCC3D("DiffusionField")
    diffusionData = diffusionField.ElementCC3D("DiffusionData")
    diffusionData.ElementCC3D("FieldName", {}, "ATTR")
    diffusionData.ElementCC3D("DiffusionConstant", {}, 0.10)
    diffusionData.ElementCC3D("DecayConstant", {}, 0.0)
    diffusionData.ElementCC3D("DoNotDiffuseTo", {}, "Wall")
    secretionData = diffusionField.ElementCC3D("SecretionData")
    secretionData.ElementCC3D("Secretion", {"Type": "Bacterium"}, 200)

    pifInitializer = cc3d.ElementCC3D("Steppable", {"Type": "PIFInitializer"})
    pifInitializer.ElementCC3D("PIFName", {},
                               "Simulation/bacterium_macrophage_2D_wall.piff")

    CompuCellSetup.setSimulationXMLDescription(cc3d)