/* * BlindAnalysis.ijm * This macro will take a directory of TIFFs * strip the label from them * save each with a randomised filename * log the association between original file and blind analysis file * Adapted from: * Shuffler macro by Christophe Leterrier v1.0 26/06/08 */ macro "Blind Analysis" { DIR_PATH=getDirectory("Select a directory"); print("\\Clear"); print("DIR_PATH :"+DIR_PATH); // Get all file names ALL_NAMES=getFileList(DIR_PATH); // Create the output folder OUTPUT_DIR=DIR_PATH+"BLIND"+File.separator; File.makeDirectory(OUTPUT_DIR); // How many TIFFs do we have? Directory could contain other directories. for (i=0; i0) { IM_NUMBER=IM_NUMBER+1; } } IM_NAMES=newArray(IM_NUMBER); IM_EXT=newArray(IM_NUMBER); // Test all files for extension j=0; for (i=0; i0) { IM_NAMES[j]=ALL_NAMES[i]; j=j+1; } } // Generate a permutation array of length IM_NUMBER IM_PERM=newArray(IM_NUMBER); for(j=0; j