Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
H3D.org Feeds

Forum Index


Board index » All Posts (kimchuan)




Re: VHTK getting started
#1
Quite a regular
Quite a regular


May i know where is the source code for VHTK::WindowFunction? I couldn't really understand how WindowFunction work to clamp the ScalarVolume.

Posted on: 2007/10/15 11:25
Top


Re: VHTK getting started
#2
Quite a regular
Quite a regular


I plan to use Texture3Dvolume class with WindowFunction to filter the ScalarVolume, hence generate a sphere with specific pixel value between [0,1] and pass it to VolumeRenderer to render it. The following code is NOT working. May i know what is the correct way of doing it?

<!-- Volume Rendering   -->  
          
        <
VolumeRenderer
              planes
="200" >
            
            <
Texture3DVolume
                property
="SCALAR" >
                <
WindowFunction
          level
=".5"
          
width="0.5"
          
roof="0.5"/>
                <
ScalarVolume
              DEF
="SSCALAR"
              
url="data/sphere_128x128x128_u8.raw" >
            <
ManipImageLoader
            padding
="true">
              <
RawImageLoader
              width
="128" height="128" depth="128"
              
bitsPerPixel="8"
              
pixelType="LUMINANCE"
              
pixelComponentType="UNSIGNED"
              
pixelSize="0.1 0.1 0.1" />
            </
ManipImageLoader>
            </
ScalarVolume>
            </
Texture3DVolume>
            
         </
VolumeRenderer>

Posted on: 2007/10/12 10:49
Top


Re: VHTK getting started
#3
Quite a regular
Quite a regular


I'm not familiar with the data type avaliable in H3D and VHTK. The following code is how i filter the sphere data according to my chosen Isovalue.

<Shape DEF="i_shape">
<
Appearance DEF="SURFAPP">
<
RenderProperties />
<
Material transparency=".3" />
</
Appearance>
<
IsoSurface DEF="V_ISO"
  
solid="FALSE"
    
isoValue="0.6" >
  <
ScalarVolume
              DEF
="SCALAR"
              
url="data/sphere_128x128x128_u8.raw" >
            <
ManipImageLoader
                padding
="true">
              <
RawImageLoader
                  width
="128" height="128" depth="128"
                  
bitsPerPixel="8"
                  
pixelType="LUMINANCE"
                  
pixelComponentType="UNSIGNED"
                  
pixelSize="0.1 0.1 0.1" />
            </
ManipImageLoader>
        </
ScalarVolume>
</
IsoSurface>
</
Shape>


May i know how can i pass the shape above to Texture3DVolume?

Posted on: 2007/10/11 19:02
Top


Re: VHTK getting started
#4
Quite a regular
Quite a regular


sorry for my poor English. "all the information" mean the raw data in each reading image, have not been filter by the filter class, e.g. IsoSurface.


Posted on: 2007/10/11 14:04
Top


Re: VHTK getting started
#5
Quite a regular
Quite a regular


Thanks for your clarification Karlu, it is really helpful. I manage to use isoSurface class to display a shape node of my CT volume with isoValue (500/2^15 for skin) and (1150/2^15 for bone).

Can i assume a ScalarVolume contains all the information off the reading data?

If my assumtion is correct. May i know how can i filter the ScalarVolume and pass it to VolumeRenderer in order to have the sense of force feedback?

Posted on: 2007/10/10 11:15
Top


Re: VHTK getting started
#6
Quite a regular
Quite a regular


Quote:

Looking at your code it looks like just minor problems. You seem to read the data correctly, but the data are not in Hounsfield Units as it looks as if you assume. Instead, if you read data that is not floating point (and therefore with determined range) it is automatically mapped to the range [0,1]. Try using a isoValue of 0.8 or so instead.



case 1:
if i'm using isoSurface to read the example data sphere_128x128x128_u8.raw, the value for the isoValue should between [0,1] or 0 to 255?

case 2:
I realised that i did some stupid mistake with RawImageLoader, the bitsPerPixel for my CT data should be 16. If i'm using isoSurface to read the CT data, the value for the isoValue should between [0,1] or [-1000 to 1000]?


Posted on: 2007/10/9 17:21
Top


Re: VHTK getting started
#7
Quite a regular
Quite a regular


Hi karlu,

I think want to do something similiar to one of your work (http://staffwww.itn.liu.se/~karlu/work/VolumeHaptics/images/ct.png)

Hopefully u can help me out.


Posted on: 2007/10/9 11:08
Top


Re: VHTK getting started
#8
Quite a regular
Quite a regular


Quote:

karlu wrote:
That might be because you are using both an iso surface and volume renderer at the same time.


I thought i need to use volume renderer to render every volume data? I would really happy to try it out if i could render the geometry produced by isoSurface without using volume renderer. :)

By the way.. can i have all this examples in C++ code?


Posted on: 2007/10/9 10:50
Top


Re: VHTK getting started
#9
Quite a regular
Quite a regular


Sorry for the messy of my code and thanks for your help karlu.

<Group>
  
  <
ImportLibrary library="lib/VHTK.dll" />
  
  <
Background
      skyColor
="0.5 0.5 0.5"/>
<
Transform
      scale
=".02 .02 .02" >  
  <
VolumeHaptics />
 
        
<!-- 
Iso surfaces  -->

<
Shape DEF="i_shape">
<
Appearance DEF="SURFAPP">
<
RenderProperties />
<
Material transparency=".3" />
</
Appearance>
<
IsoSurface DEF="V_ISO"
  
solid="FALSE"
  
isoValue="0.8" >
       <
ScalarVolume
        DEF
="SSCALAR"
        
url="KimVTKDataDataheadsqall.raw" >
      <
ManipImageLoader
          padding
="true">
        <
RawImageLoader
        width
="64" height="64" depth="93"
        
bitsPerPixel="8"
        
pixelType="LUMINANCE"
        
pixelComponentType="UNSIGNED"
        
pixelSize="0.1 0.1 0.1" />
      </
ManipImageLoader>

    </
ScalarVolume>

</
IsoSurface>
</
Shape>

  
  <
Transform
      DEF
="ICONS">
    <
LocalInfo DEF="INFO" />
  </
Transform>    
  <
Transform
      DEF
="VOLUME"
      
scale="1 1 1"
      
rotation="1 0 0 0" >

      <!-- 
Volume Rendering  -->  
          
          <
VolumeRenderer
              planes
="200" >
            <
Texture3DVolume
                property
="SCALAR" >
              
              <
scalarVolume
                  
USE="SSCALAR" />
            </
Texture3DVolume>
                
      <
PiecewiseFunction
                      containerField
="alphaFunction"
                      
continuous="true"
                      
segments="0.00  0.00
                                0.8  1.00
                          1.00  0.00" 
/>      
         </
VolumeRenderer>
    
   </
Transform>


May i know for how can i set the RGBFunction and alphaFunction in my VolumeRenderer in order to visualise the pixel with isoValue 0.8? I'm only seeing a lot of black, grey and white dot at the moment.


Posted on: 2007/10/7 17:09
Top


VHTK getting started
#10
Quite a regular
Quite a regular


I tried to load a data set (CT head image slices provided by vtk, value 500 indicate the skin and 1150 indicate the bone) by using VHTK. Am i doing it correctly?






solid="FALSE"
isoValue="500" >
DEF="SSCALAR"
url="Kim\VTKData\Data\headsq\all.raw" >
pixelType="LUMINANCE"
pixelComponentType="UNSIGNED"
pixelSize="0.1 0.1 0.1" />





DEF="ICONS">


DEF="VOLUME"
scale="1 1 1"
rotation="1 0 0 0" >

planes="100" >
property="SCALAR" >
level="0"
width="1" />
USE="SSCALAR" />


containerField="alphaFunction"
continuous="true"
segments="0.00 1.0
1.00 1.0" />



May i know why i cant see my volume data? What should i do with the color and alpha channel if i want to make the skin(isovalue 500) to display with orange colour?

Posted on: 2007/10/5 11:08
Top



TopTop
(1) 2 3 »






(C) 2012 SenseGraphics AB    ---    Powered by XOOPS