Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
37ac82b4
Commit
37ac82b4
authored
Feb 18, 2013
by
Alexander Wiebel
Browse files
[MERGE]
parents
74ca12e3
7ee38bc3
Changes
86
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
66 additions
and
66 deletions
+66
-66
src/core/common/WPropertyBase.cpp
src/core/common/WPropertyBase.cpp
+14
-14
src/core/common/WPropertyBase.h
src/core/common/WPropertyBase.h
+1
-1
src/core/common/WPropertyGroup.cpp
src/core/common/WPropertyGroup.cpp
+3
-3
src/core/common/WPropertyList.h
src/core/common/WPropertyList.h
+1
-1
src/core/common/WPropertyStruct.h
src/core/common/WPropertyStruct.h
+3
-3
src/core/common/WPropertyVariable.h
src/core/common/WPropertyVariable.h
+4
-4
src/core/dataHandler/WDataSetDTI.cpp
src/core/dataHandler/WDataSetDTI.cpp
+1
-1
src/core/dataHandler/WDataSetFibers.cpp
src/core/dataHandler/WDataSetFibers.cpp
+5
-5
src/core/dataHandler/WDataSetRawHARDI.h
src/core/dataHandler/WDataSetRawHARDI.h
+1
-1
src/core/dataHandler/WDataSetScalar.cpp
src/core/dataHandler/WDataSetScalar.cpp
+2
-2
src/core/dataHandler/WDataSetScalar.h
src/core/dataHandler/WDataSetScalar.h
+2
-2
src/core/dataHandler/WDataSetSegmentation.cpp
src/core/dataHandler/WDataSetSegmentation.cpp
+7
-7
src/core/dataHandler/WDataSetSegmentation.h
src/core/dataHandler/WDataSetSegmentation.h
+3
-3
src/core/dataHandler/WDataSetSingle.cpp
src/core/dataHandler/WDataSetSingle.cpp
+6
-6
src/core/dataHandler/WDataSetSingle.h
src/core/dataHandler/WDataSetSingle.h
+1
-1
src/core/dataHandler/WDataSetSphericalHarmonics.cpp
src/core/dataHandler/WDataSetSphericalHarmonics.cpp
+1
-1
src/core/dataHandler/WDataSetTimeSeries.cpp
src/core/dataHandler/WDataSetTimeSeries.cpp
+2
-2
src/core/dataHandler/WDataSetTimeSeries.h
src/core/dataHandler/WDataSetTimeSeries.h
+2
-2
src/core/dataHandler/WDataSetVector.cpp
src/core/dataHandler/WDataSetVector.cpp
+6
-6
src/core/dataHandler/WDataSetVector.h
src/core/dataHandler/WDataSetVector.h
+1
-1
No files found.
src/core/common/WPropertyBase.cpp
View file @
37ac82b4
...
...
@@ -115,67 +115,67 @@ void WPropertyBase::setHidden( bool hidden )
WPropInt
WPropertyBase
::
toPropInt
()
{
return
boost
::
s
hared_static
_cast
<
WPVInt
>
(
shared_from_this
()
);
return
boost
::
s
tatic_pointer
_cast
<
WPVInt
>
(
shared_from_this
()
);
}
WPropDouble
WPropertyBase
::
toPropDouble
()
{
return
boost
::
s
hared_static
_cast
<
WPVDouble
>
(
shared_from_this
()
);
return
boost
::
s
tatic_pointer
_cast
<
WPVDouble
>
(
shared_from_this
()
);
}
WPropBool
WPropertyBase
::
toPropBool
()
{
return
boost
::
s
hared_static
_cast
<
WPVBool
>
(
shared_from_this
()
);
return
boost
::
s
tatic_pointer
_cast
<
WPVBool
>
(
shared_from_this
()
);
}
WPropString
WPropertyBase
::
toPropString
()
{
return
boost
::
s
hared_static
_cast
<
WPVString
>
(
shared_from_this
()
);
return
boost
::
s
tatic_pointer
_cast
<
WPVString
>
(
shared_from_this
()
);
}
WPropFilename
WPropertyBase
::
toPropFilename
()
{
return
boost
::
s
hared_static
_cast
<
WPVFilename
>
(
shared_from_this
()
);
return
boost
::
s
tatic_pointer
_cast
<
WPVFilename
>
(
shared_from_this
()
);
}
WPropSelection
WPropertyBase
::
toPropSelection
()
{
return
boost
::
s
hared_static
_cast
<
WPVSelection
>
(
shared_from_this
()
);
return
boost
::
s
tatic_pointer
_cast
<
WPVSelection
>
(
shared_from_this
()
);
}
WPropColor
WPropertyBase
::
toPropColor
()
{
return
boost
::
s
hared_static
_cast
<
WPVColor
>
(
shared_from_this
()
);
return
boost
::
s
tatic_pointer
_cast
<
WPVColor
>
(
shared_from_this
()
);
}
WPropPosition
WPropertyBase
::
toPropPosition
()
{
return
boost
::
s
hared_static
_cast
<
WPVPosition
>
(
shared_from_this
()
);
return
boost
::
s
tatic_pointer
_cast
<
WPVPosition
>
(
shared_from_this
()
);
}
WPropGroup
WPropertyBase
::
toPropGroup
()
{
return
boost
::
s
hared_static
_cast
<
WPVGroup
>
(
shared_from_this
()
);
return
boost
::
s
tatic_pointer
_cast
<
WPVGroup
>
(
shared_from_this
()
);
}
WPropertyGroupBase
::
SPtr
WPropertyBase
::
toPropGroupBase
()
{
return
boost
::
s
hared_static
_cast
<
WPropertyGroupBase
>
(
shared_from_this
()
);
return
boost
::
s
tatic_pointer
_cast
<
WPropertyGroupBase
>
(
shared_from_this
()
);
}
WPropMatrix4X4
WPropertyBase
::
toPropMatrix4X4
()
{
return
boost
::
s
hared_static
_cast
<
WPVMatrix4X4
>
(
shared_from_this
()
);
return
boost
::
s
tatic_pointer
_cast
<
WPVMatrix4X4
>
(
shared_from_this
()
);
}
WPropTrigger
WPropertyBase
::
toPropTrigger
()
{
return
boost
::
s
hared_static
_cast
<
WPVTrigger
>
(
shared_from_this
()
);
return
boost
::
s
tatic_pointer
_cast
<
WPVTrigger
>
(
shared_from_this
()
);
}
WPropTransferFunction
WPropertyBase
::
toPropTransferFunction
()
{
return
boost
::
s
hared_static
_cast
<
WPVTransferFunction
>
(
shared_from_this
()
);
return
boost
::
s
tatic_pointer
_cast
<
WPVTransferFunction
>
(
shared_from_this
()
);
}
boost
::
shared_ptr
<
WCondition
>
WPropertyBase
::
getUpdateCondition
()
const
...
...
@@ -185,6 +185,6 @@ boost::shared_ptr< WCondition > WPropertyBase::getUpdateCondition() const
WPropInterval
WPropertyBase
::
toPropInterval
()
{
return
boost
::
s
hared_static
_cast
<
WPVInterval
>
(
shared_from_this
()
);
return
boost
::
s
tatic_pointer
_cast
<
WPVInterval
>
(
shared_from_this
()
);
}
src/core/common/WPropertyBase.h
View file @
37ac82b4
...
...
@@ -356,7 +356,7 @@ private:
template
<
typename
T
>
boost
::
shared_ptr
<
WPropertyVariable
<
T
>
>
WPropertyBase
::
toPropertyVariable
()
{
return
boost
::
shared_
dynamic_cast
<
WPropertyVariable
<
T
>
>
(
shared_from_this
()
);
return
boost
::
dynamic
_pointer
_cast
<
WPropertyVariable
<
T
>
>
(
shared_from_this
()
);
}
#endif // WPROPERTYBASE_H
...
...
src/core/common/WPropertyGroup.cpp
View file @
37ac82b4
...
...
@@ -145,7 +145,7 @@ T addDefaultConstraints( T prop )
bool
WPropertyGroup
::
set
(
boost
::
shared_ptr
<
WPropertyBase
>
value
,
bool
recommendedOnly
)
{
// is this the same type as we are?
WPropertyGroup
::
SPtr
v
=
boost
::
shared_
dynamic_cast
<
WPropertyGroup
>
(
value
);
WPropertyGroup
::
SPtr
v
=
boost
::
dynamic
_pointer
_cast
<
WPropertyGroup
>
(
value
);
if
(
!
v
)
{
// it is not a WPropertyStruct with the same type
...
...
@@ -193,8 +193,8 @@ bool WPropertyGroup::setImpl( boost::shared_ptr< WPropertyGroup > value, std::st
}
// not excluded. Is it a group or something else?
WPropertyGroup
::
SPtr
meAsGroup
=
boost
::
shared_
dynamic_cast
<
WPropertyGroup
>
(
prop
);
WPropertyGroup
::
SPtr
inputAsGroup
=
boost
::
shared_
dynamic_cast
<
WPropertyGroup
>
(
*
it
);
WPropertyGroup
::
SPtr
meAsGroup
=
boost
::
dynamic
_pointer
_cast
<
WPropertyGroup
>
(
prop
);
WPropertyGroup
::
SPtr
inputAsGroup
=
boost
::
dynamic
_pointer
_cast
<
WPropertyGroup
>
(
*
it
);
if
(
inputAsGroup
&&
meAsGroup
)
{
// not excluded and is group, recurse:
...
...
src/core/common/WPropertyList.h
View file @
37ac82b4
...
...
@@ -168,7 +168,7 @@ public:
virtual
bool
set
(
boost
::
shared_ptr
<
WPropertyBase
>
value
)
{
// is this the same type as we are?
typename
WPropertyListType
::
SPtr
v
=
boost
::
shared_
dynamic_cast
<
WPropertyListType
>
(
value
);
typename
WPropertyListType
::
SPtr
v
=
boost
::
dynamic
_pointer
_cast
<
WPropertyListType
>
(
value
);
if
(
!
v
)
{
// it is not a WPropertyList with the same type
...
...
src/core/common/WPropertyStruct.h
View file @
37ac82b4
...
...
@@ -278,7 +278,7 @@ public:
typename
boost
::
mpl
::
at
<
TypeVector
,
boost
::
mpl
::
size_t
<
N
>
>::
type
getProperty
()
{
typedef
typename
boost
::
mpl
::
at
<
TypeVector
,
boost
::
mpl
::
size_t
<
N
>
>::
type
::
element_type
TargetType
;
return
boost
::
shared_
dynamic_cast
<
TargetType
>
(
getProperty
(
N
)
);
return
boost
::
dynamic
_pointer
_cast
<
TargetType
>
(
getProperty
(
N
)
);
}
/**
...
...
@@ -292,7 +292,7 @@ public:
typename
boost
::
mpl
::
at
<
TypeVector
,
boost
::
mpl
::
size_t
<
N
>
>::
type
::
element_type
::
ConstSPtr
getProperty
()
const
{
typedef
typename
boost
::
mpl
::
at
<
TypeVector
,
boost
::
mpl
::
size_t
<
N
>
>::
type
::
element_type
TargetType
;
return
boost
::
shared_
dynamic_cast
<
const
TargetType
>
(
getProperty
(
N
)
);
return
boost
::
dynamic
_pointer
_cast
<
const
TargetType
>
(
getProperty
(
N
)
);
}
/**
...
...
@@ -428,7 +428,7 @@ public:
virtual
bool
set
(
boost
::
shared_ptr
<
WPropertyBase
>
value
,
bool
recommendedOnly
=
false
)
{
// is this the same type as we are?
typename
WPropertyStructType
::
SPtr
v
=
boost
::
shared_
dynamic_cast
<
WPropertyStructType
>
(
value
);
typename
WPropertyStructType
::
SPtr
v
=
boost
::
dynamic
_pointer
_cast
<
WPropertyStructType
>
(
value
);
if
(
!
v
)
{
// it is not a WPropertyStruct with the same type
...
...
src/core/common/WPropertyVariable.h
View file @
37ac82b4
...
...
@@ -584,7 +584,7 @@ bool WPropertyVariable< T >::accept( const T& newValue )
bool
acceptable
=
WFlag
<
T
>::
accept
(
newValue
);
for
(
typename
ConstraintContainerType
::
ConstIterator
it
=
l
->
get
().
begin
();
it
!=
l
->
get
().
end
();
++
it
)
{
acceptable
&=
(
*
it
)
->
accept
(
boost
::
s
hared_static
_cast
<
WPropertyVariable
<
T
>
>
(
shared_from_this
()
),
newValue
);
acceptable
&=
(
*
it
)
->
accept
(
boost
::
s
tatic_pointer
_cast
<
WPropertyVariable
<
T
>
>
(
shared_from_this
()
),
newValue
);
}
return
acceptable
;
...
...
@@ -620,7 +620,7 @@ template < typename T >
bool
WPropertyVariable
<
T
>::
set
(
boost
::
shared_ptr
<
WPropertyBase
>
value
,
bool
recommendedOnly
)
{
// try to cast the given property to a WPropertyVariable of right type:
boost
::
shared_ptr
<
WPropertyVariable
<
T
>
>
v
=
boost
::
shared_
dynamic_cast
<
WPropertyVariable
<
T
>
>
(
value
);
boost
::
shared_ptr
<
WPropertyVariable
<
T
>
>
v
=
boost
::
dynamic
_pointer
_cast
<
WPropertyVariable
<
T
>
>
(
value
);
if
(
v
)
{
if
(
recommendedOnly
)
...
...
@@ -795,7 +795,7 @@ boost::shared_ptr< WPropertyConstraintMin< T > > WPropertyVariable< T >::getMin(
}
// cast to proper type
return
boost
::
s
hared_static
_cast
<
WPropertyConstraintMin
<
T
>
>
(
c
);
return
boost
::
s
tatic_pointer
_cast
<
WPropertyConstraintMin
<
T
>
>
(
c
);
}
template
<
typename
T
>
...
...
@@ -810,7 +810,7 @@ boost::shared_ptr< WPropertyConstraintMax< T > > WPropertyVariable< T >::getMax(
}
// cast to proper type
return
boost
::
s
hared_static
_cast
<
WPropertyConstraintMax
<
T
>
>
(
c
);
return
boost
::
s
tatic_pointer
_cast
<
WPropertyConstraintMax
<
T
>
>
(
c
);
}
template
<
typename
T
>
...
...
src/core/dataHandler/WDataSetDTI.cpp
View file @
37ac82b4
...
...
@@ -59,7 +59,7 @@ WDataSetSingle::SPtr WDataSetDTI::clone() const
WTensorSym
<
2
,
3
,
float
>
WDataSetDTI
::
getTensor
(
size_t
index
)
const
{
boost
::
shared_ptr
<
WValueSet
<
float
>
>
values
=
boost
::
shared_
dynamic_cast
<
WValueSet
<
float
>
>
(
m_valueSet
);
boost
::
shared_ptr
<
WValueSet
<
float
>
>
values
=
boost
::
dynamic
_pointer
_cast
<
WValueSet
<
float
>
>
(
m_valueSet
);
WAssert
(
values
,
"The value set of a WDataSetDTI must be a WValueSet< float >, nothing else!"
);
return
WTensorSym
<
2
,
3
,
float
>
(
values
->
getWValue
(
index
)
);
}
...
...
src/core/dataHandler/WDataSetFibers.cpp
View file @
37ac82b4
...
...
@@ -274,7 +274,7 @@ void WDataSetFibers::removeColorScheme( WDataSetFibers::ColorArray colors )
WItemSelection
::
Iterator
i
=
l
->
get
().
begin
();
while
(
i
!=
l
->
get
().
end
()
)
{
if
(
boost
::
s
hared_static
_cast
<
const
ColorScheme
>
(
*
i
)
->
getColor
()
==
colors
)
if
(
boost
::
s
tatic_pointer
_cast
<
const
ColorScheme
>
(
*
i
)
->
getColor
()
==
colors
)
{
i
=
l
->
get
().
erase
(
i
);
}
...
...
@@ -291,7 +291,7 @@ void WDataSetFibers::replaceColorScheme( WDataSetFibers::ColorArray oldColors, W
WItemSelection
::
WriteTicket
l
=
m_colors
->
getWriteTicket
();
for
(
WItemSelection
::
Iterator
i
=
l
->
get
().
begin
();
i
!=
l
->
get
().
end
();
++
i
)
{
boost
::
shared_ptr
<
ColorScheme
>
ci
=
boost
::
s
hared_static
_cast
<
ColorScheme
>
(
*
i
);
boost
::
shared_ptr
<
ColorScheme
>
ci
=
boost
::
s
tatic_pointer
_cast
<
ColorScheme
>
(
*
i
);
if
(
ci
->
getColor
()
==
oldColors
)
{
ci
->
setColor
(
newColors
);
...
...
@@ -310,18 +310,18 @@ const boost::shared_ptr< WDataSetFibers::ColorScheme > WDataSetFibers::getColorS
throw
WDHNoSuchDataSet
(
std
::
string
(
"Color scheme with specified name could not be found."
)
);
}
return
boost
::
s
hared_static
_cast
<
ColorScheme
>
(
*
i
);
return
boost
::
s
tatic_pointer
_cast
<
ColorScheme
>
(
*
i
);
}
const
boost
::
shared_ptr
<
WDataSetFibers
::
ColorScheme
>
WDataSetFibers
::
getColorScheme
(
size_t
idx
)
const
{
WItemSelection
::
ReadTicket
l
=
m_colors
->
getReadTicket
();
return
boost
::
s
hared_static
_cast
<
ColorScheme
>
(
l
->
get
()[
idx
]
);
return
boost
::
s
tatic_pointer
_cast
<
ColorScheme
>
(
l
->
get
()[
idx
]
);
}
const
boost
::
shared_ptr
<
WDataSetFibers
::
ColorScheme
>
WDataSetFibers
::
getColorScheme
()
const
{
return
boost
::
s
hared_static
_cast
<
ColorScheme
>
(
m_colorProp
->
get
().
at
(
0
)
);
return
boost
::
s
tatic_pointer
_cast
<
ColorScheme
>
(
m_colorProp
->
get
().
at
(
0
)
);
}
const
WPropSelection
WDataSetFibers
::
getColorSchemeProperty
()
const
...
...
src/core/dataHandler/WDataSetRawHARDI.h
View file @
37ac82b4
...
...
@@ -210,7 +210,7 @@ template< typename T > WValue< T > WDataSetRawHARDI::getNonZeroGradientSignals(
{
WValue
<
T
>
result
(
m_nonZeroGradientIndexes
.
size
()
);
size_t
idx
=
0
;
boost
::
shared_ptr
<
WValueSet
<
T
>
>
vs
=
boost
::
shared_
dynamic_cast
<
WValueSet
<
T
>
>
(
m_valueSet
);
boost
::
shared_ptr
<
WValueSet
<
T
>
>
vs
=
boost
::
dynamic
_pointer
_cast
<
WValueSet
<
T
>
>
(
m_valueSet
);
WValue
<
T
>
signal
(
vs
->
getWValue
(
index
)
);
for
(
std
::
vector
<
size_t
>::
const_iterator
cit
=
m_nonZeroGradientIndexes
.
begin
();
cit
!=
m_nonZeroGradientIndexes
.
end
();
++
cit
)
{
...
...
src/core/dataHandler/WDataSetScalar.cpp
View file @
37ac82b4
...
...
@@ -102,7 +102,7 @@ boost::shared_ptr< WPrototyped > WDataSetScalar::getPrototype()
double
WDataSetScalar
::
interpolate
(
const
WPosition
&
pos
,
bool
*
success
)
const
{
boost
::
shared_ptr
<
WGridRegular3D
>
grid
=
boost
::
shared_
dynamic_cast
<
WGridRegular3D
>
(
m_grid
);
boost
::
shared_ptr
<
WGridRegular3D
>
grid
=
boost
::
dynamic
_pointer
_cast
<
WGridRegular3D
>
(
m_grid
);
WAssert
(
grid
,
"This data set has a grid whose type is not yet supported for interpolation."
);
WAssert
(
(
m_valueSet
->
order
()
==
0
&&
m_valueSet
->
dimension
()
==
1
),
...
...
@@ -155,7 +155,7 @@ double WDataSetScalar::interpolate( const WPosition& pos, bool* success ) const
double
WDataSetScalar
::
getValueAt
(
int
x
,
int
y
,
int
z
)
const
{
boost
::
shared_ptr
<
WGridRegular3D
>
grid
=
boost
::
shared_
dynamic_cast
<
WGridRegular3D
>
(
m_grid
);
boost
::
shared_ptr
<
WGridRegular3D
>
grid
=
boost
::
dynamic
_pointer
_cast
<
WGridRegular3D
>
(
m_grid
);
size_t
id
=
x
+
y
*
grid
->
getNbCoordsX
()
+
z
*
grid
->
getNbCoordsX
()
*
grid
->
getNbCoordsY
();
return
WDataSetSingle
::
getValueAt
(
id
);
...
...
src/core/dataHandler/WDataSetScalar.h
View file @
37ac82b4
...
...
@@ -202,8 +202,8 @@ private:
template
<
typename
T
>
T
WDataSetScalar
::
getValueAt
(
int
x
,
int
y
,
int
z
)
const
{
boost
::
shared_ptr
<
WValueSet
<
T
>
>
vs
=
boost
::
shared_
dynamic_cast
<
WValueSet
<
T
>
>
(
m_valueSet
);
boost
::
shared_ptr
<
WGridRegular3D
>
grid
=
boost
::
shared_
dynamic_cast
<
WGridRegular3D
>
(
m_grid
);
boost
::
shared_ptr
<
WValueSet
<
T
>
>
vs
=
boost
::
dynamic
_pointer
_cast
<
WValueSet
<
T
>
>
(
m_valueSet
);
boost
::
shared_ptr
<
WGridRegular3D
>
grid
=
boost
::
dynamic
_pointer
_cast
<
WGridRegular3D
>
(
m_grid
);
size_t
id
=
x
+
y
*
grid
->
getNbCoordsX
()
+
z
*
grid
->
getNbCoordsX
()
*
grid
->
getNbCoordsY
();
...
...
src/core/dataHandler/WDataSetSegmentation.cpp
View file @
37ac82b4
...
...
@@ -110,7 +110,7 @@ boost::shared_ptr< WPrototyped > WDataSetSegmentation::getPrototype()
float
WDataSetSegmentation
::
getWMProbability
(
int
x
,
int
y
,
int
z
)
const
{
boost
::
shared_ptr
<
WGridRegular3D
>
grid
=
boost
::
shared_
dynamic_cast
<
WGridRegular3D
>
(
m_grid
);
boost
::
shared_ptr
<
WGridRegular3D
>
grid
=
boost
::
dynamic
_pointer
_cast
<
WGridRegular3D
>
(
m_grid
);
size_t
id
=
x
+
y
*
grid
->
getNbCoordsX
()
+
z
*
grid
->
getNbCoordsX
()
*
grid
->
getNbCoordsY
();
return
WDataSetSingle
::
getValueAt
(
whiteMatter
+
(
3
*
id
)
);
...
...
@@ -118,7 +118,7 @@ float WDataSetSegmentation::getWMProbability( int x, int y, int z ) const
float
WDataSetSegmentation
::
getGMProbability
(
int
x
,
int
y
,
int
z
)
const
{
boost
::
shared_ptr
<
WGridRegular3D
>
grid
=
boost
::
shared_
dynamic_cast
<
WGridRegular3D
>
(
m_grid
);
boost
::
shared_ptr
<
WGridRegular3D
>
grid
=
boost
::
dynamic
_pointer
_cast
<
WGridRegular3D
>
(
m_grid
);
size_t
id
=
x
+
y
*
grid
->
getNbCoordsX
()
+
z
*
grid
->
getNbCoordsX
()
*
grid
->
getNbCoordsY
();
return
WDataSetSingle
::
getValueAt
(
grayMatter
+
(
3
*
id
)
);
...
...
@@ -126,7 +126,7 @@ float WDataSetSegmentation::getGMProbability( int x, int y, int z ) const
float
WDataSetSegmentation
::
getCSFProbability
(
int
x
,
int
y
,
int
z
)
const
{
boost
::
shared_ptr
<
WGridRegular3D
>
grid
=
boost
::
shared_
dynamic_cast
<
WGridRegular3D
>
(
m_grid
);
boost
::
shared_ptr
<
WGridRegular3D
>
grid
=
boost
::
dynamic
_pointer
_cast
<
WGridRegular3D
>
(
m_grid
);
size_t
id
=
x
+
y
*
grid
->
getNbCoordsX
()
+
z
*
grid
->
getNbCoordsX
()
*
grid
->
getNbCoordsY
();
return
WDataSetSingle
::
getValueAt
(
csf
+
(
3
*
id
)
);
...
...
@@ -142,9 +142,9 @@ boost::shared_ptr< WValueSetBase > WDataSetSegmentation::convert( boost::shared_
WAssert
(
cerebrospinalFluid
,
"No CSF data given."
);
// check for same dimension of all three tissue types
boost
::
shared_ptr
<
WGridRegular3D
>
wm_grid
=
boost
::
shared_
dynamic_cast
<
WGridRegular3D
>
(
whiteMatter
->
getGrid
()
);
boost
::
shared_ptr
<
WGridRegular3D
>
gm_grid
=
boost
::
shared_
dynamic_cast
<
WGridRegular3D
>
(
grayMatter
->
getGrid
()
);
boost
::
shared_ptr
<
WGridRegular3D
>
csf_grid
=
boost
::
shared_
dynamic_cast
<
WGridRegular3D
>
(
cerebrospinalFluid
->
getGrid
()
);
boost
::
shared_ptr
<
WGridRegular3D
>
wm_grid
=
boost
::
dynamic
_pointer
_cast
<
WGridRegular3D
>
(
whiteMatter
->
getGrid
()
);
boost
::
shared_ptr
<
WGridRegular3D
>
gm_grid
=
boost
::
dynamic
_pointer
_cast
<
WGridRegular3D
>
(
grayMatter
->
getGrid
()
);
boost
::
shared_ptr
<
WGridRegular3D
>
csf_grid
=
boost
::
dynamic
_pointer
_cast
<
WGridRegular3D
>
(
cerebrospinalFluid
->
getGrid
()
);
WAssert
(
(
wm_grid
->
getNbCoordsX
()
==
gm_grid
->
getNbCoordsX
()
)
&&
(
gm_grid
->
getNbCoordsX
()
==
csf_grid
->
getNbCoordsX
()
),
"Different X size of GrayMatter, WhiteMatter or CSF-Input"
);
...
...
@@ -207,7 +207,7 @@ boost::shared_ptr< WValueSetBase > WDataSetSegmentation::convert( boost::shared_
// size_t WMVoxel = 0;
// size_t GMVoxel = 0;
// size_t CSFVoxel = 0;
// boost::shared_ptr< WGridRegular3D > grid = boost::
shared_
dynamic_cast< WGridRegular3D >( getGrid() );
// boost::shared_ptr< WGridRegular3D > grid = boost::dynamic
_pointer
_cast< WGridRegular3D >( getGrid() );
// for( size_t x = 0; x < grid->getNbCoordsX(); x++ )
// for( size_t y = 0; y < grid->getNbCoordsY(); y++ )
// for( size_t z = 0; z < grid->getNbCoordsZ(); z++ )
...
...
src/core/dataHandler/WDataSetSegmentation.h
View file @
37ac82b4
...
...
@@ -214,7 +214,7 @@ WDataSetSegmentation::copyDataSetsToArray( const std::vector< boost::shared_ptr<
{
for
(
size_t
voxelNumber
=
0
;
voxelNumber
<
countVoxels
;
voxelNumber
++
)
{
data
[
voxelNumber
*
voxelDim
+
dimIndex
]
=
(
boost
::
s
hared_static
_cast
<
WDataSetSingle
>
(
*
it
)
)
->
getValueAt
<
T
>
(
voxelNumber
);
data
[
voxelNumber
*
voxelDim
+
dimIndex
]
=
(
boost
::
s
tatic_pointer
_cast
<
WDataSetSingle
>
(
*
it
)
)
->
getValueAt
<
T
>
(
voxelNumber
);
}
dimIndex
++
;
}
...
...
@@ -224,8 +224,8 @@ WDataSetSegmentation::copyDataSetsToArray( const std::vector< boost::shared_ptr<
// template < typename T > T WDataSetSegmentation::getValueAt( int x, int y, int z )
// {
// boost::shared_ptr< WValueSet< T > > vs = boost::
shared_
dynamic_cast< WValueSet< T > >( m_valueSet );
// boost::shared_ptr< WGridRegular3D > grid = boost::
shared_
dynamic_cast< WGridRegular3D >( m_grid );
// boost::shared_ptr< WValueSet< T > > vs = boost::dynamic
_pointer
_cast< WValueSet< T > >( m_valueSet );
// boost::shared_ptr< WGridRegular3D > grid = boost::dynamic
_pointer
_cast< WGridRegular3D >( m_grid );
//
// size_t id = x + y * grid->getNbCoordsX() + z * grid->getNbCoordsX() * grid->getNbCoordsY();
//
...
...
src/core/dataHandler/WDataSetSingle.cpp
View file @
37ac82b4
...
...
@@ -54,7 +54,7 @@ WDataSetSingle::WDataSetSingle( boost::shared_ptr< WValueSetBase > newValueSet,
m_infoProperties
->
addProperty
(
m_grid
->
getInformationProperties
()
);
// technically this should be placed into the WDataSetScalar, WDataSetVector and so on
boost
::
shared_ptr
<
WGridRegular3D
>
regGrid
=
boost
::
shared_
dynamic_cast
<
WGridRegular3D
>
(
m_grid
);
boost
::
shared_ptr
<
WGridRegular3D
>
regGrid
=
boost
::
dynamic
_pointer
_cast
<
WGridRegular3D
>
(
m_grid
);
if
(
regGrid
&&
(
m_valueSet
->
dimension
()
<
5
)
&&
(
m_valueSet
->
dimension
()
!=
0
)
)
{
m_texture
=
osg
::
ref_ptr
<
WDataTexture3D
>
(
new
WDataTexture3D
(
m_valueSet
,
regGrid
)
);
...
...
@@ -138,23 +138,23 @@ double WDataSetSingle::getValueAt( size_t id ) const
{
case
W_DT_UNSIGNED_CHAR
:
{
return
static_cast
<
double
>
(
boost
::
shared_
dynamic_cast
<
WValueSet
<
uint8_t
>
>
(
getValueSet
()
)
->
getScalar
(
id
)
);
return
static_cast
<
double
>
(
boost
::
dynamic
_pointer
_cast
<
WValueSet
<
uint8_t
>
>
(
getValueSet
()
)
->
getScalar
(
id
)
);
}
case
W_DT_INT16
:
{
return
static_cast
<
double
>
(
boost
::
shared_
dynamic_cast
<
WValueSet
<
int16_t
>
>
(
getValueSet
()
)
->
getScalar
(
id
)
);
return
static_cast
<
double
>
(
boost
::
dynamic
_pointer
_cast
<
WValueSet
<
int16_t
>
>
(
getValueSet
()
)
->
getScalar
(
id
)
);
}
case
W_DT_SIGNED_INT
:
{
return
static_cast
<
double
>
(
boost
::
shared_
dynamic_cast
<
WValueSet
<
int32_t
>
>
(
getValueSet
()
)
->
getScalar
(
id
)
);
return
static_cast
<
double
>
(
boost
::
dynamic
_pointer
_cast
<
WValueSet
<
int32_t
>
>
(
getValueSet
()
)
->
getScalar
(
id
)
);
}
case
W_DT_FLOAT
:
{
return
static_cast
<
double
>
(
boost
::
shared_
dynamic_cast
<
WValueSet
<
float
>
>
(
getValueSet
()
)
->
getScalar
(
id
)
);
return
static_cast
<
double
>
(
boost
::
dynamic
_pointer
_cast
<
WValueSet
<
float
>
>
(
getValueSet
()
)
->
getScalar
(
id
)
);
}
case
W_DT_DOUBLE
:
{
return
static_cast
<
double
>
(
boost
::
shared_
dynamic_cast
<
WValueSet
<
double
>
>
(
getValueSet
()
)
->
getScalar
(
id
)
);
return
static_cast
<
double
>
(
boost
::
dynamic
_pointer
_cast
<
WValueSet
<
double
>
>
(
getValueSet
()
)
->
getScalar
(
id
)
);
}
default:
WAssert
(
false
,
"Unknow data type in dataset."
);
...
...
src/core/dataHandler/WDataSetSingle.h
View file @
37ac82b4
...
...
@@ -190,7 +190,7 @@ private:
template
<
typename
T
>
T
WDataSetSingle
::
getValueAt
(
size_t
id
)
{
boost
::
shared_ptr
<
WValueSet
<
T
>
>
vs
=
boost
::
shared_
dynamic_cast
<
WValueSet
<
T
>
>
(
m_valueSet
);
boost
::
shared_ptr
<
WValueSet
<
T
>
>
vs
=
boost
::
dynamic
_pointer
_cast
<
WValueSet
<
T
>
>
(
m_valueSet
);
return
vs
->
getScalar
(
id
);
}
#endif // WDATASETSINGLE_H
src/core/dataHandler/WDataSetSphericalHarmonics.cpp
View file @
37ac82b4
...
...
@@ -40,7 +40,7 @@ WDataSetSphericalHarmonics::WDataSetSphericalHarmonics( boost::shared_ptr< WValu
boost
::
shared_ptr
<
WGrid
>
newGrid
)
:
WDataSetSingle
(
newValueSet
,
newGrid
),
m_valueSet
(
newValueSet
)
{
m_gridRegular3D
=
boost
::
shared_
dynamic_cast
<
WGridRegular3D
>
(
newGrid
);
m_gridRegular3D
=
boost
::
dynamic
_pointer
_cast
<
WGridRegular3D
>
(
newGrid
);
WAssert
(
newValueSet
,
"No value set given."
);
WAssert
(
newGrid
,
"No grid given."
);
}
...
...
src/core/dataHandler/WDataSetTimeSeries.cpp
View file @
37ac82b4
...
...
@@ -42,7 +42,7 @@ WDataSetTimeSeries::WDataSetTimeSeries( std::vector< boost::shared_ptr< WDataSet
WAssert
(
datasets
.
size
()
==
times
.
size
(),
""
);
std
::
vector
<
boost
::
shared_ptr
<
WDataSetScalar
const
>
>::
iterator
dit
;
std
::
vector
<
float
>::
iterator
tit
;
boost
::
shared_ptr
<
WGridRegular3D
>
g
=
boost
::
shared_
dynamic_cast
<
WGridRegular3D
>
(
datasets
.
front
()
->
getGrid
()
);
boost
::
shared_ptr
<
WGridRegular3D
>
g
=
boost
::
dynamic
_pointer
_cast
<
WGridRegular3D
>
(
datasets
.
front
()
->
getGrid
()
);
WAssert
(
g
,
""
);
dataType
d
=
datasets
.
front
()
->
getValueSet
()
->
getDataType
();
m_minValue
=
datasets
.
front
()
->
getMin
();
...
...
@@ -50,7 +50,7 @@ WDataSetTimeSeries::WDataSetTimeSeries( std::vector< boost::shared_ptr< WDataSet
for
(
dit
=
datasets
.
begin
(),
tit
=
times
.
begin
();
dit
!=
datasets
.
end
()
&&
tit
!=
times
.
end
();
++
dit
,
++
tit
)
{
WAssert
(
*
dit
,
""
);
WAssert
(
g
==
boost
::
shared_
dynamic_cast
<
WGridRegular3D
>
(
(
*
dit
)
->
getGrid
()
),
""
);
WAssert
(
g
==
boost
::
dynamic
_pointer
_cast
<
WGridRegular3D
>
(
(
*
dit
)
->
getGrid
()
),
""
);
WAssert
(
!
wlimits
::
isNaN
(
*
tit
),
""
);
WAssert
(
d
==
(
*
dit
)
->
getValueSet
()
->
getDataType
(),
""
);
WAssert
(
(
*
dit
)
->
getValueSet
()
->
dimension
()
==
1
,
""
);
...
...
src/core/dataHandler/WDataSetTimeSeries.h
View file @
37ac82b4
...
...
@@ -295,8 +295,8 @@ boost::shared_ptr< WValueSetBase > WDataSetTimeSeries::calcInterpolatedValueSet(
boost
::
shared_ptr
<
WDataSetScalar
const
>
f
=
getDataSetPtrAtTimeSlice
(
lb
);
boost
::
shared_ptr
<
WDataSetScalar
const
>
g
=
getDataSetPtrAtTimeSlice
(
ub
);
WAssert
(
f
&&
g
,
""
);
boost
::
shared_ptr
<
WValueSet
<
Data_T
>
>
vf
=
boost
::
shared_
dynamic_cast
<
WValueSet
<
Data_T
>
>
(
f
->
getValueSet
()
);
boost
::
shared_ptr
<
WValueSet
<
Data_T
>
>
vg
=
boost
::
shared_
dynamic_cast
<
WValueSet
<
Data_T
>
>
(
g
->
getValueSet
()
);
boost
::
shared_ptr
<
WValueSet
<
Data_T
>
>
vf
=
boost
::
dynamic
_pointer
_cast
<
WValueSet
<
Data_T
>
>
(
f
->
getValueSet
()
);
boost
::
shared_ptr
<
WValueSet
<
Data_T
>
>
vg
=
boost
::
dynamic
_pointer
_cast
<
WValueSet
<
Data_T
>
>
(
g
->
getValueSet
()
);
WAssert
(
vf
&&
vg
,
""
);
boost
::
shared_ptr
<
std
::
vector
<
Data_T
>
>
values
=
boost
::
shared_ptr
<
std
::
vector
<
Data_T
>
>
(
new
std
::
vector
<
Data_T
>
(
vf
->
size
()
)
);
float
ml
=
(
ub
-
time
)
/
(
ub
-
lb
);
...
...
src/core/dataHandler/WDataSetVector.cpp
View file @
37ac82b4
...
...
@@ -88,7 +88,7 @@ namespace
bool
*
success
,
boost
::
shared_ptr
<
WGridRegular3D
::
CellVertexArray
>
vertexIds
)
{
boost
::
shared_ptr
<
const
WGridRegular3D
>
grid
=
boost
::
shared_
dynamic_cast
<
const
WGridRegular3D
>
(
i_grid
);
boost
::
shared_ptr
<
const
WGridRegular3D
>
grid
=
boost
::
dynamic
_pointer
_cast
<
const
WGridRegular3D
>
(
i_grid
);
WAssert
(
grid
,
"This data set has a grid whose type is not yet supported for interpolation."
);
WAssert
(
(
i_valueSet
->
order
()
==
1
&&
i_valueSet
->
dimension
()
==
3
),
...
...
@@ -180,23 +180,23 @@ WVector3d WDataSetVector::getVectorAt( size_t index ) const
{
case
W_DT_UNSIGNED_CHAR
:
{
return
boost
::
shared_
dynamic_cast
<
WValueSet
<
uint8_t
>
>
(
getValueSet
()
)
->
getVector3D
(
index
);
return
boost
::
dynamic
_pointer
_cast
<
WValueSet
<
uint8_t
>
>
(
getValueSet
()
)
->
getVector3D
(
index
);
}
case
W_DT_INT16
:
{
return
boost
::
shared_
dynamic_cast
<
WValueSet
<
int16_t
>
>
(
getValueSet
()
)
->
getVector3D
(
index
);
return
boost
::
dynamic
_pointer
_cast
<
WValueSet
<
int16_t
>
>
(
getValueSet
()
)
->
getVector3D
(
index
);
}
case
W_DT_SIGNED_INT
:
{
return
boost
::
shared_
dynamic_cast
<
WValueSet
<
int32_t
>
>
(
getValueSet
()
)
->
getVector3D
(
index
);
return
boost
::
dynamic
_pointer
_cast
<
WValueSet
<
int32_t
>
>
(
getValueSet
()
)
->
getVector3D
(
index
);
}
case
W_DT_FLOAT
:
{
return
boost
::
shared_
dynamic_cast
<
WValueSet
<
float
>
>
(
getValueSet
()
)
->
getVector3D
(
index
);
return
boost
::
dynamic
_pointer
_cast
<
WValueSet
<
float
>
>
(
getValueSet
()
)
->
getVector3D
(
index
);
}
case
W_DT_DOUBLE
:
{
return
boost
::
shared_
dynamic_cast
<
WValueSet
<
double
>
>
(
getValueSet
()
)
->
getVector3D
(
index
);
return
boost
::
dynamic
_pointer
_cast
<
WValueSet
<
double
>
>
(
getValueSet
()
)
->
getVector3D
(
index
);
}
default:
WAssert
(
false
,
"Unknow data type in dataset."
);
...
...
src/core/dataHandler/WDataSetVector.h
View file @
37ac82b4
...
...
@@ -155,7 +155,7 @@ private:
inline
boost
::
shared_ptr
<
WDataSetVector
>
WDataSetVector
::
isVectorDataSet
()
{
return
boost
::
s
hared_static
_cast
<
WDataSetVector
>
(
shared_from_this
()
);
return
boost
::
s
tatic_pointer
_cast
<
WDataSetVector
>
(
shared_from_this
()
);
}
#endif // WDATASETVECTOR_H
Prev
1
2
3
4
5
Next
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