Skip to content

Commit

Permalink
Merge pull request #2 from tpietzsch/feature-rai-getType
Browse files Browse the repository at this point in the history
Fix error wrt changed API in imglib
  • Loading branch information
ctrueden authored Aug 29, 2024
2 parents f7d35cd + 0477fcd commit b58d1c8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId>
<version>34.0.0</version>
<version>38.0.1</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -85,6 +85,13 @@
<license.licenseName>gpl_v3</license.licenseName>
<license.copyrightOwners>TrackMate developers.</license.copyrightOwners>

<imglib2.version>7.1.0</imglib2.version>
<imglib2-realtransform.version>4.0.3</imglib2-realtransform.version>
<imglib2-roi.version>0.15.0</imglib2-roi.version>
<imglib2-cache.version>1.0.0-beta-18</imglib2-cache.version>
<imglib2-algorithm.version>0.15.3</imglib2-algorithm.version>
<imglib2-ij.version>2.0.2</imglib2-ij.version>

<!-- NB: Deploy releases to the SciJava Maven repository. -->
<releaseProfiles>sign,deploy-to-scijava</releaseProfiles>
</properties>
Expand Down
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 b58d1c8

Please sign in to comment.