diff --git a/src/main/java/skeleton/Algorithms.java b/src/main/java/skeleton/Algorithms.java index 233be0a..fe32042 100644 --- a/src/main/java/skeleton/Algorithms.java +++ b/src/main/java/skeleton/Algorithms.java @@ -202,7 +202,7 @@ public static Img createUnsignedByteTypeMaskFromLabelRegion( LabelRegion centralObjectRegion, long[] dimensions) { final Img centralObjectImg = ArrayImgs.unsignedBytes(dimensions); - final Cursor regionCursor = centralObjectRegion.cursor(); + final Cursor regionCursor = centralObjectRegion.inside().cursor(); final RandomAccess access = centralObjectImg.randomAccess(); while (regionCursor.hasNext()) { regionCursor.fwd(); @@ -215,7 +215,7 @@ public static Img createUnsignedByteTypeMaskFromLabelRegion( public static Img createMaskFromLabelRegion(LabelRegion region, long[] dimensions) { final Img centralObjectImg = ArrayImgs.bits(dimensions); - final Cursor regionCursor = region.cursor(); + final Cursor regionCursor = region.inside().cursor(); final RandomAccess access = centralObjectImg.randomAccess(); while (regionCursor.hasNext()) { regionCursor.fwd(); @@ -838,7 +838,7 @@ public static void drawWatershedIntoMask(RandomAccessibleInterval mask, int label, LabelRegions splitObjects) { final long[] regionOffset = Intervals.minAsLongArray(labelRegions.getLabelRegion(label)); LabelRegion watershed = splitObjects.getLabelRegion(-1); - final LabelRegionCursor cursor = watershed.cursor(); + final Cursor< Void > cursor = watershed.inside().cursor(); final RandomAccess maskRandomAccess = mask.randomAccess(); long[] position = new long[watershed.numDimensions()]; while (cursor.hasNext()) { diff --git a/src/main/java/skeleton/Regions.java b/src/main/java/skeleton/Regions.java index 25b2cbb..26d4d90 100644 --- a/src/main/java/skeleton/Regions.java +++ b/src/main/java/skeleton/Regions.java @@ -86,7 +86,7 @@ public static RandomAccessibleInterval asMask(LabelRegion labelRegion) rai = Transforms.getWithAdjustedOrigin(labelRegion, rai); final RandomAccess randomAccess = rai.randomAccess(); - final LabelRegionCursor cursor = labelRegion.cursor(); + final Cursor< Void > cursor = labelRegion.inside().cursor(); while (cursor.hasNext()) { cursor.fwd(); @@ -100,7 +100,7 @@ public static RandomAccessibleInterval asMask(LabelRegion labelRegion) public static void drawRegionInMask(LabelRegion labelRegion, RandomAccessibleInterval mask) { final RandomAccess maskAccess = mask.randomAccess(); - final LabelRegionCursor cursor = labelRegion.cursor(); + final Cursor< Void > cursor = labelRegion.inside().cursor(); while (cursor.hasNext()) { cursor.fwd(); @@ -111,7 +111,7 @@ public static void drawRegionInMask(LabelRegion labelRegion, RandomAccessibleInt public static long size(LabelRegion labelRegion) { - final LabelRegionCursor cursor = labelRegion.cursor(); + final Cursor< Void > cursor = labelRegion.inside().cursor(); long size = 0; while (cursor.hasNext()) { @@ -130,7 +130,7 @@ public static & NativeType> RandomAccessibleInterval imageRandomAccess = image.randomAccess(); final RandomAccess outputRandomAccess = output.randomAccess(); - final LabelRegionCursor cursor = labelRegion.cursor(); + final Cursor< Void > cursor = labelRegion.inside().cursor(); while (cursor.hasNext()) { cursor.fwd(); @@ -196,7 +196,7 @@ public static & NativeType> void onlyKeepLargestRegion private static & NativeType> void drawRegion(RandomAccessibleInterval img, LabelRegion labelRegion, double value) { - final Cursor regionCursor = labelRegion.cursor(); + final Cursor regionCursor = labelRegion.inside().cursor(); final RandomAccess access = img.randomAccess(); while (regionCursor.hasNext()) { regionCursor.fwd(); @@ -207,7 +207,7 @@ private static & NativeType> void drawRegion(RandomAcc private static & NativeType> void removeRegion(RandomAccessibleInterval img, LabelRegion labelRegion) { - final Cursor regionCursor = labelRegion.cursor(); + final Cursor regionCursor = labelRegion.inside().cursor(); final RandomAccess access = img.randomAccess(); while (regionCursor.hasNext()) { regionCursor.fwd(); @@ -272,7 +272,7 @@ public static RandomAccessibleInterval asMask(Set> final RandomAccess maskAccess = regionsMask.randomAccess(); for (LabelRegion region : regions) { - final Cursor regionCursor = region.cursor(); + final Cursor regionCursor = region.inside().cursor(); while (regionCursor.hasNext()) { regionCursor.fwd(); maskAccess.setPosition(regionCursor); @@ -291,7 +291,7 @@ public static RandomAccessibleInterval asMask(Set> final RandomAccess maskAccess = regionsMask.randomAccess(); for (LabelRegion region : regions) { - final Cursor regionCursor = region.cursor(); + final Cursor regionCursor = region.inside().cursor(); while (regionCursor.hasNext()) { regionCursor.fwd(); maskAccess.setPosition(regionCursor); diff --git a/src/main/java/skeleton/Utils.java b/src/main/java/skeleton/Utils.java index cf01add..d570763 100644 --- a/src/main/java/skeleton/Utils.java +++ b/src/main/java/skeleton/Utils.java @@ -789,7 +789,7 @@ private static Set getLabelSet(RandomAccessibleInterval img, LabelRegion labelRegion, int value) { - final Cursor regionCursor = labelRegion.cursor(); + final Cursor regionCursor = labelRegion.inside().cursor(); final RandomAccess access = img.randomAccess(); BitType bitTypeTrue = new BitType(true); while (regionCursor.hasNext()) {