How to increase the font size of the flattened image

imagej
fiji
macro
Tags: #<Tag:0x00007fd541e662e8> #<Tag:0x00007fd541e661a8> #<Tag:0x00007fd541e66068>

#1

I have the following raw image:

And with the following code

open("/Users/pdubois/Desktop/myimage_raw.jpg")
setForegroundColor(255, 255, 255);
setBackgroundColor(0, 0, 0);
run("Duplicate...", "title=ImageCOPY");
makeOval(-4, 17, 3428, 3428);
run("Clear Outside");
run("Select None");
run("Duplicate...", "title=Clusters");
// Color Thresholder 2.0.0-rc-59/1.51j
// Autogenerated macro, single images only!
min=newArray(3);
max=newArray(3);
filter=newArray(3);
a=getTitle();
run("HSB Stack");
run("Convert Stack to Images");
selectWindow("Hue");
rename("0");
selectWindow("Saturation");
rename("1");
selectWindow("Brightness");
rename("2");
min[0]=125;
max[0]=255;
filter[0]="pass";
min[1]=0;
max[1]=255;
filter[1]="pass";
min[2]=65;
max[2]=255;
filter[2]="pass";
for (i=0;i<3;i++){
  selectWindow(""+i);
  setThreshold(min[i], max[i]);
  run("Convert to Mask");
  if (filter[i]=="stop")  run("Invert");
}
imageCalculator("AND create", "0","1");
imageCalculator("AND create", "Result of 0","2");
for (i=0;i<3;i++){
  selectWindow(""+i);
  close();
}
selectWindow("Result of 0");
close();
selectWindow("Result of Result of 0");
rename(a);
// Colour Thresholding-------------
setOption("BlackBackground", true);
run("Make Binary");
run("Options...", "iterations=6 count=3 black do=Dilate");
run("Options...", "iterations=20 count=1 black do=Close");
run("Remove Outliers...", "radius=20 threshold=50 which=Bright");
// HERE a good time to count groups of cells
run("Options...", "iterations=9 count=1 do=Dilate");
setThreshold(1, 255);
run("Analyze Particles...", "size=5000-Infinity show=Nothing exclude clear include summarize add");
//SELECT ORIGINAL OR BLACK-BACKGROUNDED IMAGE HERE
selectWindow("ImageCOPY");
run("Add Slice");
run("Select All");
run("Fill", "slice");
run("Select None");
//TRY LOOPING THROUGH THE ROI MANAGER HERE
for (z=0;z<roiManager("count"); z++){
  setSlice(1);
  run("Duplicate...", "title="+z);
  roiManager("Select", z);
  run("Clear Outside");
  run("Select None");
  // Color Thresholder 2.0.0-rc-59/1.51j
  // Autogenerated macro, single images only!
  min=newArray(3);
  max=newArray(3);
  filter=newArray(3);
  a=getTitle();
  run("HSB Stack");
  run("Convert Stack to Images");
  selectWindow("Hue");
  rename("0");
  selectWindow("Saturation");
  rename("1");
  selectWindow("Brightness");
  rename("2");
  min[0]=115;
  max[0]=255;
  filter[0]="pass";
  min[1]=0;
  max[1]=255;
  filter[1]="pass";
  min[2]=0;
  max[2]=82;
  filter[2]="pass";
  for (i=0;i<3;i++){
    selectWindow(""+i);
    setThreshold(min[i], max[i]);
    run("Convert to Mask");
    if (filter[i]=="stop")  run("Invert");
  }
  imageCalculator("AND create", "0","1");
  imageCalculator("AND create", "Result of 0","2");
  for (i=0;i<3;i++){
    selectWindow(""+i);
    close();
  }
  selectWindow("Result of 0");
  close();
  selectWindow("Result of Result of 0");
  rename(a);
  // Colour Thresholding-------------
  run("Make Binary");
  run("Watershed");
  run("Make Binary");
  run("Watershed");
  setThreshold(1, 255);
  run("Analyze Particles...", "size=0-Infinity show=Masks display exclude include    summarize");
  selectWindow("Mask of "+z);
  run("Copy");
  close();
  selectWindow(""+z);
  close();
  //ORIGINAL IMAGE REFERENCE HERE
  selectWindow("ImageCOPY");
  setSlice(2);
  setPasteMode("Transparent-white");
  run("Paste");
}
run("Select None");
rename("Composite Image");

// Saving things
saveAs("Jpeg", "/Users/pdubois/Desktop/Composite Image.jpg");
close();
selectWindow("Clusters");
run("Flatten");
run("Save", "save=/Users/pdubois/Desktop/Clusters-1.tif");
close();
selectWindow("Clusters");
close();
selectWindow("myimage_raw.jpg");

close();
saveAs("Results", "/Users/pdubois/Desktop/Summary.tsv");
run("Close");
selectWindow("ROI Manager");
run("Close");
selectWindow("Results");
run("Close");

Especially this line run("Save", "save=/Users/pdubois/Desktop/Clusters-1.tif");
Produces a file that looks like this

As you notice the font size of the cluster number (enclosed in red) is too small to view.
How can I increase that?


How to save the image created my Analyze Particles
#2

This looks like a bug in the Flatten command, which I will attempt to fix. In the meantime, you can work around the bug by using “Capture Image” (Plugins>Utilities>Capture Image) instead of Flatten, as in this example.

   run("Blobs (25K)");
   makeRectangle(52, 53, 129, 133);
   run("Crop");
   run("Size...", "width=3600 height=3712");
   setAutoThreshold("Default");
   run("Analyze Particles...", "exclude add");
   //run("Flatten");
   run("Capture Image");