ImageJ 3D Viewer Add Mesh for Specific TimePoint

3d-viewer
imagej
#1

@bene.schmid @albertcardona @iarganda @ctrueden

Do you know the syntax for adding a mesh to a specific timepoint?

final Content content = universe.addCustomMesh( mesh, "name" );

The content has getter methods for which timepoints it covers but I could not figure out how to set those.

0 Likes

#2

Yes, I do, but only because I asked Benjamin Schmid relatively recently. Have a look at the function withIcospheres from https://github.com/acardona/scripts/blob/dev/python/imagej/IsoView-GCaMP/util/view_deltaFoF_nuclei_in_4D.py#L56

In the loop


instants = {} # time instant (int) vs ContentInstant

for row in rows:
    ...
    meshes = ... # many meshes per time point, but one would do
    ci = ContentInstant(str(row[0) # ContentInstant takes a string for title
    ci.display(CustomMultiMesh(meshes)) # each mesh has its color
    ci.setLocked(True) # To prevent accidentally manually moving the mesh in 3D when attempting to rotate the view
    instants.put(int(row[0]), ci)
...
univ.addContent(Content("deltaF/F", instants, False))
univ.show()
univ.updateStartAndEndTime(0, len(instants) -1)   # show timepoint slider, for 4D
4 Likes

#3

Thanks! That helps a lot!

0 Likes