Skip to content

Commit

Permalink
Avoid using ImgLabeling.getType()
Browse files Browse the repository at this point in the history
In imglib2-7.1 the way Utils.getTypeFromInterval(...) works was changed.
Currently it triggers a NullPointerException for an ImgLabeling. This
workaround fixes the problem.
  • Loading branch information
maarzt committed Aug 29, 2024
1 parent 2fc86c5 commit 426c907
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import net.imglib2.roi.IterableRegion;
import net.imglib2.roi.Regions;
import net.imglib2.type.logic.BitType;
import net.imglib2.util.Intervals;
import org.scijava.ui.behaviour.*;
import sc.fiji.labkit.ui.ActionsAndBehaviours;
import sc.fiji.labkit.ui.brush.neighborhood.Ellipsoid;
Expand Down Expand Up @@ -248,8 +249,8 @@ private List<Label> getVisibleLabels() {
private RandomAccessible<LabelingType<Label>> extendLabelingType(
RandomAccessibleInterval<LabelingType<Label>> slice)
{
LabelingType<Label> variable = Util.getTypeFromInterval(slice)
.createVariable();
LabelingType<Label> variable = slice.randomAccess()
.setPositionAndGet(Intervals.minAsLongArray(slice)).createVariable();
variable.clear();
return Views.extendValue(slice, variable);
}
Expand Down

0 comments on commit 426c907

Please sign in to comment.