08-24-2017 10:28 AM
08-24-2017 10:28 AM
I was misreading the question. It read to me as find the blob, find the x,y of the blob and find the min/max value. But I think you are looking for the x,y of the min/max pixel. Apologies - my mistake. Is there a chance that the question setter could paste a typical image?
08-24-2017 11:17 AM
If you can find the perimeter coordinates of a particular blob you should be able to convert this to an ROI and then into a mask. Apply this mask to the raw image to determine the min / max values and x,y coordinate for all pixels corresponding to that blob. You would then need to repeat for all other blobs.
Alternatively you might be able to create a dummy image from the thresholded blob image and label each pixel within a blob with the same blob number, (so you would end up with an image made up of regions of 0's, 1's, 2's etc). Pixels with a value of zero could be the background sub-threshold intensity, pixels with a value of 1 would correspond to blob 1 etc. You could use this image as a reference to go back and find the value and coordinates of pixels of a certain blob number in the raw image. It should then be trivial then to find the max/min pixel value from the raw image for a given blob. Then repeat for a different blob number.
I'm sure there must be a simpler way but I can't think of one just yet.
08-24-2017 03:11 PM
If you have the labelled image then you could start with all the pixels that have a label of 1. Convert the labelled image into a 2-D array and find all coordinate pairs where the pixel value = 1. Then look at the corresponding pixels on the raw image to identify the coordinates of the one that has the minimum or maximum intensity. Repeat for the pixels with a value of 2 etc.
08-24-2017 04:47 PM
Why try to do it the hard way when I already explained how to do it using IMAQ Label and IMAQ Quantify? That does everything you are describing, but probably 100 times faster. Between IMAQ Quantify and IMAQ Reports, you should have everything you need for every particle.
Bruce
08-25-2017 01:55 AM
You're probably right Bruce. I just haven't used those functions before. I had a quick look last night and they look useful. Thanks
08-25-2017 03:14 AM
This seems to work OK in that you get reports about each of the regions, but you don't get the x,y position of the max & min values in each region. However, it should be relatively easy to interrogate the original raw image to find this information from the data in the label image.
08-25-2017 03:26 AM
Can I ask why you want to use image wand?
08-25-2017 05:31 AM
I have taken the NI example image label.vi and modified it so that you can get the maximum intensity for each particle and the x,y coordinate at this position. The index of the 1-D arrays equates to the particle number.
08-30-2017 08:02 AM
If I use a large image , the speed might become slow. I turned to use matlab script now which is faster. Anyway, thanks everybody.