imagej / imagej/imagej-ops

Voxelization op creates artifacts

Open
#565 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
94
Forks
44
PR merge metrics
No merged PRs in 30d

Description

I tried the following Groovy script with the *Bat Cochlea Volume* sample image in Fiji:

```groovy
#@ OpService ops
#@ Img img

import net.imagej.mesh.naive.NaiveDoubleMesh
import net.imagej.mesh.Meshes

bitImg = ops.run("convert.bit", img)

// Img => Mesh

fullmesh = new NaiveDoubleMesh()
vertices = fullmesh.vertices()

cursor = bitImg.cursor()
loc = new double[3]

while (cursor.hasNext()) {
cursor.fwd()
if (cursor.get().get()) {
cursor.localize(loc)
vertices.add(loc[0], loc[1], loc[2])
}
}
println "Points contained in input image: ${vertices.size()}"

// Mesh => Mesh (convex hull)

convexHull = ops.run("geom.convexHull", fullmesh).get(0)

println "Points contained in convex hull: ${convexHull.vertices().size()}"

convexHull.vertices().each {
println "${it.x()}, ${it.y()}, ${it.z()}"
}

box = Meshes.boundingBox(convexHull)
println box
println Meshes.center(convexHull)
// Mesh => Mask ?

// Mesh => RAI (voxelization)
ops.run("intervalView", ops.run("translateView", ops.run("extendZeroView", ops.run("geom.voxelization", convexHull, box[3]-box[0], box[4]-box[1], box[5]-box[2])), [box[0], box[1], box[2]]), img)

// ops.run("morphology.floodFill") ? on centroid?
```

While the coordinates (output of `convexHull`) make sense to me:

![image](https://user-images.githubusercontent.com/2033938/42461428-c1524e94-83a0-11e8-8fb6-454a433a2821.png)

The result image looks weird and contains some box artifacts (red = input, green = output):

![image](https://user-images.githubusercontent.com/2033938/42461520-ebd6f4b2-83a0-11e8-88f6-72cfa1502802.png)

Any idea what might be going wrong here?

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the Groovy script with the Bat Cochlea Volume sample, then inspect the geom.voxelization call and the translateView, extendZeroView, and intervalView chain. Compare the convexHull coordinates and bounding box with the red/green overlay. Done means identifying and correcting the cause of the box artifacts so the voxelized output aligns with the input.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, java
Domain
computer-vision
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.