28 #include "WMReadSphericalHarmonics.h"
29 #include "WMReadSphericalHarmonics.xpm"
30 #include "core/common/WPathHelper.h"
31 #include "core/dataHandler/WDataHandlerEnums.h"
32 #include "core/graphicsEngine/WGERequirement.h"
33 #include "core/kernel/WKernel.h"
34 #include "io/WReaderNIfTI.h"
36 WMReadSphericalHarmonics::WMReadSphericalHarmonics():
41 WMReadSphericalHarmonics::~WMReadSphericalHarmonics()
52 return WMReadSphericalHarmonics_xpm;
57 return "Read Spherical Harmonics";
62 return "This modules loads data from vectors in NIfTI files as SphericalHarmonicsDatasets.";
68 shared_from_this(),
"Spherical Harmonics",
"A loaded spherical harmonics dataset." )
102 std::string fileName =
m_dataFile->get().string();
104 std::shared_ptr< WProgress > progress;
105 progress = std::shared_ptr< WProgress >(
new WProgress(
"Reading ...", 2 ) );
109 std::shared_ptr< WDataSet > data;
110 data = niiLoader.
load( W_DATASET_SPHERICALHARMONICS );
116 m_data = std::dynamic_pointer_cast< WDataSetSphericalHarmonics >( data );
virtual void wait() const
Wait for the condition.
virtual void add(std::shared_ptr< WCondition > condition)
Adds another condition to the set of conditions to wait for.
Class to encapsulate boost::condition_variable_any.
This requirement ensures an up and running WGE.
This module loads spherical harmonics data given as vectors of coefficients from NIfTI files.
virtual std::shared_ptr< WModule > factory() const
Due to the prototype design pattern used to build modules, this method returns a new instance of this...
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
WPropTrigger m_readTriggerProp
This property triggers the actual reading,.
virtual void properties()
Initialize the properties for this module.
virtual void requirements()
Initialize requirements for this module.
virtual const std::string getName() const
Gives back the name of this module.
WPropFilename m_dataFile
The data will be read from this file.
std::shared_ptr< WCondition > m_propCondition
A condition used to notify about changes in several properties.
virtual void moduleMain()
Entry point after loading the module.
virtual const std::string getDescription() const
Gives back a description of this module.
std::shared_ptr< WDataSetSphericalHarmonics > m_data
This triangle mesh is provided as output through the connector.
std::shared_ptr< WModuleOutputData< WDataSetSphericalHarmonics > > m_output
Ouput connector provided by this module.
virtual void connectors()
Initialize the connectors this module is using.
Class offering an instantiate-able data connection between modules.
Class representing a single module of OpenWalnut.
Requirements m_requirements
The list of requirements.
virtual void properties()
Initialize properties in this function.
void addConnector(std::shared_ptr< WModuleInputConnector > con)
Adds the specified connector to the list of inputs.
std::shared_ptr< WProperties > m_properties
The property object for the module.
void ready()
Call this whenever your module is ready and can react on property changes.
WConditionSet m_moduleState
The internal state of the module.
WPropString m_runtimeName
This property holds a user specified name for the current module instance.
std::shared_ptr< WProgressCombiner > m_progress
Progress indicator used as parent for all progress' of this module.
virtual void connectors()
Initialize connectors in this function.
static boost::filesystem::path getAppPath()
The path where the binary file resides in.
Class managing progress inside of modules.
Reader for the NIfTI file format.
virtual std::shared_ptr< WDataSet > load(DataSetType dataSetType=W_DATASET_NONE)
Loads the dataset.
WBoolFlag m_shutdownFlag
Condition getting fired whenever the thread should quit.
@ PV_TRIGGER_READY
Trigger property: is ready to be triggered (again)
void addTo(WPropFilename prop)
Add the PC_PATHEXISTS constraint to the property.
std::vector< std::string > tokenize(const std::string &source, const std::string &delim=WHITESPACE, bool compress=true)
Splits the given string into a vector of strings (so called tokens).