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:
- open(" #file#");// Variable to open 1st Scan mosaic image
- wsizeRectangle = #widthRectangle#; // Variable for ROI Width
- hsizeRectangle = #heightRectangle#; // Variable for ROI Height
- run("8-bit");
- run("Rotate 90 Degrees Right");// just if is a confocal image
- //Add your Non informative area detection code here
- setThreshold(#thresholdMin#, #thresholdMax#);
- run("Convert to Mask");
- // don’t add new code since this line
- run("Set Scale...", "distance=0 known=0 pixel=1 unit=pixel");
- imageWidth=#widthImage# // Variable for Image Width
- imageHeight=#heightImage# // Variable for Image Width
- xIni=#initImageX#
- yIni=#initImageY#
- xRatio = imageWidth/wsizeRectangle;
- roundupxRatio = floor(xRatio)+1;
- yRatio = imageHeight/hsizeRectangle;
- roundupyRatio = floor(yRatio)+1;
- for(i=0; i<roundupxRatio; i++)
- {
- for(j=0; j<roundupyRatio; j++)
- {
- x=i*wsizeRectangle+xIni;
- y=j*hsizeRectangle+yIni;
- makeRectangle(x, y, wsizeRectangle, hsizeRectangle);
- getStatistics(area, mean, min, max);
- if (max == 0)
- {
- print(x+" "+y);
- drawRect(x, y, wsizeRectangle, hsizeRectangle);
- }
- }
- }
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 |
Details |
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 |