/** Batch_pairwise_coexpression_analysis_for_48_and_72hpf_Platynereis_larvae.ijm this macro merges gene expression scans for 48 or 72 hpf Platynereis larvae and shows the overlap (all against all) in white for the episphere as anterior view and the whole animal as lateral view to run this macro use Fiji http://fiji.sc/ all input files have to be in the same folder, and have to be the same size, generated by aligning your scans to the 48 or 72 hpf Dapi template provided in the paper by Asadulina et al. 2012 by Gaspar Jekely, 2012 */ G_Sdir=getDirectory("Choose the directory where the files are"); list=getFileList(G_Sdir); stage = getNumber("Stage (48 or 72): ", stage); //the stage (48 or 72 hpf) has to be defined for the cropping parameters //depending on the stage, the cropping parameters are assigned these values if (stage==72){rect1=61; rect2=92; rect3=320; rect4=470; rect5=0; rect6=0; rect7=451; rect8=241;rect9=0; rect10=0; rect11=451; rect12=241; rect13=68; rect14=0; rect15=315; rect16=315;} else if (stage==48){rect1=65; rect2=35; rect3=400; rect4=400; rect5=50; rect6=82; rect7=400; rect8=135; rect9=50; rect10=82; rect11=400; rect12=135; rect13=22; rect14=38; rect15=400; rect16=400;} else {print ("Stage has to be either 48 or 72!"); exit;} //this loops goes through all the image files in the selected directory for (k=0; k