PDA

View Full Version : Slice is getting blur when i change slice number in the SoOrthoslice


aman.sonu
11-27-2008, 04:06 AM
Hii,

I m developing a dicom viewer. i m using SoOrthoslice.
i m loading data using paging. it is showing slice. but after changing the slice number:-

1. slice is getting blur.
2. i m not able to see any thing on the screen after changing 250-300 slices..

please help,

Regards,
Aman

mikeheck
12-01-2008, 06:08 AM
Hi Aman,

That doesn't sound like any known problem.
Here are some questions/suggestions:

Send a screen shot of the incorrect rendering
Tell us the dimensions of your test volume
Tell us your environment (OS, compiler, OIV version, graphics board, etc)
Do you see this problem running any of the example programs we provide? (on a volume of similar dimensions)
Can you load your test volume using the VolRend demo/example program we provide? Does it work any different/better?
Are you using VolumeViz LDM? When using LDM, it's possible for the slice to be temporarily blurred when the slice number is changed. In this case try increasing the system memory that LDM is allowed to use for caching data. It's only 256 MB by default, which is quite small for a modern machine.


Regards,
Mike Heck

aman.sonu
12-01-2008, 06:23 AM
Dear Mike,

Thanks for reply..

I m using OI and VolumeViz 6.1 x64 for windows Operating System.

My Dicom Data Dimentions is 512 x 512. I m using LDM.

As sometimes my slice go invisible after 300 slices, if i use camera viewAll() function after slice change then it work properly.

myOrthoSlice->sliceNumber.setValue(myOrthoSlice->sliceNumber.getValue() + 1);
myCam->viewAll(root,renderArea->getViewportRegion());


but after using viewAll function , it reset back to its default values. it is not retaining any previous value of camera.

Please suggest.

Regards,
Aman

mikeheck
12-06-2008, 11:03 PM
Hi Aman,

My best guess is that you need to check when (I mean where in your program) you make the call to viewAll(). I don't see any problem roaming through the slices using (for example) the VolRend demo/example program. But of course no part of the scene that is outside the 3D "view volume" (the region of 3D space visible to the camera) will be visible. This is true for any type of geometry, whether its polygons or VolumeViz slices. So we have to make sure the camera is adjusted such that all our data is visible.

An experiment you can try: Create a "visible" bounding box around the volume using, for example, an SoIndexedLineSet. If all of this geometry is visible then all of your slices should be visible. If not, then you need to adjust the camera after loading a new volume. I posted a utility function here that may be useful.

Luckily Open Inventor will do most of the work for you. You've already found the primary tool for this, the viewAll() method. The viewer version of this method computes the bounding box of the current scene using the current viewport. The SoCamera version computes the bounding box of a specified scene graph using a specified viewport region. In both cases viewAll then adjusts the camera position and view volume (but not orientation) so the computed bounding box is completely visible. If you allow the viewer to automatically create a camera (typical of simple programs), then whenever you call setSceneGraph() the viewer will automatically call viewAll() for you. Here are some cases when you need to call viewAll() yourself:

If you create your own camera, you are responsible for initializing the camera, so you should normally call viewAll() when loading a new scene graph, i.e. after calling setSceneGraph.
If you modify the scene graph in a way that changes the overall extent (bounding box), for example by adding some new geometry, then you MAY need to call viewAll() again. It depends... if your user does not expect the view to change, then you should leave it up to the user. In other words, provide a button in your user interface that causes a call to viewAll(). (There is a button for this in the standard OIV viewer decorations.)
In the special case of VolumeViz, you might keep the same scene graph but load a new volume that has a different bounding box. So whenever you modify the filename field of the SoVolumeData node, you may need to call viewAll(). In this case the user will usually expect the entire (new) volume to be initially visible, so a view change is expected.


Regards,
Mike

aman.sonu
12-10-2008, 04:18 AM
Dear Mike,

Thanks very much.

I have added Bounding box into my scene. now i m able to see the all slices. i have one query, can we change the viewVolume of camera directly.

now it is working fine, still slices got blur, please check the screen shots.

Is there any API in OI to convert 3D Volume into stereolithography (.stl) file format.

Again Thanks and Best Regards,

Aman

mikeheck
12-10-2008, 03:58 PM
Hi Aman,


I have added Bounding box into my scene. now i m able to see the all slices. i have one query, can we change the viewVolume of camera directly.

Yes, you can. Get a pointer/reference to the camera node (call the viewer's getCamera method if necessary). Change the position and orientation of the view volume using the camera node's position and orientation fields. Change the horizontal and vertical size of the view volume using the heightAngle and/or aspectRatio[I] fields. Change the depth/extent of the view volume using the
[I]nearDistance and farDistance fields.


now it is working fine, still slices got blur, please check the screen shots.

Some "blurring" is a normal feature of LDM rendering which occurs when low resolution (subsampled) data is temporarily displayed (until the full resolution data has finished loading). Typically DICOM data sets should fit in main memory, so the blurring should disappear very quickly and only occur once (if ever) for each slice. I'm not sure why your slices are remaining blurry, but there are some things we can try.

What, if any, LDM parameters are you setting in your application? The most important ones are the maximum amount of main memory allowed for caching data and the "load policy" (when data is allowed to be loaded). If your volume is, for example, 512 x 512 x 512 x 16 bits it needs slightly more than the default 256 MB of memory. For example, try:

pVolData->getLdmResourceParameter().maxMainMemory = 1024;
pVolData->getLdmResourceParameter().loadPolicy =
SoLDMResourceParameters::ALWAYS;



Is there any API in OI to convert 3D Volume into stereolithography (.stl) file format.

No, sorry, this is not a built-in feature. STL is a simple format and fairly easy to generate. However STL is a triangle based format, so you can't convert directly from volume data to STL. The first problem is to somehow generate a surface from your volume data. One way to do this is using Open Inventor's MeshViz XLM extension to extract an isosurface (see this post). Once you have a surface geometry in Open Inventor you can extract the triangles using the SoCallbackAction and the setTriangleCallback method.

Regards,
-Mike

aman.sonu
12-11-2008, 06:25 AM
Hey Mike,

thanks for the reply.

i have changed the Memory Size , now it is working fine..

____
Aman