Skip to content

Commit

Permalink
tidy up code
Browse files Browse the repository at this point in the history
  • Loading branch information
trautmane committed Oct 14, 2024
1 parent 33b3aa3 commit 547a5f8
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ public ImageProcessor load(final String urlString)
if (keyValue.length == 2) {
final String key = keyValue[0];
if ("x".equals(key)){
x = new Long(keyValue[1]);
x = Long.valueOf(keyValue[1]);
} else if ("y".equals(key)) {
y = new Long(keyValue[1]);
y = Long.valueOf(keyValue[1]);
} else if ("z".equals(key)) {
z = new Long(keyValue[1]);
z = Long.valueOf(keyValue[1]);
} else if ("w".equals(key)) {
width = new Integer(keyValue[1]);
width = Integer.valueOf(keyValue[1]);
} else if ("h".equals(key)) {
height = new Integer(keyValue[1]);
height = Integer.valueOf(keyValue[1]);
} else if ("dataSet".equals(key)) {
dataSet = URLDecoder.decode(keyValue[1], defaultCharsetName);
}
Expand Down Expand Up @@ -201,7 +201,7 @@ public ImageProcessor load(final N5Reader reader,
}

public static Helper<UnsignedByteType, ByteProcessor> UNSIGNED_BYTE_HELPER =
new Helper<UnsignedByteType, ByteProcessor>() {
new Helper<>() {
@Override
public ByteProcessor buildImageProcessor(final int width,
final int height) {
Expand All @@ -218,12 +218,13 @@ public RandomAccessibleInterval<UnsignedByteType> setupTarget(final ByteProcesso
};

public static Helper<ShortType, ShortProcessor> SHORT_HELPER =
new Helper<ShortType, ShortProcessor>() {
new Helper<>() {
@Override
public ShortProcessor buildImageProcessor(final int width,
final int height) {
return new ShortProcessor(width, height);
}

@Override
public RandomAccessibleInterval<ShortType> setupTarget(final ShortProcessor forImageProcessor) {
return ArrayImgs.shorts(
Expand All @@ -234,12 +235,13 @@ public RandomAccessibleInterval<ShortType> setupTarget(final ShortProcessor forI
};

public static Helper<FloatType, FloatProcessor> FLOAT_HELPER =
new Helper<FloatType, FloatProcessor>() {
new Helper<>() {
@Override
public FloatProcessor buildImageProcessor(final int width,
final int height) {
return new FloatProcessor(width, height);
}

@Override
public RandomAccessibleInterval<FloatType> setupTarget(final FloatProcessor forImageProcessor) {
return ArrayImgs.floats(
Expand Down

0 comments on commit 547a5f8

Please sign in to comment.