0

I am trying to create a macro that will run a loop through a file containing images. To open the images I am using Bio-Format importer, and the code is working, however, it prompts me to choose the image in the file every time. Is there a way to make it automatically run through the file? this is my code below... any help would be appreciated..

these are some other formats that ive tried and still cant get it to work

run("Bio-Formats Importer", "open= + inputDirectory + fileList[i] color_mode=Default view=Hyperstack stack_order=XYCZT");

run("Bio-Formats Importer", "open(fileList) color_mode=Default rois_import=[ROI manager] split_channels view=Hyperstack stack_order=XYCZT");

run("Bio-Formats Importer", "open= + inputDirectory + fileList[i] color_mode=Default rois_import=[ROI manager] split_channels view=Hyperstack stack_order=XYCZT")

run("Bio-Formats", "open=" + fileList[i] " color_mode=Default  open_all_series rois_import=[ROI manager] split_channels view=Hyperstack stack_order=XYCZT");

run("Bio-Formats Importer", "open=["+fileList[i]+"] color_mode=Default view=Hyperstack stack_order=XYCZT series_"+d2s(j,0)); 


setBatchMode(true); 
inputDirectory = getDirectory("Choose a Directory of Image")

fileList = getFileList(inputDirectory);

for (i = 0; i < fileList.length; i++)
{
processImage(fileList[i]);
outputDirectory = "S:/Research/MLW/OUTPUT/";
outputFile = outputDirectory+fileList[i]+".csv";
saveAs("results",outputFile);
}

setBatchMode(false); 

function processImage(imageFile)
{
prevNumResults = nResults;  

run("Bio-Formats Macro Extensions"); 

run("Bio-Formats Importer", "open= + inputDirectory + fileList[i] color_mode=Default rois_import=[ROI manager] split_channels view=Hyperstack stack_order=XYCZT");  

   filename = getTitle();

run("Auto Threshold", "method=Yen white");
run("Skeletonize (2D/3D)");
mwilson
  • 1
  • 1

1 Answers1

0

This might be as simple as moving everything inside the setBatchMode function

ekiely
  • 92
  • 8