I'm looking for a macro or tool which will allow me to create multiple bins/ROIs across an image and at a specified angle.
I don't want the bins/ROIs to overlap, but preferably they would "tile" with touching edges across the entire image, in order to measure intensity as a function of distance in a black and white image. The bins are fairly small (8px wide in a 1024px image), so I would like to have it semi-automated. The ideal (as far as I can picture it) workflow involves manually drawing a line or ROI across and image, and then running a macro/program which would tile that line/ROI to the image's other corner. Thanks! |
Dear Camille, I'm sure my answer is not the one you want. But maybe your problem could be solved more easily with a data software like "R". For example, if you draw a line that covers the area to explore and you get the intensity profile (with the possibility of increasing the width of the line to 8 pixels as you want) and you transfer to a R data frame with x, y columns, you can combine the intensity values by intervals of any size:
#suppose a 100 pixels profil in a "dt" data frame dt x y [1] x1 y1 [2] x2 y2 ... ... [100] x100 y100 you first add a new column with the grouping values that you want : dt$group <- as.vector(sapply(1:25, function(x) rep(x,4))) # this will create a new column with 1,1,1,1,2,2,2,2, ... 25,25,25,25 you can change the intervals : 1:10 ... rep(x,10) for 10 values intervals, etc. tapply(dt$y, dt$group, mean) #this will yield a vector with 25 values with the mean of intensities "grouped" by 4 Note that with only two commands lines you get the same results as if you had created 25 rectangular ROI (i.e. 4x8 rectangles) tiled along the profile line. I'm sure that an image Macro should need more than two lines to get the same... ;-) Le 26 nov. 2014 à 02:19, ccamille a écrit : > I'm looking for a macro or tool which will allow me to create multiple > bins/ROIs across an image and at a specified angle. > > I don't want the bins/ROIs to overlap, but preferably they would "tile" with > touching edges across the entire image, in order to measure intensity as a > function of distance in a black and white image. The bins are fairly small > (8px wide in a 1024px image), so I would like to have it semi-automated. > > The ideal (as far as I can picture it) workflow involves manually drawing a > line or ROI across and image, and then running a macro/program which would > tile that line/ROI to the image's other corner. > > Thanks! > > > > -- > View this message in context: http://imagej.1557.x6.nabble.com/Multiple-angled-and-tiled-ROIs-bins-tp5010627.html > Sent from the ImageJ mailing list archive at Nabble.com. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by ccamille
Camille,
what about having a look at the ImageJ macro language and its ROI-routines? <http://rsb.info.nih.gov/ij/developer/macro/functions.html> If you draw a ROI, i.e. a selection, of whatever shape on your image you can get its bounding rectangle with Roi.getBounds( x, y, width, height ); and you may move the very ROI to another location of your image with Roi.move( x_i, y_i ); So if you know the new locations, i.e. x_i = x + dx, y_i = y + dy, you are done. Of course you can put Roi.move( x_i, y_i ) in a loop to get a sort of sequential ROI-tiling. Does this help? Best Herbie ::::::::::::::::::::::::::::::::: On 26.11.14 02:19, ccamille wrote: > I'm looking for a macro or tool which will allow me to create multiple > bins/ROIs across an image and at a specified angle. > > I don't want the bins/ROIs to overlap, but preferably they would "tile" with > touching edges across the entire image, in order to measure intensity as a > function of distance in a black and white image. The bins are fairly small > (8px wide in a 1024px image), so I would like to have it semi-automated. > > The ideal (as far as I can picture it) workflow involves manually drawing a > line or ROI across and image, and then running a macro/program which would > tile that line/ROI to the image's other corner. > > Thanks! > > > > -- > View this message in context: http://imagej.1557.x6.nabble.com/Multiple-angled-and-tiled-ROIs-bins-tp5010627.html > Sent from the ImageJ mailing list archive at Nabble.com. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |