// Transfer Labels macro by Christophe Leterrier // Allow to transfer label from one stack to another, changing one string into another in the slice labels. Useful if a process creates a new stack without carrying labels information macro "Transfer_Labels" { nDEST=nSlices; if (nDEST==1) exit("Destination is not a stack"); DEST=getTitle; setBatchMode(true); if (nImages<1) exit("Not enough images"); TITLES=newArray(nImages); for (i=1; i<=nImages; i++) { selectImage(i); TITLES[i-1]=getTitle; } Dialog.create("Label Parameters"); Dialog.addChoice("Source stack",TITLES,TITLES[0]); Dialog.addNumber("Crop labels by", 3,0,1,"characters"); Dialog.addString("Add to label:", "", 6); Dialog.show; SOURCE=Dialog.getChoice; CROP=Dialog.getNumber; ADD=Dialog.getString; selectImage(SOURCE); nSOURCE=nSlices; if (nSOURCE!=nDEST) exit("Source and destination do not have the same slice number !"); LABELS=newArray(nSOURCE); for (i=0; i