Skip to content

This ImageJ/Fiji macro adds the minimum distance between the centroid of a set of analyzed objects and a reference set of points to the ImageJ results table. This data can then used to provide position normalized quantification of microstructures and microchemistry.

License

Notifications You must be signed in to change notification settings

peterjlee/asc-ImageJ-MinimumDistances

Repository files navigation

asc-ImageJ-MinimumDistance Macros for ImageJ/Fiji

The Add_Min_and_Max-Ref-Dist-to-Centroids_to_Results.ijm ImageJ macro adds the minimum distance between the centroid of a set of analyzed objects and a reference set of points to the ImageJ results table. This could be done with just a few lines of ImageJ/Fiji macro code but here we try to extract a few more distance derived details. This data can then used to provide position normalized quantification of microstructures, microchemistry and even images as in this publication: PDF

A reference location file with X coordinates in column 1 and Y coordinates in column 2 is required (using standard mageJ delimeters - e.g. a tab separated txt file exported by ImageJ or a csv file).
The macro can use imported XY values that are in pixels or to the same scale as the active image
   but if the active image is calibrated the macro will generate both pixel and scaled information.
ZERO Y AT TOP: Zero Y should be at the top of the image
   this is OPPOSITE to the current ImageJ default XY export setting.
   To export the XY coordinates of all non-background pixels: Analyze > Tools > Save XY Coordinates

Up to 20 additional columns (12 optional) are added to the Results table in the current version:

   Minimum distances to the reference set (and the coordinates of the minimum location).
   Maximum distances to the reference set (and the coordinates of the maximum location).
   Minimum distances to the center (based on mean of coordinates) of the reference set.
   Angle of minimum distance direction (degrees).
   Angular offset of minimum distance angle from Feret angle.

   The added columns can be relabeled with a global prefix and/or suffix.

If the image is scaled, additional columns of "unscaled" pixel values will be added.

The minimum and maximum distance lines can be drawn as overlays. LUTs can be used to color code the lines according to any parameters in the Results table.

Min and Max distance to reference coordinates example. This example uses a LUT to color code the minimum distances.

Min and Max distance to reference coordinates example workflow animation. This example uses a LUT to color code the minimum distances.


The Calculate_Min-Dist_Using_2_Text_Coord_Files.ijm macro simply calculates the minimum distances between two sets of coordinates imported from text files. If an image is option there is the option to use the scale and units from the active image.

Legal Notice:
These macros have been developed to demonstrate the power of the ImageJ macro language and we assume no responsibility whatsoever for its use by other parties, and make no guarantees, expressed or implied, about its quality, reliability, or any other characteristic. On the other hand we hope you do have fun with them without causing harm.
The macros are continually being tweaked and new features and options are frequently added, meaning that not all of these are fully tested. Please contact me if you have any problems, questions or requests for new modifications.

About

This ImageJ/Fiji macro adds the minimum distance between the centroid of a set of analyzed objects and a reference set of points to the ImageJ results table. This data can then used to provide position normalized quantification of microstructures and microchemistry.

Resources

License

Stars

Watchers

Forks

Packages

No packages published