Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenWalnut Core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
3964da04
Commit
3964da04
authored
Aug 30, 2010
by
schurade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADD] the roi manager now accepts an external bitfield for fiber selection
parent
8c1962a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
109 additions
and
6 deletions
+109
-6
src/kernel/modules/fiberDisplay/WROIManagerFibers.cpp
src/kernel/modules/fiberDisplay/WROIManagerFibers.cpp
+36
-3
src/kernel/modules/fiberDisplay/WROIManagerFibers.h
src/kernel/modules/fiberDisplay/WROIManagerFibers.h
+73
-3
No files found.
src/kernel/modules/fiberDisplay/WROIManagerFibers.cpp
View file @
3964da04
...
...
@@ -31,8 +31,11 @@
#include "../../../graphicsEngine/WROIBox.h"
WROIManagerFibers
::
WROIManagerFibers
()
:
m_recalcLock
(
false
)
m_recalcLock
(
false
),
m_useExternalBitfield
(
false
)
{
m_properties
=
boost
::
shared_ptr
<
WProperties
>
(
new
WProperties
(
"Properties"
,
"Module's properties"
)
);
m_dirty
=
m_properties
->
addProperty
(
"dirty"
,
"dirty flag"
,
true
);
}
WROIManagerFibers
::~
WROIManagerFibers
()
...
...
@@ -162,7 +165,12 @@ void WROIManagerFibers::removeFiberDataset( boost::shared_ptr< const WDataSetFib
boost
::
shared_ptr
<
std
::
vector
<
bool
>
>
WROIManagerFibers
::
getBitField
()
{
m_dirty
=
false
;
m_dirty
->
set
(
false
);
if
(
m_useExternalBitfield
)
{
return
m_externalBitfield
;
}
return
m_outputBitfield
;
}
...
...
@@ -196,7 +204,7 @@ void WROIManagerFibers::recalculate()
}
m_outputBitfield
=
m_workerBitfield
;
m_dirty
=
true
;
m_dirty
->
set
(
true
)
;
m_recalcLock
=
false
;
}
...
...
@@ -304,3 +312,28 @@ boost::shared_ptr< WRMROIRepresentation > WROIManagerFibers::getSelectedRoi()
{
return
m_selectedRoi
;
}
void
WROIManagerFibers
::
setExternalBitfield
(
boost
::
shared_ptr
<
std
::
vector
<
bool
>
>
bitfield
)
{
m_externalBitfield
=
bitfield
;
//m_dirty->set( true );
}
void
WROIManagerFibers
::
setUseExternalBitfield
(
bool
flag
)
{
m_useExternalBitfield
=
flag
;
if
(
!
flag
)
{
setDirty
();
}
else
{
m_dirty
->
set
(
true
);
}
}
boost
::
shared_ptr
<
std
::
vector
<
bool
>
>
WROIManagerFibers
::
getRoiBitfield
()
{
return
m_outputBitfield
;
}
src/kernel/modules/fiberDisplay/WROIManagerFibers.h
View file @
3964da04
...
...
@@ -184,10 +184,48 @@ public:
*/
size_t
size
();
/**
* setter for the external bitfield, the bitfield must have the same size as the fiber dataset and will
* be used like the master bitfield calculated from all rois when active
*
* \param bitfield
*/
void
setExternalBitfield
(
boost
::
shared_ptr
<
std
::
vector
<
bool
>
>
bitfield
);
/**
* setter if true the external bitfield will be used
*
* \param flag
*/
void
setUseExternalBitfield
(
bool
flag
);
/**
* getter
* \return the bitfield calculated from all active rois
*/
boost
::
shared_ptr
<
std
::
vector
<
bool
>
>
getRoiBitfield
();
/**
* getter for the properties object
* \return the properties object
*/
boost
::
shared_ptr
<
WProperties
>
getProperties
();
/**
* getter for the line start index array
* \return line starts
*/
boost
::
shared_ptr
<
std
::
vector
<
size_t
>
>
getStarts
();
/**
* getter for the line length array
* \return line lengths
*/
boost
::
shared_ptr
<
std
::
vector
<
size_t
>
>
getLengths
();
protected:
private:
bool
m_dirty
;
//!< dirty flag
size_t
m_size
;
//!< number of fibers in the dataset
boost
::
shared_ptr
<
const
WDataSetFibers
>
m_fibers
;
//!< registered fiber dataset
...
...
@@ -235,11 +273,27 @@ private:
boost
::
shared_ptr
<
std
::
vector
<
float
>
>
m_customColors
;
//!< vector to store custom colors
boost
::
shared_ptr
<
WRMROIRepresentation
>
m_selectedRoi
;
//!< stores a pointer to the currently selected roi
boost
::
shared_ptr
<
std
::
vector
<
bool
>
>
m_externalBitfield
;
//!< bit field of activated fibers
bool
m_useExternalBitfield
;
//!< flag controlling the use of an external bitfield
/**
* The property object for the module.
*/
boost
::
shared_ptr
<
WProperties
>
m_properties
;
/**
* dirty flag
*/
WPropBool
m_dirty
;
};
inline
bool
WROIManagerFibers
::
dirty
()
{
return
m_dirty
;
return
m_dirty
->
get
()
;
}
inline
size_t
WROIManagerFibers
::
size
()
...
...
@@ -247,4 +301,20 @@ inline size_t WROIManagerFibers::size()
return
m_size
;
}
inline
boost
::
shared_ptr
<
WProperties
>
WROIManagerFibers
::
getProperties
()
{
return
m_properties
;
}
inline
boost
::
shared_ptr
<
std
::
vector
<
size_t
>
>
WROIManagerFibers
::
getStarts
()
{
return
m_fibers
->
getLineStartIndexes
();
}
inline
boost
::
shared_ptr
<
std
::
vector
<
size_t
>
>
WROIManagerFibers
::
getLengths
()
{
return
m_fibers
->
getLineLengths
();
}
#endif // WROIMANAGERFIBERS_H
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