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
15eb58d0
Commit
15eb58d0
authored
Feb 04, 2010
by
Sebastian Eichelbaum
Browse files
[ADD] - added skeleton of connectome viewer module
parent
6afb252c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
236 additions
and
0 deletions
+236
-0
src/modules/connectomeView/CMakeLists.txt
src/modules/connectomeView/CMakeLists.txt
+8
-0
src/modules/connectomeView/WMConnectomeView.cpp
src/modules/connectomeView/WMConnectomeView.cpp
+113
-0
src/modules/connectomeView/WMConnectomeView.h
src/modules/connectomeView/WMConnectomeView.h
+115
-0
No files found.
src/modules/connectomeView/CMakeLists.txt
0 → 100644
View file @
15eb58d0
FILE
(
GLOB_RECURSE MODULES_SRC
"*.cpp"
"*.h"
)
# Unit tests
IF
(
OW_COMPILE_TESTS
)
CXXTEST_ADD_TESTS_FROM_LIST
(
"
${
MODULES_SRC
}
"
"kernel"
)
ENDIF
(
OW_COMPILE_TESTS
)
\ No newline at end of file
src/modules/connectomeView/WMConnectomeView.cpp
0 → 100644
View file @
15eb58d0
//---------------------------------------------------------------------------
//
// 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 <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cmath>
#include "WMConnectomeView.h"
#include <osg/Geode>
#include <osg/Geometry>
#include <osg/StateSet>
#include <osg/StateAttribute>
#include <osg/PolygonMode>
#include <osg/LightModel>
#include <osgDB/WriteFile>
#include "../../common/WProgress.h"
#include "../../common/WPreferences.h"
#include "../../math/WVector3D.h"
#include "../../dataHandler/WSubject.h"
#include "../../dataHandler/WGridRegular3D.h"
#include "../../dataHandler/WDataTexture3D.h"
#include "../../kernel/WKernel.h"
#include "../../graphicsEngine/WShader.h"
#include "../data/WMData.h"
WMConnectomeView
::
WMConnectomeView
()
:
WModuleContainer
(
"Connectome View"
,
"Connectome View allows connectome data to be displayed in the context of MRI data."
),
m_dataSet
()
{
// WARNING: initializing connectors inside the constructor will lead to an exception.
// Implement WModule::initializeConnectors instead.
}
WMConnectomeView
::~
WMConnectomeView
()
{
// cleanup
removeConnectors
();
}
boost
::
shared_ptr
<
WModule
>
WMConnectomeView
::
factory
()
const
{
return
boost
::
shared_ptr
<
WModule
>
(
new
WMConnectomeView
()
);
}
const
std
::
string
WMConnectomeView
::
getName
()
const
{
return
WModuleContainer
::
getName
();
}
const
std
::
string
WMConnectomeView
::
getDescription
()
const
{
return
WModuleContainer
::
getDescription
();
}
void
WMConnectomeView
::
moduleMain
()
{
// signal ready state
ready
();
waitForStop
();
}
void
WMConnectomeView
::
connectors
()
{
// initialize connectors
m_input
=
boost
::
shared_ptr
<
WModuleInputData
<
WDataSetSingle
>
>
(
new
WModuleInputData
<
WDataSetSingle
>
(
WModule
::
shared_from_this
(),
"in"
,
"Volume Dataset to render directly."
)
);
// 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
WMConnectomeView
::
properties
()
{
}
void
WMConnectomeView
::
slotPropertyChanged
(
std
::
string
/*propertyName*/
)
{
}
src/modules/connectomeView/WMConnectomeView.h
0 → 100644
View file @
15eb58d0
//---------------------------------------------------------------------------
//
// 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 WMCONNECTOMEVIEW_H
#define WMCONNECTOMEVIEW_H
#include <map>
#include <string>
#include <vector>
#include <osg/Node>
#include <osg/Geode>
#include <osg/Uniform>
#include "../../kernel/WModule.h"
#include "../../kernel/WModuleContainer.h"
#include "../../kernel/WModuleInputData.h"
#include "../../dataHandler/WGridRegular3D.h"
/**
* This module is able to visualize connectome data in the context of MRI data. It uses the module container class to allow the
* module to be composed from other modules.
* \ingroup modules
*/
class
WMConnectomeView
:
public
WModuleContainer
{
public:
/**
* Standard constructor.
*/
WMConnectomeView
();
/**
* Destructor.
*/
~
WMConnectomeView
();
/**
* 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
;
/**
* Determine what to do if a property was changed.
* \param propertyName Name of the property.
*/
void
slotPropertyChanged
(
std
::
string
propertyName
);
/**
* 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:
/**
* Input connector.
*/
boost
::
shared_ptr
<
WModuleInputData
<
WDataSetSingle
>
>
m_input
;
/**
* the current dataset
*/
boost
::
shared_ptr
<
const
WDataSetSingle
>
m_dataSet
;
//!< pointer to dataSet to be able to access it throughout the whole module.
};
#endif // WMCONNECTOMEVIEW_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