-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathRenderTransformMeshMappingWithMasksTest.java
More file actions
63 lines (49 loc) · 2.29 KB
/
RenderTransformMeshMappingWithMasksTest.java
File metadata and controls
63 lines (49 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package org.janelia.alignment;
import ij.process.ImageProcessor;
import mpicbg.trakem2.transform.TransformMeshMappingWithMasks;
import org.janelia.alignment.util.ImageProcessorCache;
import org.junit.Assert;
import org.junit.Test;
import static org.janelia.alignment.Renderer.renderImageProcessorWithMasks;
/**
* Tests the {@link RenderTransformMeshMappingWithMasks} class.
*/
public class RenderTransformMeshMappingWithMasksTest {
@Test
public void testMap() {
// TODO: uncomment below to run test
// renderProblemArea();
// one way to "solve" problem is to revert RenderTransformMeshMappingWithMasks to commit just before
// Tobias' December 2024 / January 2025 changes: 25bcdd4cecac5baace30997d950793c82a65e832
}
@SuppressWarnings("unused")
private static void renderProblemArea() {
// notes:
// a) w61_s109_z12_problem_a.json has the tile order flipped in descending tileId order
// because I noticed a black line when I was working on something else.
// I don't think the descending order has anything to do with the source problem,
// other than where it shows up.
// b) repo path is render-app/src/test/resources/stitch-test/w61_s109_z12_problem_a.json
final RenderParameters renderParameters =
RenderParameters.loadFromUrl("src/test/resources/stitch-test/w61_s109_z12_problem_a.json");
final TransformMeshMappingWithMasks.ImageProcessorWithMasks worldTarget =
renderImageProcessorWithMasks(renderParameters, ImageProcessorCache.DISABLED_CACHE);
final ImageProcessor ip = worldTarget.ip;
boolean foundZeroPixel = false;
for (int y = 0; y < ip.getHeight(); y++) {
for (int x = 0; x < ip.getWidth(); x++) {
final int pixel = ip.getPixel(x, y);
if (pixel == 0) {
foundZeroPixel = true;
}
System.out.printf("%4d", pixel);
}
System.out.println();
}
if (foundZeroPixel) {
// TODO: uncomment below and break on Assert.fail call to see pixels in IDE
// final BufferedImage bi = ip.getBufferedImage();
Assert.fail("found zero pixel in rendered image");
}
}
}