Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
H3D.org Feeds


Browsing this Thread:   1 Anonymous Users




(1) 2 3 »


VHTK getting started
#1
Quite a regular
Quite a regular


See User information
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
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: VHTK getting started
#2
Guru
Guru


See User information
First of all it's hard to read your code if you do not enclose it with the code tags. Try the button looking like <>.

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.

Also, make sure that you have the volume size right. The volume seems to be about 6 meters, which I doubt fits your screen Set the pixelSize to something like 0.001 or so.

Posted on: 2007/10/7 14:03
KJ Lundin Palmerius
C Research
Linköping University, Sweden
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


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


See User information
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
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: VHTK getting started
#4
Guru
Guru


See User information
That might be because you are using both an iso surface and volume renderer at the same time. I know that alpha blending can get a bit confused if you do not tell H3D not to try to fix it. I can't remember how to do that, so try using only either one at a time.

Your alpha function looks fine. Maybe a bit too much alpha, you might not be able to see through the surface layers. Try replacing 1.00 with 0.01.

The default colour function is a gray scale ramp, so you should see something. Check the VHTKColorFunctionNode node in the doxygen reference manual for VHTK, and its dervatives.

Posted on: 2007/10/9 8:31
KJ Lundin Palmerius
C Research
Linköping University, Sweden
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


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


See User information
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
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


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


See User information
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
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


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


See User information
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
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: VHTK getting started
#8
Guru
Guru


See User information
Since integer images don't provide information about the range of the values there are two ways to interpret the data. Either you use the integer range, i.e. 0-255 for 8 bits data, 0-65535 for 16 bits data, and so on, or you remap the data to a specified range. I chose the latter, since that makes it easier to replace data and use the same transfer function. I have updated the documentation for the data node for the next release of VHTK.

To summarize: integer data is always remapped to the range [0,1] for unsigned data and [-1,1] for signed data.

If you really want your data in another range, it's possible to remap it using, for example, MagnitudeExtractorField.

Posted on: 2007/10/10 10:02
KJ Lundin Palmerius
C Research
Linköping University, Sweden
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


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


See User information
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
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: VHTK getting started
#10
Guru
Guru


See User information
I'm not sure what you mean by "all the information". The ScalarVolume node contains the data and retains some information about the size of the data. This can't be directly passed to a volume renderer, since this requires the data as a 3D texture, but you can convert it to a texture using the Texture3DVolume. If you want haptic feedback you need to select a haptic mode, add it to the scene graph and make the mode use your scalar volume. Take a look at how it is done in the setup_sphere example.

Posted on: 2007/10/11 14:00
KJ Lundin Palmerius
C Research
Linköping University, Sweden
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top




(1) 2 3 »



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create pdf.
You cannot get print page.

[Advanced Search]





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