//Reading Simi files //Simi records tw0 files .sbd and .sbc //From the Simi manual: //3.1 .sbd and .sbc //A SIMI°BioCell project consists of two files. All created data of a project are //stored in a text file .sbd. The .sbc file contains information of the //corresponding disc and settings of the last lineage session as window size etc. ///////////////////////////////////////////////////////////////////////////////////////////////////// //### Data v4.00 #################################################### //# Header: # # # # # # # //SIMI*BIOCELL //400 //--- //# # # # # # # # # # # # //SIMI*BIOCELL = magic ID string //400 = file version 4.00 //--- = separator //# Cell: # # # # # # # # // // <= *count //--- // // <= *count //--- // <"right> <"right> // // // // <= *count //--- //# # # # # # # # # # # # // values are not used yet (for later implementation) // is a real hexadecimal RGB value (e.g. 00ff00 for green) // and are internal values of BioCell // are real pixels //################################################################### ///////////////////////////////////////////////////////////////////////////////////////////////////// //each cell entry is seperated by "---" //read the .txt file a line at a time pathfile=File.openDialog("Choose the file to Open:"); process(pathfile); ///////////////////////////////////////////////////////////////////Functions here/////////////////////////////////////////////////////////////////////////// function process(pathfile) { names = split(pathfile, "/"); nl=names.length; name=names[nl-2]+"_"+names[nl-1]; nam=split(name, "."); na=name; filestring=File.openAsString(pathfile); rows=split(filestring, "\n"); quad = "??"; //Define the arrays here embryo=newArray();// quadrant=newArray();// cell_name=newArray(); length=newArray();//the number of x,y,z entries for the cell start_frame=newArray(); start_x=newArray(); start_y=newArray(); start_z=newArray(); parent=newArray();// fate=newArray();// for(i=6; i 4) { //Gets the parent cell if there is one defined parent = Array.concat(parent, columns1[4]); } else { parent = Array.concat(parent, "None"); } start_x = Array.concat(start_x, columns3[1]); start_y = Array.concat(start_y, columns3[2]); start_z = Array.concat(start_z, columns3[3]); } } } //draws the summary table requires("1.38m"); title1 = "Lineage_Summary_Table"; title2 = "["+title1+"]"; ptab = title2; if (isOpen(title1)) { } else { if (getVersion>="1.41g") run("Table...", "name="+title2+" width=1000 height=300"); else run("New... ", "name="+title2+" type=Table width=250 height=600"); print(ptab,"\\Headings:Embryo\tCell\tLevel\tTc (mins)\tSeed?\tFlag"); } //the x positions of the nodes in the tree are fixed to a corresponding node (let a or 1 = left and p 04 " = right in the names) x_index = newArray(10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200,210,220,230,240,250,260,270,280,290,300,310,320,330,340,350,360,370,380,390,400,410,420,430,440,450,460,470,480,490,500,510,520,530,540,550,560,570,580,590,600,610,620); nodes_2 = newArray("aaaaa","aaaa","aaaap","aaa","aaapa","aaap","aaapp","aa","aapaa","aapa","aapap","aap","aappa","aapp","aappp","a","apaaa","apaa","apaap","apa","apapa","apap","apapp","ap","appaa","appa","appap","app","apppa","appp","apppp","paaaa","paaa","paaap","paa","paapa","paap","paapp","pa","papaa","papa","papap","pap","pappa","papp","pappp","p","ppaaa","ppaa","ppaap","ppa","ppapa","ppap","ppapp","pp","pppaa","pppa","pppap","ppp","ppppa","pppp","ppppp"); nodes_1 = newArray("11111","1111","11112","111","11121","1112","11122","11","11211","1121","11212","112","11221","1122","11222","1","12111","1211","12112","121","12121","1212","12122","12","12211","1221","12212","122","12221","1222","12222","21111","2111","21112","211","21121","2112","21122","21","21211","2121","21212","212","21221","2122","21222","2","22111","2211","22112","221","22121","2212","22122","22","22211","2221","22212","222","22221","2222","22222"); //the distance between the nodes at each level is therefore also fixed level_index = newArray(1,2,3,4,5,6,7,8); level_distance = newArray(310,160,80,40,20,10,5,2.5); //determine from the corresponding .sbc file the calibration and the left/right delimiter //STARTFRAME=0 frame the anlysis starts //SCANCOUNT=258 at least as long as the recording??? //LEVELCOUNT=13 the number of z frames at each timepoint //SCANTIME=6000 time between frames in 1/10 sec 6000 = 10 mins root = substring(pathfile, 0, lengthOf(pathfile)-3); pathfile2 = root+"sbc"; if (File.exists(pathfile2) == "0") {print("Error: Cannot find corresponding .sbc file!");} else { filestring2=File.openAsString(pathfile2); rows2=split(filestring2, "\n"); //get left in a loop for (i=0; i 1) { for (v=0; v go back to lengths for (m=0; m