Skip to content

Commit

Permalink
Adapt API changes introduced by imglib/imglib2-roi#71
Browse files Browse the repository at this point in the history
  • Loading branch information
tpietzsch committed Apr 5, 2024
1 parent 5cf555c commit db4e328
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/main/java/skeleton/Algorithms.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public static Img<UnsignedByteType> createUnsignedByteTypeMaskFromLabelRegion(
LabelRegion<Integer> centralObjectRegion, long[] dimensions) {
final Img<UnsignedByteType> centralObjectImg = ArrayImgs.unsignedBytes(dimensions);

final Cursor<Void> regionCursor = centralObjectRegion.cursor();
final Cursor<Void> regionCursor = centralObjectRegion.inside().cursor();
final RandomAccess<UnsignedByteType> access = centralObjectImg.randomAccess();
while (regionCursor.hasNext()) {
regionCursor.fwd();
Expand All @@ -215,7 +215,7 @@ public static Img<UnsignedByteType> createUnsignedByteTypeMaskFromLabelRegion(
public static Img<BitType> createMaskFromLabelRegion(LabelRegion<Integer> region, long[] dimensions) {
final Img<BitType> centralObjectImg = ArrayImgs.bits(dimensions);

final Cursor<Void> regionCursor = region.cursor();
final Cursor<Void> regionCursor = region.inside().cursor();
final RandomAccess<BitType> access = centralObjectImg.randomAccess();
while (regionCursor.hasNext()) {
regionCursor.fwd();
Expand Down Expand Up @@ -838,7 +838,7 @@ public static void drawWatershedIntoMask(RandomAccessibleInterval<BitType> mask,
int label, LabelRegions<Integer> 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<BitType> maskRandomAccess = mask.randomAccess();
long[] position = new long[watershed.numDimensions()];
while (cursor.hasNext()) {
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/skeleton/Regions.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static RandomAccessibleInterval<BitType> asMask(LabelRegion labelRegion)
rai = Transforms.getWithAdjustedOrigin(labelRegion, rai);
final RandomAccess<BitType> randomAccess = rai.randomAccess();

final LabelRegionCursor cursor = labelRegion.cursor();
final Cursor< Void > cursor = labelRegion.inside().cursor();

while (cursor.hasNext()) {
cursor.fwd();
Expand All @@ -100,7 +100,7 @@ public static RandomAccessibleInterval<BitType> asMask(LabelRegion labelRegion)
public static void drawRegionInMask(LabelRegion labelRegion, RandomAccessibleInterval<BitType> mask) {
final RandomAccess<BitType> maskAccess = mask.randomAccess();

final LabelRegionCursor cursor = labelRegion.cursor();
final Cursor< Void > cursor = labelRegion.inside().cursor();

while (cursor.hasNext()) {
cursor.fwd();
Expand All @@ -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()) {
Expand All @@ -130,7 +130,7 @@ public static <T extends RealType<T> & NativeType<T>> RandomAccessibleInterval<T

final RandomAccess<T> imageRandomAccess = image.randomAccess();
final RandomAccess<T> outputRandomAccess = output.randomAccess();
final LabelRegionCursor cursor = labelRegion.cursor();
final Cursor< Void > cursor = labelRegion.inside().cursor();

while (cursor.hasNext()) {
cursor.fwd();
Expand Down Expand Up @@ -196,7 +196,7 @@ public static <R extends RealType<R> & NativeType<R>> void onlyKeepLargestRegion

private static <R extends RealType<R> & NativeType<R>> void drawRegion(RandomAccessibleInterval<R> img,
LabelRegion labelRegion, double value) {
final Cursor<Void> regionCursor = labelRegion.cursor();
final Cursor<Void> regionCursor = labelRegion.inside().cursor();
final RandomAccess<R> access = img.randomAccess();
while (regionCursor.hasNext()) {
regionCursor.fwd();
Expand All @@ -207,7 +207,7 @@ private static <R extends RealType<R> & NativeType<R>> void drawRegion(RandomAcc

private static <T extends RealType<T> & NativeType<T>> void removeRegion(RandomAccessibleInterval<T> img,
LabelRegion labelRegion) {
final Cursor regionCursor = labelRegion.cursor();
final Cursor regionCursor = labelRegion.inside().cursor();
final RandomAccess<T> access = img.randomAccess();
while (regionCursor.hasNext()) {
regionCursor.fwd();
Expand Down Expand Up @@ -272,7 +272,7 @@ public static RandomAccessibleInterval<BitType> asMask(Set<LabelRegion<Integer>>
final RandomAccess<BitType> maskAccess = regionsMask.randomAccess();

for (LabelRegion region : regions) {
final Cursor<Void> regionCursor = region.cursor();
final Cursor<Void> regionCursor = region.inside().cursor();
while (regionCursor.hasNext()) {
regionCursor.fwd();
maskAccess.setPosition(regionCursor);
Expand All @@ -291,7 +291,7 @@ public static RandomAccessibleInterval<BitType> asMask(Set<LabelRegion<Integer>>
final RandomAccess<BitType> maskAccess = regionsMask.randomAccess();

for (LabelRegion region : regions) {
final Cursor<Void> regionCursor = region.cursor();
final Cursor<Void> regionCursor = region.inside().cursor();
while (regionCursor.hasNext()) {
regionCursor.fwd();
maskAccess.setPosition(regionCursor);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/skeleton/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ private static Set<Integer> getLabelSet(RandomAccessibleInterval<UnsignedShortTy
}

public static void drawObject(RandomAccessibleInterval<IntType> img, LabelRegion labelRegion, int value) {
final Cursor<Void> regionCursor = labelRegion.cursor();
final Cursor<Void> regionCursor = labelRegion.inside().cursor();
final RandomAccess<IntType> access = img.randomAccess();
BitType bitTypeTrue = new BitType(true);
while (regionCursor.hasNext()) {
Expand Down

0 comments on commit db4e328

Please sign in to comment.