GradConverter

 

GradConverter is a little commandline  tool which I wrote because I did not find 'natural' datasets in the net using a rectilinear grid(most of the datasets available are for curvilinear grids, a grid type my program doesn't support. The tool data therefore does the following:

Input:
A 3D- dataset of ct-values suitable for volume rendering

Output:
A 3D- dataset containing the gradients of the ct-values suitable for flow visualisation. The output-dataset can be directly used as input to Flow3D.

 

GradConverter can be started like this:

GradConverter inputfile outputfile

 

For example:

GradConverter lobster.dat lobsterGrad.dat

 

Optionally, the type of the gradient can also be choosen:

GradConverter inputfile outputfile gradienttype

 

For example:

GradConverter lobster.dat lobsterGrad.dat 1

 

There are 2 types of gradient calculation:

 

Type 0(default method):

gradient.x = data[x+1][y][z] - data[x-1][y][z])/2
gradient.y = data[x][y+1][z] - data[x][y-1][z])/2
gradient.z = data[x][y][z+1] - data[x][y][z-1])/2

 

Type 1:

gradient.x = data[x][y][z+1] - data[x][y][z-1])/2
gradient.y = data[x][y+1][z] - data[x][y-1][z])/2
gradient.z = data[x+1][y][z] - data[x-1][y][z])/2

 

Type 0 is commonly used in volume visualisation, but with type 1, the streamlines have the tendency to glide better along the borders of materials with different ct-values, producing longer streamlines than with type 0.

 

The GradConverter files are available for download:

1) Source code: GradConverter.zip

2) Executeable: GradConverter_exe.zip

 

Here are some pictures rendered with the dataset lobster.dat. The colors show different scalar informations.

 

Gradient type 0:

 

Gradient type 1:

 

Here are some pictures rendered with the dataset skewed_head.dat. Gradient type 1 was used.


You can see the outline of a skull if you look closely:

Scalar property: Velocity

Scalar property: Velocity

Scalar property: Position

Scalar property: Velocity