有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java imglib2:PointSetRegionFinTerest

我使用PointSetRegionFinTerest在Img中选择高于阈值的点。 roi用作遮罩,因此我经常需要调用“contains”方法,这会导致速度非常慢,因为roi由大量点组成。我想知道是否有更有效的替代方案

我需要的是选择阈值以上的所有点,并仅对Img的这些点执行一些操作

我认为View类可能是一个不错的选择,但我不知道如何在稀疏点上实际使用它。为了从GeneralPointSet获得Img的视图,我尝试了方法视图。interval(sourceImg,generalPointSet),在方法ImageCombiner中将生成的InterValveView用作输入Img时。应用程序(…)获得的输出不匹配

非常感谢

萨拉


共 (1) 个答案

  1. # 1 楼答案

    这个问题由巴里·德佐尼亚回答:

    PointSets and Views may not interoperate well at the moment. If you are going to use PointSets I would suggest the following:

    Assuming your GeneralPointSet contains the points of interest:

    • Create a ConditionalPointSet from your GeneralPointSet.
    • The Condition to pass in the constructor can be a WithinRangeCondition
    • The Function to pass to the WithinRangeCondition should be a RealImageFunction (constructed on your Img)

    Now you can iterate the ConditionalPointset and the points you get back are only those that satisfy the condition. You can use random access into an image using the points returned. This should be more performant.

    Note also that you can create a GeneralPointSet from any other PointSet (like a RoiPointSet) using GeneralPointSet.explode(pointset). The series of contains calls are then made once during the construction of the GeneralPointSet. Afterwards you can iterate it as often as you like.