Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
palasjir committed Dec 25, 2017
0 parents commit 3059fe7
Show file tree
Hide file tree
Showing 175 changed files with 3,037 additions and 0 deletions.
73 changes: 73 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="Uloha3" default="default" basedir=".">
<description>Builds, tests, and runs the project Uloha3.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar: JAR building
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="Uloha3-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>
Empty file.
Empty file.
Binary file added build/classes/viewer/Camera.class
Binary file not shown.
Binary file added build/classes/viewer/Main$1$1$1.class
Binary file not shown.
Binary file added build/classes/viewer/Main$1$1.class
Binary file not shown.
Binary file added build/classes/viewer/Main$1.class
Binary file not shown.
Binary file added build/classes/viewer/Main.class
Binary file not shown.
Binary file added build/classes/viewer/TransferFunction.class
Binary file not shown.
Binary file added build/classes/viewer/UnitCube.class
Binary file not shown.
Binary file not shown.
Binary file added build/classes/viewer/VisualizationPanel.class
Binary file not shown.
Binary file added build/classes/viewer/VolumeData.class
Binary file not shown.
Binary file not shown.
11 changes: 11 additions & 0 deletions build/classes/viewer/shaders/cube_shader.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#version 330 core

in vec3 vColor;

layout(location = 0) out vec4 vFragColor; //fragment shader output

void main()
{
//return constant colour as shader output
vFragColor = vec4(vColor, 1);
}
14 changes: 14 additions & 0 deletions build/classes/viewer/shaders/cube_shader.vert
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#version 330 core

layout(location = 0) in vec3 vVertex; //object space vertex position

uniform mat4 MVP; //combined modelview projection matrix

out vec3 vColor;

void main()
{
//get clipspace position
vColor = vVertex;
gl_Position = MVP*vec4(vVertex.xyz,1);
}
121 changes: 121 additions & 0 deletions build/classes/viewer/shaders/raycasting.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#version 330 core

in vec3 EntryPoint;
in vec2 UV;

uniform float StepSize;
uniform vec2 ScreenSize;
uniform sampler2D exitPoints;
uniform sampler3D VolumeTex;
uniform sampler1D TransferFunc;
uniform sampler3D gradients;
uniform mat4 V;
uniform mat4 normalMatrix;

const float specularExp = 128.0;
const float ambientLight = 0.2;
const vec4 lightCol = vec4(0.2, 0.2, 0.2, 1.0);

vec3 phong(vec3 color, vec3 viewSpaceNormal, vec3 viewSpacePosition);
vec3 shading(vec3 N, vec3 V, vec3 L);

vec3 light_position_world = vec3 (10.0, -10.0, 10.0);
const vec3 Ls = vec3 (1.0, 1.0, 1.0);
const vec3 Ld = vec3 (1.0, 1.0, 1.0);
const vec3 La = vec3 (0.1, 0.1, 0.1);

// surface reflectance
const vec3 Ks = vec3 (1.0, 1.0, 1.0); // fully reflect specular light
const vec3 Kd = vec3 (0.1, 0.1, 0.1); // orange diffuse surface reflectance
const vec3 Ka = vec3 (1.0, 1.0, 1.0); // fully reflect ambient light
const float specular_exponent = 100.0; // specular 'power'

void main()
{
vec3 exitPoint = texture(exitPoints, gl_FragCoord.st/ScreenSize).xyz;

// empty space skipping
if (EntryPoint == exitPoint)
discard;

vec3 dir = (exitPoint - EntryPoint);
float len = length(dir);
vec3 dirN = normalize(dir);

vec3 deltaDir = dirN * StepSize;
float deltaDirLen = length(deltaDir);

// jittering
float random = 1* fract(sin(gl_FragCoord.x * 12.9898 + gl_FragCoord.y * 78.233) * 43758.5453);
vec3 voxelCoord = EntryPoint + deltaDir *random;;

vec4 colorAcum = vec4(0.0); // The dest color
float alphaAcum = 0.0;

float intensity;
float lengthAcum = 0.0;
vec4 sample; // sample color
vec3 gradient;

vec4 bgColor = vec4(0.2, 0.2, 0.2, 1.0);

vec3 viewSpacePosition;
vec3 viewSpaceNormal;


for(int i = 0; i < 2000; i++)
{
intensity = texture(VolumeTex, voxelCoord).x;
gradient = normalize(texture(gradients, voxelCoord).xyz);
sample = texture(TransferFunc, intensity);

viewSpacePosition = voxelCoord;
viewSpaceNormal = normalize(( normalMatrix* vec4(gradient, 0.0)).xyz);

if (sample.a > 0.0) {
// correction
sample.a = 1.0 - pow(1.0 - sample.a, StepSize*100.0f);
sample.rbg = phong(sample.rgb, viewSpaceNormal, viewSpacePosition);

colorAcum.rgb = colorAcum.rbg + (1.0 - colorAcum.a) * sample.rgb * sample.a ;
colorAcum.a = colorAcum.a + (1.0 - colorAcum.a) * sample.a;
}

voxelCoord += deltaDir;
lengthAcum += deltaDirLen;

if (lengthAcum >= len ) {
colorAcum.rgb = colorAcum.rgb*colorAcum.a + (1 - colorAcum.a)*bgColor.rgb;
break;
}else if (colorAcum.a > 1.0) {
colorAcum.a = 1.0;
break;
}
}

gl_FragColor = colorAcum;
}

vec3 phong(vec3 color, vec3 viewSpaceNormal, vec3 viewSpacePosition)
{

// ambient intensity
vec3 Ia = La * Ka;

// diffuse intensity
vec3 viewSpaceLightPosition = vec3 (V*vec4 (light_position_world, 1.0));
vec3 normal = normalize(viewSpaceNormal);
vec3 directionToLight = normalize(viewSpaceLightPosition - viewSpacePosition);
vec3 Id = Ld * color * max(0, dot(normal, directionToLight));

// specular intensity
vec3 reflection_eye = reflect(-directionToLight, normal);
vec3 surface_to_viewer_eye = normalize(-viewSpacePosition);
float dot_prod_specular = dot (reflection_eye, surface_to_viewer_eye);
dot_prod_specular = max(dot_prod_specular, 0.0);
float specular_factor = pow (dot_prod_specular, specular_exponent);
vec3 Is = Ls * Ks * specular_factor;

// final colour
return Is + Id + Ia;
}
14 changes: 14 additions & 0 deletions build/classes/viewer/shaders/raycasting.vert
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#version 330 core

layout (location = 0) in vec3 vVertex;

out vec3 EntryPoint;
out vec4 ExitPointCoord;

uniform mat4 MVP;

void main()
{
EntryPoint = vVertex;
gl_Position = MVP * vec4(vVertex,1);
}
6 changes: 6 additions & 0 deletions cthead/.picasa.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[cthead-16bit028.tif]
backuphash=57657
[cthead-16bit045.tif]
backuphash=39839
[cthead-16bit059.tif]
backuphash=25380
Binary file added cthead/cthead-16bit001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit009.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit012.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit013.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit014.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit015.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit016.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit017.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit018.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit019.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit020.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit021.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit022.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit023.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit025.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cthead/cthead-16bit026.png
Binary file added cthead/cthead-16bit027.png
Binary file added cthead/cthead-16bit028.png
Binary file added cthead/cthead-16bit029.png
Binary file added cthead/cthead-16bit030.png
Binary file added cthead/cthead-16bit031.png
Binary file added cthead/cthead-16bit032.png
Binary file added cthead/cthead-16bit033.png
Binary file added cthead/cthead-16bit034.png
Binary file added cthead/cthead-16bit035.png
Binary file added cthead/cthead-16bit036.png
Binary file added cthead/cthead-16bit037.png
Binary file added cthead/cthead-16bit038.png
Binary file added cthead/cthead-16bit039.png
Binary file added cthead/cthead-16bit040.png
Binary file added cthead/cthead-16bit041.png
Binary file added cthead/cthead-16bit042.png
Binary file added cthead/cthead-16bit043.png
Binary file added cthead/cthead-16bit044.png
Binary file added cthead/cthead-16bit045.png
Binary file added cthead/cthead-16bit046.png
Binary file added cthead/cthead-16bit047.png
Binary file added cthead/cthead-16bit048.png
Binary file added cthead/cthead-16bit049.png
Binary file added cthead/cthead-16bit050.png
Binary file added cthead/cthead-16bit051.png
Binary file added cthead/cthead-16bit052.png
Binary file added cthead/cthead-16bit053.png
Binary file added cthead/cthead-16bit054.png
Binary file added cthead/cthead-16bit055.png
Binary file added cthead/cthead-16bit056.png
Binary file added cthead/cthead-16bit057.png
Binary file added cthead/cthead-16bit058.png
Binary file added cthead/cthead-16bit059.png
Binary file added cthead/cthead-16bit060.png
Binary file added cthead/cthead-16bit061.png
Binary file added cthead/cthead-16bit062.png
Binary file added cthead/cthead-16bit063.png
Binary file added cthead/cthead-16bit064.png
Binary file added cthead/cthead-16bit065.png
Binary file added cthead/cthead-16bit066.png
Binary file added cthead/cthead-16bit067.png
Binary file added cthead/cthead-16bit068.png
Binary file added cthead/cthead-16bit069.png
Binary file added cthead/cthead-16bit070.png
Binary file added cthead/cthead-16bit071.png
Binary file added cthead/cthead-16bit072.png
Binary file added cthead/cthead-16bit073.png
Binary file added cthead/cthead-16bit074.png
Binary file added cthead/cthead-16bit075.png
Binary file added cthead/cthead-16bit076.png
Binary file added cthead/cthead-16bit077.png
Binary file added cthead/cthead-16bit078.png
Binary file added cthead/cthead-16bit079.png
Binary file added cthead/cthead-16bit080.png
Binary file added cthead/cthead-16bit081.png
Binary file added cthead/cthead-16bit082.png
Binary file added cthead/cthead-16bit083.png
Binary file added cthead/cthead-16bit084.png
Binary file added cthead/cthead-16bit085.png
Binary file added cthead/cthead-16bit086.png
Binary file added cthead/cthead-16bit087.png
Binary file added cthead/cthead-16bit088.png
Binary file added cthead/cthead-16bit089.png
Binary file added cthead/cthead-16bit090.png
Binary file added cthead/cthead-16bit091.png
Binary file added cthead/cthead-16bit092.png
Binary file added cthead/cthead-16bit093.png
Binary file added cthead/cthead-16bit094.png
Binary file added cthead/cthead-16bit095.png
Binary file added cthead/cthead-16bit096.png
Binary file added cthead/cthead-16bit097.png
Binary file added cthead/cthead-16bit098.png
Binary file added cthead/cthead-16bit099.png
Binary file added cthead/cthead-16bit100.png
Binary file added cthead/cthead-16bit101.png
Binary file added cthead/cthead-16bit102.png
Binary file added cthead/cthead-16bit103.png
Binary file added cthead/cthead-16bit104.png
Binary file added cthead/cthead-16bit105.png
Binary file added cthead/cthead-16bit106.png
Binary file added cthead/cthead-16bit107.png
Binary file added cthead/cthead-16bit108.png
Binary file added cthead/cthead-16bit109.png
Binary file added cthead/cthead-16bit110.png
Binary file added cthead/cthead-16bit111.png
Binary file added cthead/cthead-16bit112.png
Binary file added cthead/cthead-16bit113.png
Binary file not shown.
Binary file added libs/commons-math3-3.2.jar
Binary file not shown.
Binary file added libs/gluegen-rt-natives-macosx-universal.jar
Binary file not shown.
Binary file added libs/gluegen-rt.jar
Binary file not shown.
Binary file added libs/jglm-0.1-SNAPSHOT.jar
Binary file not shown.
Binary file added libs/jogl-all-natives-macosx-universal.jar
Binary file not shown.
Binary file added libs/jogl-all.jar
Binary file not shown.
4 changes: 4 additions & 0 deletions libs/nblibraries.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
libs.CopyLibs.classpath=\
${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
libs.CopyLibs.displayName=CopyLibs Task
libs.CopyLibs.prop-version=2.0
3 changes: 3 additions & 0 deletions manifest.mf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build

Loading

0 comments on commit 3059fe7

Please sign in to comment.