If all you are looking to do is to take the 2D grayscale image and turn it into a 3D representation for visualisation purposes, then perhaps you could consider a function that accepts the image and produces a VRML (or X3D) string describing your 3D model. That model would then be passed to a standard java graphics toolkit (for example Java 3D) which would handle the rendering for you.
Here is a simplistic example:
For the 2x2 grayscale image of X = [0,1;1,0], your VRML indexedFace node would look like this:
IndexedFaceSet {
coord Coordinate {
point [-1 1 x(0,0), 1 1 x(0,1), 1 -1 x(1,1), -1 -1 x(1,0)]
}
coordIndex [ 0 1 2 3 ] # That is, just one face
}
In the above snippet, "x(i,j)" is a placeholder for the corresponding value from the image (which will be formated to the actual number) and as you can see it represents the Z dimension of your indexedFaceSet.
Actually, the structure of "point" is just a list (in row major order) of all of you image points, which is very easy to generate by iterating through all pixels of the image. Similarly, the structure of coordIndex is also set to quads (faces defined by 4 points in space) which map to the image's grid. The indexedFaceSet provides capabilities to define the colour of each vertex (each defining point of the face) as well in a way similar to the way "point" is defined.
More information about IndexedFaceSet can be found at:
VRML: http://www.cs.vu.nl/~eliens/documents/vrml/reference/CH3.HTM#IndexedFaceSet
X3D: http://www.web3d.org/documents/specifications/19775-1/V3.2/Part01/components/geometry3D.html#IndexedFaceSet
To render the model in Java, please see https://stackoverflow.com/questions/16625858/plug-in-display-3d-objects-from-vrml-or-x3d
Regarding the detection of spots, if these are images from electrophoresis, please see chapter 3 in this thesis for a comprehensive set of ways of detecting the blobs and extracting their main features: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.86.4325&rep=rep1&type=pdf
I hope this helps