【发布时间】:2015-01-30 06:55:04
【问题描述】:
我是 jogl 的新手。我正在为 DICOM 图像的 3D 渲染进行编码。在使用 jogl 对图像进行 3D 渲染时,我创建了 crud 3D 视图。后续步骤如下:
- 导入的 DICOM 文件堆栈。
- 从文件创建 BufferedImages。
-
为每个图像创建纹理。
// Create a OpenGL Texture object for(int i=0;i<image.length;i++) { textures[i] = AWTTextureIO.newTexture(GLProfile.getDefault(), image[i], false); textureCoords = textures[i].getImageTexCoords(); textureTop[i] = textureCoords.top(); textureBottom[i] = textureCoords.bottom(); textureLeft[i] = textureCoords.left(); textureRight[i] = textureCoords.right(); } -
通过将这些图像一个接一个地放置来创建立方体。
int x=numberOfImages; gl.glBegin(GL_QUADS); // To place stack back to front for(float i=-numberOfImages*0.0050f;x>0;i=i+0.01f){ // Enables this texture's target in the current GL context's state. textures[currTextureFilter].enable(gl); // Bind the texture with the currently chosen filter to the current OpenGL graphics context. textures[currTextureFilter].bind(gl); gl.glBegin(GL_QUADS); // of the color cube gl.glNormal3f(0.0f, 0.0f, (0.1f+i)); gl.glTexCoord2f(textureLeft[x], textureBottom[x]); gl.glVertex3f(-1.0f, -1.0f, (0.1f+i)); // bottom-left of the texture and quad gl.glTexCoord2f(textureRight[x], textureBottom[x]); gl.glVertex3f(1.0f, -1.0f, (0.1f+i)); // bottom-right of the texture and quad gl.glTexCoord2f(textureRight[x], textureTop[x]); gl.glVertex3f(1.0f, 1.0f, (0.1f+i)); // top-right of the texture and quad gl.glTexCoord2f(textureLeft[x], textureTop[x]); gl.glVertex3f(-1.0f, 1.0f, (0.1f+i)); // top-left of the texture and quad currTextureFilter =x; textures[currTextureFilter].disable(gl); x--; gl.glFlush(); gl.glEnd(); } 为 3D 图像提供便利,如旋转、缩放等。
旋转 3D 视图时,图像的光强度降低,在一定角度出现黑条。当我缩放该部分时,它会在 2 张图像中显示间隙。 我在任何一步都出错了吗?请指导我。提前致谢。
【问题讨论】:
-
这是一个非常广泛的话题。有整本关于体绘制的书籍。获得展示的东西很容易。正确有效地做这件事需要更多。
-
@Reto Koradi:我已经完成了 NEHE 教程。在此基础上,我在上面进行了编码。请您指导以使其正确有效吗?我缺乏适当的指导。你能建议我链接,网站吗?
-
我在这方面的工作成果记录在这里:retokoradi.com/volume-rendering。不过,我并没有真正解释实现细节,因此它可能对复制结果没有太大帮助。这是一个相当重要的软件,其中有一些我没有在任何地方分享过的原创部分。
-
谢谢。这个链接信息量很大。我从事 DICOM 图像的工作,能够显示骨骼、肺的 3D 视图。我从事细分工作。它是粗糙的形式。你能推荐我学习材料吗?这将指导我达到完美。