//**************************************************************** // Create Dialog to select the appropriate Stacks //**************************************************************** Dialog.create("DistanceCorrelation"); if(nImages==0) { Dialog.addMessage("No Images Open!"); Dialog.show(); exit(); } ImageList=newArray(nImages); for (i=1; i<=nImages; i++) { selectImage(i); ImageList[i-1]=getTitle; } Dialog.addChoice("Fluorescence Image",ImageList); Dialog.addCheckbox("Calculate Diference?",false); Dialog.addNumber("relativ position before ROIj",1); Dialog.addNumber("relativ position after ROIj",1); Dialog.addChoice("Distance Map", ImageList); Dialog.addNumber("extend border by Pixels",5); ImageList=Array.concat("*none*",ImageList); Dialog.addChoice("Mask", ImageList); Dialog.addString("exclude the following Mask Values from analysis (e.g. 0-5,22)","0",50); Dialog.show(); FluorescenceImageOriginal=Dialog.getChoice(); DistanceMapOriginal=Dialog.getChoice(); MaskOriginal=Dialog.getChoice(); CalculateDifference=Dialog.getCheckbox(); PosBefore=Dialog.getNumber(); PosAfter=Dialog.getNumber(); ROIjWidth=Dialog.getNumber(); getDimensions(xmax,ymax,channels,slices,frames); //**************************************************************** // Create Binary Mapping Function to excluded particular Mask Values from further analysis //**************************************************************** valid=newArray(65536); // By Default all values bigger than 0 in the Mask image are considered as valid for(i=0;i<65536;i++) { valid[i]=true; } excludedValues=Dialog.getString()+","; do { indexC=indexOf(excludedValues,","); subStringC=substring(excludedValues,0,indexC); excludedValues=substring(excludedValues,indexC+1); indexR=indexOf(subStringC,"-"); if (indexR==-1) { low=parseInt(subStringC); high=low; } else { low=parseInt(substring(subStringC,0,indexR)); high=parseInt(substring(subStringC,indexR+1,indexC)); } for(i=low;i<=high;i++) { valid[i]=false; } } while (lengthOf(excludedValues)>0) //****************************************************************** /*print("test"); for(i=0;i<65536;i++) { if (!valid[i]) { print("not Valid "+i); } }*/ //**************************************************************** // Make Copy of the stacks and combine them for faster analysis //**************************************************************** //setBatchMode(true); FluorescenceImage="CopyFluorescence"; selectImage(FluorescenceImageOriginal); if (CalculateDifference) { print(" "+slices-PosBefore-PosAfter); run("Make Substack...", " slices="+PosBefore+PosAfter+2+"-"+slices); rename(FluorescenceImage); setSlice(nSlices); for(i=0;i