//This aligns the slices of each individual time point. //This is useful to correct for movement artifact within a timepoint. //May be useful to run this first, then Align Hyperstack. stackregstr="StackReg "; if(indexOf(getInfo("imagej.dir"),"Fiji")>-1) stackregstr="StackReg"; if(isOpen("1")) exit("Please close 1"); getDimensions(w,h,chs,sls,frms); if(chs>1) run("Stack to RGB"); title=getTitle(); for(i=1;i<=frms;i++){ selectWindow(title); run("Duplicate...", "title="+i+" duplicate frames="+i); run(stackregstr, "transformation=Affine"); if(i!=1) run("Concatenate...", "stack1=1 stack2="+i+" title=1"); } rename(title+"-tpza"); run("Stack to Hyperstack...", "order=xyczt(default) channels=1 slices="+sls+" frames="+frms);