objref f2 // Define object reference for the cells2include file
objref celltypestring[1], techstring[1], cellType[1] // Define placeholder objects with a size of one, then
// redefine them with the correct size in the proc
double cellnumvar[1], cellLayerflag[1], cellArtflag[1], numCellTypes[1] // Define placeholder doubles with a size
// of one, then redefine them with the
// correct size in the proc
objref pnmtmp, pctmp, nil
proc loadCellCategoryInfo() {local i, startpos, tmpct // Load celltype info into a CellCategoryInfo
// object (one object per cell type)
f2 = new File()
sprint(cmdstr, "../datasets/cellnumbers_%g.dat", NumData)
f2.ropen(cmdstr) // Open the celltype
numCellTypes = f2.scanvar // Scan the first line, which contains a number giving the
// # cell types, including stimulating (artificial) cells (still?)
// Define variables to temporarily hold data scanned from file
objref celltypestring[numCellTypes], techstring[numCellTypes], cellType[numCellTypes]
double cellnumvar[numCellTypes], cellLayerflag[numCellTypes], cellArtflag[numCellTypes]
// LEFT OFF HERE WITH FIXING THE DOCUMENTATION!!!
tmpct=0 //## added for now
for i=0, numCellTypes-1 {
celltypestring[i]= new String()
techstring[i] = new String()
f2.scanstr(celltypestring[i].s) // Scan in the cell name
f2.scanstr(techstring[i].s)
cellnumvar[i]=f2.scanvar // Scan in the initial (before sclerosis) number of each cell type
cellLayerflag[i]=f2.scanvar // Scan the layer flag (hilar=2, granular=1, molecular=0), where hilar cells
// are subject to sclerosis
cellArtflag[i]=f2.scanvar // Scan the artificial flag, 1 = artificial cell, 0 = real cell
if (cellLayerflag[i]==0) { // For cell types that are susceptible to death (sclerosis)
cellnumvar[i] = int(cellnumvar[i] * ((100-PercentCellDeath)/100)) // Calculate the # of cells after sclerosis
}
cellnumvar[i]=int(cellnumvar[i]/Scale + .5) // Account for the scaled model size
if (cellnumvar[i]<1) {
cellnumvar[i]=1 // If all cells of a type are killed or cell size is scaled to less than 1, add 1 back
}
tmpct = tmpct + cellnumvar[i] //## added for now
}
f2.close()
startpos=0
for i=0, numCellTypes-1 {
cellType[i] = new CellCategoryInfo(i) // Make one object for each cell type to store cell type info
cellType[i].setCellTypeParams(celltypestring[i].s, techstring[i].s, startpos, cellnumvar[i], cellLayerflag[i], cellArtflag[i]) // Set parameters
cellType[i].numCons = new Vector(numCellTypes,0)
cellType[i].setCellTypeDist // Load distribution file
startpos = startpos + cellnumvar[i] // Increment the startGid for the next cell type's call to setCellTypeParams
}
}
loadCellCategoryInfo()