Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
CAMP
campvis-public
Commits
1d009b00
Commit
1d009b00
authored
Jul 15, 2014
by
Christian Schulte zu Berge
Browse files
fixed some warnings and bugs.
parent
9591e2c3
Changes
4
Hide whitespace changes
Inline
Side-by-side
core/tools/concurrenthistogram.h
View file @
1d009b00
...
...
@@ -164,7 +164,7 @@ namespace campvis {
template
<
typename
T
,
size_t
ND
>
void
campvis
::
ConcurrentGenericHistogramND
<
T
,
ND
>::
addSample
(
T
sample
[
ND
])
{
size_t
bucketNumbers
[
ND
];
for
(
in
t
i
=
0
;
i
<
ND
;
++
i
)
for
(
size_
t
i
=
0
;
i
<
ND
;
++
i
)
bucketNumbers
[
i
]
=
getBucketNumber
(
i
,
sample
[
i
]);
size_t
index
=
getArrayIndex
(
bucketNumbers
);
...
...
@@ -186,13 +186,10 @@ namespace campvis {
if
(
sample
<
_min
[
dimension
]
||
sample
>
_max
[
dimension
])
{
return
_numBuckets
[
dimension
];
#ifdef CAMPVIS_DEBUG_NOTNOW
LWARNINGC
(
"CAMPVis.core.tools.ConcurrentGenericHistogramND"
,
"Added sample "
<<
sample
<<
" out of bounds for dimension "
<<
dimension
<<
"."
);
#endif
}
double
ratio
=
static_cast
<
double
>
(
sample
-
_min
[
dimension
])
/
static_cast
<
double
>
(
_max
[
dimension
]
-
_min
[
dimension
]);
return
static_cast
<
size_t
>
(
tgt
::
clamp
(
static_cast
<
int
>
(
ratio
*
_numBuckets
[
dimension
]),
static_cast
<
int
>
(
0
),
static_cast
<
int
>
(
_numBuckets
[
dimension
]
-
1
))
)
;
return
static_cast
<
size_t
>
(
tgt
::
clamp
(
static_cast
<
int
>
(
ratio
*
_numBuckets
[
dimension
]),
static_cast
<
int
>
(
0
),
static_cast
<
int
>
(
_numBuckets
[
dimension
]
)
-
1
));
}
template
<
typename
T
,
size_t
ND
>
...
...
modules/itk/processors/itkreader.cpp
View file @
1d009b00
...
...
@@ -120,21 +120,21 @@ namespace campvis {
LDEBUG
(
"pixel type: "
<<
imageIO
->
GetPixelType
());
// '5'
switch
(
pixelType
)
{
case
ScalarPixelTyp
e
::
CHAR
:
case
itk
::
ImageIOBas
e
::
CHAR
:
wtp
.
_baseType
=
WeaklyTypedPointer
::
INT8
;
break
;
case
ScalarPixelTyp
e
::
UCHAR
:
case
itk
::
ImageIOBas
e
::
UCHAR
:
wtp
.
_baseType
=
WeaklyTypedPointer
::
UINT8
;
break
;
case
ScalarPixelTyp
e
::
SHORT
:
case
itk
::
ImageIOBas
e
::
SHORT
:
wtp
.
_baseType
=
WeaklyTypedPointer
::
INT16
;
break
;
case
ScalarPixelTyp
e
::
USHORT
:
case
itk
::
ImageIOBas
e
::
USHORT
:
wtp
.
_baseType
=
WeaklyTypedPointer
::
UINT16
;
break
;
case
ScalarPixelTyp
e
::
INT
:
case
itk
::
ImageIOBas
e
::
INT
:
wtp
.
_baseType
=
WeaklyTypedPointer
::
INT32
;
break
;
case
ScalarPixelTyp
e
::
UINT
:
case
itk
::
ImageIOBas
e
::
UINT
:
wtp
.
_baseType
=
WeaklyTypedPointer
::
UINT32
;
break
;
case
ScalarPixelTyp
e
::
DOUBLE
:
case
itk
::
ImageIOBas
e
::
DOUBLE
:
LWARNING
(
"Pixel Type is DOUBLE. Conversion to float may result in loss of precision!"
);
case
ScalarPixelTyp
e
::
FLOAT
:
case
itk
::
ImageIOBas
e
::
FLOAT
:
wtp
.
_baseType
=
WeaklyTypedPointer
::
FLOAT
;
break
;
...
...
@@ -150,7 +150,7 @@ namespace campvis {
ioRegion
.
SetSize
(
ioSize
);
imageIO
->
SetIORegion
(
ioRegion
);
if
(
pixelType
!=
ScalarPixelTyp
e
::
DOUBLE
)
{
if
(
pixelType
!=
itk
::
ImageIOBas
e
::
DOUBLE
)
{
//Finally, allocate buffer and read the image data
wtp
.
_pointer
=
new
uint8_t
[
imageIO
->
GetImageSizeInBytes
()];
imageIO
->
Read
(
wtp
.
_pointer
);
...
...
@@ -248,21 +248,21 @@ namespace campvis {
LDEBUG
(
"pixel type: "
<<
imageIO
->
GetPixelType
());
switch
(
pixelType
)
{
case
ScalarPixelTyp
e
::
CHAR
:
case
itk
::
ImageIOBas
e
::
CHAR
:
wtp
.
_baseType
=
WeaklyTypedPointer
::
INT8
;
break
;
case
ScalarPixelTyp
e
::
UCHAR
:
case
itk
::
ImageIOBas
e
::
UCHAR
:
wtp
.
_baseType
=
WeaklyTypedPointer
::
UINT8
;
break
;
case
ScalarPixelTyp
e
::
SHORT
:
case
itk
::
ImageIOBas
e
::
SHORT
:
wtp
.
_baseType
=
WeaklyTypedPointer
::
INT16
;
break
;
case
ScalarPixelTyp
e
::
USHORT
:
case
itk
::
ImageIOBas
e
::
USHORT
:
wtp
.
_baseType
=
WeaklyTypedPointer
::
UINT16
;
break
;
case
ScalarPixelTyp
e
::
INT
:
case
itk
::
ImageIOBas
e
::
INT
:
wtp
.
_baseType
=
WeaklyTypedPointer
::
INT32
;
break
;
case
ScalarPixelTyp
e
::
UINT
:
case
itk
::
ImageIOBas
e
::
UINT
:
wtp
.
_baseType
=
WeaklyTypedPointer
::
UINT32
;
break
;
case
ScalarPixelTyp
e
::
DOUBLE
:
case
itk
::
ImageIOBas
e
::
DOUBLE
:
LWARNING
(
"Pixel Type is DOUBLE. Conversion to float may result in loss of precision!"
);
case
ScalarPixelTyp
e
::
FLOAT
:
case
itk
::
ImageIOBas
e
::
FLOAT
:
wtp
.
_baseType
=
WeaklyTypedPointer
::
FLOAT
;
break
;
...
...
@@ -279,8 +279,8 @@ namespace campvis {
imageIO
->
SetIORegion
(
ioRegion
);
//allocate a temporary buffer if necessary
double
*
inputBuf
=
(
pixelType
==
ScalarPixelTyp
e
::
DOUBLE
)
?
new
double
[
imageIO
->
GetImageSizeInComponents
()]
:
nullptr
;
size_t
sliceSize
=
(
pixelType
==
ScalarPixelTyp
e
::
DOUBLE
)
?
imageIO
->
GetImageSizeInComponents
()
*
sizeof
(
float
)
:
imageIO
->
GetImageSizeInBytes
();
double
*
inputBuf
=
(
pixelType
==
itk
::
ImageIOBas
e
::
DOUBLE
)
?
new
double
[
imageIO
->
GetImageSizeInComponents
()]
:
nullptr
;
size_t
sliceSize
=
(
pixelType
==
itk
::
ImageIOBas
e
::
DOUBLE
)
?
imageIO
->
GetImageSizeInComponents
()
*
sizeof
(
float
)
:
imageIO
->
GetImageSizeInBytes
();
wtp
.
_pointer
=
new
uint8_t
[
numSlices
*
sliceSize
];
for
(
int
idx
=
0
;
idx
<
numSlices
;
++
idx
)
{
itk
::
ImageIOBase
::
Pointer
fileIO
=
imageIO
;
...
...
@@ -289,7 +289,7 @@ namespace campvis {
fileIO
->
ReadImageInformation
();
fileIO
->
SetIORegion
(
ioRegion
);
size_t
currentSliceSize
=
(
pixelType
==
ScalarPixelTyp
e
::
DOUBLE
)
?
imageIO
->
GetImageSizeInComponents
()
*
sizeof
(
float
)
:
fileIO
->
GetImageSizeInBytes
();
size_t
currentSliceSize
=
(
pixelType
==
itk
::
ImageIOBas
e
::
DOUBLE
)
?
imageIO
->
GetImageSizeInComponents
()
*
sizeof
(
float
)
:
fileIO
->
GetImageSizeInBytes
();
if
(
currentSliceSize
!=
sliceSize
)
{
LERROR
(
"Image "
<<
imageFileNames
[
idx
]
<<
" has different dimensionality or data type!"
);
delete
static_cast
<
uint8_t
*>
(
wtp
.
_pointer
);
...
...
@@ -300,7 +300,7 @@ namespace campvis {
uint8_t
*
sliceBuffer
=
static_cast
<
uint8_t
*>
(
wtp
.
_pointer
)
+
idx
*
sliceSize
;
if
(
pixelType
!=
ScalarPixelTyp
e
::
DOUBLE
)
{
if
(
pixelType
!=
itk
::
ImageIOBas
e
::
DOUBLE
)
{
// directly read slice into buffer
fileIO
->
Read
(
sliceBuffer
);
}
...
...
modules/vis/processors/mprrenderer.cpp
View file @
1d009b00
...
...
@@ -93,7 +93,7 @@ namespace campvis {
// Construct the clipping plane in world coordinates
tgt
::
vec3
n
=
tgt
::
normalize
(
p_planeNormal
.
getValue
());
tgt
::
vec3
temp
(
1.0
,
0.0
,
0.0
);
if
(
abs
(
tgt
::
dot
(
temp
,
n
)
>
0.9
)
)
if
(
abs
(
tgt
::
dot
(
temp
,
n
)
)
>
0.9
)
temp
=
tgt
::
vec3
(
0.0
,
1.0
,
0.0
);
tgt
::
vec3
inPlaneA
=
tgt
::
normalize
(
tgt
::
cross
(
n
,
temp
))
*
0.5
f
*
p_planeSize
.
getValue
();
...
...
modules/vis/processors/virtualmirrorgeometrygenerator.cpp
View file @
1d009b00
...
...
@@ -74,7 +74,7 @@ namespace campvis {
std
::
vector
<
tgt
::
vec3
>
vertices
;
tgt
::
vec3
temp
=
cam
.
getUpVector
();
if
(
abs
(
tgt
::
dot
(
temp
,
n
)
>
0.9
f
)
)
if
(
abs
(
tgt
::
dot
(
temp
,
n
)
)
>
0.9
f
)
temp
=
tgt
::
vec3
(
0.
f
,
1.
f
,
0.
f
);
tgt
::
vec3
inPlaneA
=
tgt
::
normalize
(
tgt
::
cross
(
n
,
temp
))
*
0.5
f
*
p_size
.
getValue
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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