简体   繁体   English

提取选区或感兴趣区域内的像素值

[英]Extract pixel values within a selection or region of interest

I am struggling to extract individual pixel values from a selection or area of interest using imageJ. 我正在努力使用imageJ从选择或感兴趣区域中提取单个像素值。 I have tried to save the image as a text file, but it is very hard working to find and collect the pixels I am interested in. I have also tried to extract the histogram values from the option "list" however, it put several pixels with in a bin range and I want to extract every single individual value. 我试图将图像保存为文本文件,但是很难找到并收集我感兴趣的像素。我还尝试从选项“列表”中提取直方图值,但是它放置了几个像素在bin范围内,我想提取每个单个值。

Do you know any way to do this? 你知道有什么办法吗? Any other software suggestions are also welcome. 也欢迎任何其他软件建议。

Many thanks in advance :) 提前谢谢了 :)

I got the solution form an imageJ mailing list form Nabble. 我从imageJ邮件列表Nabble得到了解决方案。 This is a macro that do the trick: 这是一个完成技巧的宏:

//------------------------------------------------ 
Roi.getBounds(rx, ry, width, height); 
row = 0; 

for(y=ry; y<ry+height; y++) { 
    for(x=rx; x<rx+width; x++) { 
        if(Roi.contains(x, y)==1) { 
            setResult("X", row, x); 
            setResult("Y", row, y); 
            setResult("Value", row, getPixel(x, y)); 
            row++; 
        } 
    } 
} 
//------------------------------------------------ 

Credits CEO: Dr. Jan Brocher 积分CEO:Jan Brocher博士

Here the link to the thread 这里是线程的链接

http://imagej.1557.x6.nabble.com/Extracts-individual-pixel-values-from-a-selection-or-RIO-td5020121.html http://imagej.1557.x6.nabble.com/Extracts-individual-pixel-values-from-a-selection-or-RIO-td5020121.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM