简体   繁体   English

在 ImageJ 中,对于大于整个图像中某个任意值的任何像素强度,如何将像素值设置为零?

[英]In ImageJ, how to set pixel value to zero for any pixel intensity greater than some arbitrary value in the whole image?

I have Z-stacks of fluorescently labelled cells.我有荧光标记细胞的 Z 叠层。

The samples have an artefact that causes very bright regions inside the cells which are not based on my signal of interest.样本有一个伪影,导致细胞内的区域非常明亮,这不是基于我感兴趣的信号。

Since the intensity (brightness) of these artefacts is far above my signal of interest's intensity, I want to simply zero all those pixels that are above some arbitrary value I will chose.由于这些伪影的强度(亮度)远高于我感兴趣的信号的强度,我想简单地将所有高于我将选择的任意值的像素归零。

So I want macro that logically does something like:所以我想要在逻辑上执行以下操作的宏:

For each slice:对于每个切片:

For each pixel:对于每个像素:

 if pixel intensity>150 then set pixel=0

I am coding in imageJ macro language.我正在使用 imageJ 宏语言进行编码。 I want to avoid using ROIs for this part because I already have ROIs representing each cell and am looping through them in my script.我想避免在这部分使用 ROI,因为我已经有代表每个单元格的 ROI,并且在我的脚本中循环遍历它们。

I think this should be really simple but right now my attempted solution is super cumbersome;我认为这应该非常简单,但现在我尝试的解决方案非常麻烦; going through thresholding, analyze particles, generating ROIs, selecting each ROI, and subtracting the value (eg 150) from each ROI.进行阈值化、分析粒子、生成 ROI、选择每个 ROI 并从每个 ROI 中减去值(例如 150)。

Any idea how this is done in simple way?知道这是如何以简单的方式完成的吗?

The problem is resolved using selection and thresholding:使用选择和阈值解决问题:

HotPix = 150; Stack.getStatistics(voxelCount, mean, min, StackMax, stdDev); setThreshold(HotPix, StackMax); //your thresholds here for (i = 1; i <= nSlices; i++) { setSlice(i); run("Create Selection"); if (selectionType().= -1) { run("Set..,"; "value=0"); } run("Select None"); } resetThreshold;

the olsution comes from @antonis on imageJ forum: https://forum.image.sc/t/how-to-delete-all-pixels-or-set-to-zero-in-a-roi-which-are-above-a-certain-value/51173/5解决方案来自 imageJ 论坛上的@antonis: https://forum.image.sc/t/how-to-delete-all-pixels-or-set-to-zero-in-a-roi-which-are-高于某个值/51173/5

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

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