Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
campvis-public
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
9
Issues
9
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CAMP
campvis-public
Commits
abcf155a
Commit
abcf155a
authored
Jul 07, 2015
by
Christian Schulte zu Berge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing registrationsliceview.frag shader. Added campvis::completePath(string) method.
parent
dc3e7de1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
1 deletion
+105
-1
core/init.cpp
core/init.cpp
+7
-0
core/init.h
core/init.h
+10
-1
modules/registration/glsl/registrationsliceview.frag
modules/registration/glsl/registrationsliceview.frag
+88
-0
No files found.
core/init.cpp
View file @
abcf155a
...
...
@@ -85,4 +85,11 @@ namespace campvis {
//PipelineFactory::deinit();
}
CAMPVIS_CORE_API
std
::
string
completePath
(
const
std
::
string
&
filename
)
{
if
(
!
cgt
::
ShaderManager
::
isInited
())
return
""
;
return
ShdrMgr
.
completePath
(
filename
);
}
}
core/init.h
View file @
abcf155a
...
...
@@ -47,9 +47,18 @@ namespace campvis {
CAMPVIS_CORE_API
void
init
(
cgt
::
GLCanvas
*
backgroundGlContext
,
const
std
::
vector
<
std
::
string
>&
searchPaths
=
std
::
vector
<
std
::
string
>
());
/**
*
*
Deinitializes the CAMPVis core stuff.
*/
CAMPVIS_CORE_API
void
deinit
();
/**
* Searches in all search paths for the given file and returns valid filename including complete path.
* If file is not found in search path, an empty string is returned.
* \note The function is just a proxy for ShaderManager::completePath.
* \param filename The file name to search for in search paths.
*/
CAMPVIS_CORE_API
std
::
string
completePath
(
const
std
::
string
&
filename
);
}
...
...
modules/registration/glsl/registrationsliceview.frag
0 → 100644
View file @
abcf155a
// ================================================================================================
//
// This file is part of the CAMPVis Software Framework.
//
// If not explicitly stated otherwise: Copyright (C) 2012-2014, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures
// Technische Universitaet Muenchen
// Boltzmannstr. 3, 85748 Garching b. Muenchen, Germany
//
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
//
// ================================================================================================
in
vec3
ex_TexCoord
;
in
vec4
ex_Color
;
out
vec4
out_Color
;
//#include "tools/background.frag"
#include "tools/texture3d.frag"
#include "tools/transferfunction.frag"
uniform
sampler3D
_refImage
;
uniform
sampler3D
_movImage
;
uniform
TextureParameters3D
_refImageParams
;
uniform
TextureParameters3D
_movImageParams
;
uniform
sampler1D
_refTf
;
uniform
sampler1D
_movTf
;
uniform
TFParameters1D
_refTfParams
;
uniform
TFParameters1D
_movTfParams
;
uniform
mat4
_texCoordsMatrix
;
uniform
mat4
_trafoMatrix
;
uniform
vec3
_halfDiagonal
;
uniform
bool
_useTexturing
=
true
;
uniform
bool
_useSolidColor
=
true
;
uniform
vec4
_color
=
vec4
(
1
.
0
,
1
.
0
,
1
.
0
,
1
.
0
);
void
main
()
{
if
(
_useTexturing
)
{
mat4
t2wr
=
_refImageParams
.
_textureToWorldMatrix
;
mat4
w2tm
=
_movImageParams
.
_worldToTextureMatrix
;
mat4
moveToCenter
=
mat4
(
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
,
0
,
-
_halfDiagonal
.
x
,
-
_halfDiagonal
.
y
,
-
_halfDiagonal
.
z
,
1
);
mat4
moveFromCenter
=
mat4
(
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
,
0
,
_halfDiagonal
.
x
,
_halfDiagonal
.
y
,
_halfDiagonal
.
z
,
1
);
vec4
referenceLookupTexCoord
=
_texCoordsMatrix
*
vec4
(
ex_TexCoord
,
1
.
0
);
vec4
movingLookupTexCoord
=
w2tm
*
moveFromCenter
*
_trafoMatrix
*
moveToCenter
*
t2wr
*
referenceLookupTexCoord
;
float
refTexel
=
texture
(
_refImage
,
referenceLookupTexCoord
.
xyz
).
r
;
float
movTexel
=
0
.
0
;
if
(
all
(
greaterThanEqual
(
movingLookupTexCoord
.
xyz
,
vec3
(
0
.
0
)))
&&
all
(
lessThanEqual
(
movingLookupTexCoord
.
xyz
,
vec3
(
1
.
0
))))
{
movTexel
=
texture
(
_movImage
,
movingLookupTexCoord
.
xyz
).
r
;
}
out_Color
=
(
lookupTF
(
_refTf
,
_refTfParams
,
refTexel
)
+
lookupTF
(
_movTf
,
_movTfParams
,
movTexel
))
/
2
.
0
;
float
maxElem
=
max
(
out_Color
.
x
,
max
(
out_Color
.
y
,
max
(
out_Color
.
z
,
out_Color
.
w
)));
if
(
maxElem
>
1
.
0
)
out_Color
/=
maxElem
;
}
else
if
(
_useSolidColor
)
{
out_Color
=
_color
;
}
else
{
out_Color
=
ex_Color
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment