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
55832a1a
Commit
55832a1a
authored
Nov 21, 2009
by
Alexander Wiebel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADD
#119
] implemented empty module draft for distance map.
parent
cc352f6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
238 additions
and
0 deletions
+238
-0
src/modules/distanceMap/WMDistanceMap.cpp
src/modules/distanceMap/WMDistanceMap.cpp
+98
-0
src/modules/distanceMap/WMDistanceMap.h
src/modules/distanceMap/WMDistanceMap.h
+94
-0
src/modules/distanceMap/test/WMDistanceMap_test.h
src/modules/distanceMap/test/WMDistanceMap_test.h
+46
-0
No files found.
src/modules/distanceMap/WMDistanceMap.cpp
0 → 100644
View file @
55832a1a
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#include <string>
#include "WMDistanceMap.h"
#include "../../kernel/WKernel.h"
WMDistanceMap
::
WMDistanceMap
()
:
WModule
()
{
// WARNING: initializing connectors inside the constructor will lead to an exception.
// Implement WModule::initializeConnectors instead.
}
WMDistanceMap
::~
WMDistanceMap
()
{
// cleanup
removeConnectors
();
}
boost
::
shared_ptr
<
WModule
>
WMDistanceMap
::
factory
()
const
{
return
boost
::
shared_ptr
<
WModule
>
(
new
WMDistanceMap
()
);
}
const
std
::
string
WMDistanceMap
::
getName
()
const
{
return
"Distance Map"
;
}
const
std
::
string
WMDistanceMap
::
getDescription
()
const
{
return
"This description has to be improved when the module is completed."
" By now lets say the following: Computes a smoothed version of the dataset"
" and a distance map on it. Finally it renders this distance map using MarchinCubes"
;
}
void
WMDistanceMap
::
moduleMain
()
{
// TODO(wiebel): MC fix this hack when possible by using an input connector.
while
(
!
WKernel
::
getRunningKernel
()
)
{
sleep
(
1
);
}
while
(
!
WKernel
::
getRunningKernel
()
->
getDataHandler
()
)
{
sleep
(
1
);
}
while
(
!
WKernel
::
getRunningKernel
()
->
getDataHandler
()
->
getNumberOfSubjects
()
)
{
sleep
(
1
);
}
}
void
WMDistanceMap
::
connectors
()
{
// initialize connectors
m_input
=
boost
::
shared_ptr
<
WModuleInputData
<
boost
::
shared_ptr
<
WDataSet
>
>
>
(
new
WModuleInputData
<
boost
::
shared_ptr
<
WDataSet
>
>
(
shared_from_this
(),
"in"
,
"Dataset to compute isosurface for."
)
);
// add it to the list of connectors. Please note, that a connector NOT added via addConnector will not work as expected.
addConnector
(
m_input
);
// call WModules initialization
WModule
::
connectors
();
}
void
WMDistanceMap
::
properties
()
{
// ( m_properties->addDouble( "isoValue", 80 ) )->connect( boost::bind( &WMMarchingCubes::slotPropertyChanged, this, _1 ) );
}
src/modules/distanceMap/WMDistanceMap.h
0 → 100644
View file @
55832a1a
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WMDISTANCEMAP_H
#define WMDISTANCEMAP_H
#include <string>
#include "../../kernel/WModule.h"
#include "../../kernel/WModuleInputData.hpp"
/**
* Computes a distance map from an anatomy dataset and renders it as isosurface.
*/
class
WMDistanceMap
:
public
WModule
{
/**
* Only UnitTests may be friends.
*/
friend
class
WMDistanceMapTest
;
public:
/**
* Standard constructor.
*/
WMDistanceMap
();
/**
* Destructor.
*/
~
WMDistanceMap
();
/**
* Gives back the name of this module.
* \return the module's name.
*/
virtual
const
std
::
string
getName
()
const
;
/**
* Gives back a description of this module.
* \return description of module.
*/
virtual
const
std
::
string
getDescription
()
const
;
/**
* Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
* should never be initialized or modified in some other way. A simple new instance is required.
*
* \return the prototype used to create every module in OpenWalnut.
*/
virtual
boost
::
shared_ptr
<
WModule
>
factory
()
const
;
protected:
/**
* Entry point after loading the module. Runs in separate thread.
*/
virtual
void
moduleMain
();
/**
* Initialize the connectors this module is using.
*/
virtual
void
connectors
();
/**
* Initialize the properties for this module.
*/
virtual
void
properties
();
private:
boost
::
shared_ptr
<
WModuleInputData
<
boost
::
shared_ptr
<
WDataSet
>
>
>
m_input
;
//!< Input connector required by this module.
};
#endif // WMDISTANCEMAP_H
src/modules/distanceMap/test/WMDistanceMap_test.h
0 → 100644
View file @
55832a1a
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WMDISTANCEMAP_TEST_H
#define WMDISTANCEMAP_TEST_H
#include <cxxtest/TestSuite.h>
#include "../WMDistanceMap.h"
/**
* TODO(wiebel): Document this!
*/
class
WMDistanceMapTest
:
public
CxxTest
::
TestSuite
{
public:
/**
* TODO(wiebel): Document this!
*/
void
testSomething
(
void
)
{
}
};
#endif // WMDISTANCEMAP_TEST_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