There are already implemented three kinds of macros:

For object detection

  • iMSRC will be able to open and manage the 1st SCAN image to run the object detection on it by simply adding one code line,   

ie. on image-j software: open("#file#");

  • To work with the pixels of the image we have to reset any calibration of the image.

i.e. on image-j software: run("Set Scale...", "distance=0 known=0 pixel=1 unit=pixel");

  • For mosaics detection upper left corner and bottom right corner of the object.

i.e. on image j software:  run("Set Measurements...", "  bounding redirect=None decimal=3"); 

  • For Single fields macro will have to detect the objects center of mass

i.e. on image j software:  run("Set Measurements...", "  center redirect=None decimal=0"); 

Remove non informative areas macros

These kind of macros are developed for best adjusting 2nd scan mosaics captures, While the object detection macro just find the minimum square that cover the object detected, this script will run on this macro detected regions a square with  size of a 2nd scan single image  disabling all the fields without relevant information.

i.e. on image j :You just need to add the code for non relevant objects detection in the place reserved for that. 

Image j code for removing non informative areas example:

  1. open(" #file#");// Variable to open 1st Scan mosaic image
  2. wsizeRectangle = #widthRectangle#; // Variable for ROI Width
  3. hsizeRectangle = #heightRectangle#; // Variable for ROI Height
  4. run("8-bit");
  5. run("Rotate 90 Degrees Right");// just if is a confocal image
  6. //Add your Non informative area detection  code here
  7. setThreshold(#thresholdMin#, #thresholdMax#);
  8. run("Convert to Mask");
  9. // don’t add new code since this line
  10. run("Set Scale...", "distance=0 known=0 pixel=1 unit=pixel");
  11. imageWidth=#widthImage# // Variable for Image Width
  12. imageHeight=#heightImage# // Variable for Image Width
  13. xIni=#initImageX#
  14. yIni=#initImageY#
  15. xRatio = imageWidth/wsizeRectangle;
  16. roundupxRatio = floor(xRatio)+1;
  17. yRatio = imageHeight/hsizeRectangle;
  18. roundupyRatio = floor(yRatio)+1;
  19. for(i=0; i<roundupxRatio; i++)
  20. {
  21.     for(j=0; j<roundupyRatio; j++)
  22.     {
  23.         x=i*wsizeRectangle+xIni;
  24.         y=j*hsizeRectangle+yIni;
  25.         makeRectangle(x, y, wsizeRectangle, hsizeRectangle);
  26.         getStatistics(area, mean, min, max);
  27.         if (max == 0)
  28.         {
  29.             print(x+"  "+y);
  30.             drawRect(x, y, wsizeRectangle, hsizeRectangle);
  31.         }
  32.     }
  33. }

iMSRC can manage any variable for object detection

Variables such as threshold, size or circularity options are already implemented and can be tuned directly on the webpage:

i.e. on image j routines: by simply adding the following variables names flanked by has tag symbols.


Variable name

Variable code


Intensity Threshold #thresholdMin# Minimum intensity threshold value for object detection
  #thresholdMax# Maximum intensity threshold value for object detection
Object Size #size# Minimum object size (in pixels)
  #maxsize# Maximum object size (in pixels)
Circularity #circularity# Threshold for object circularity