Commit 4d6dff4d authored by Mathias Goldau's avatar Mathias Goldau

[CHANGE] Renamed connector names and variables to a standard scheme

parent 1cf3269d
......@@ -54,8 +54,8 @@ const char** WMClusterParamDisplay::getXPMIcon() const
void WMClusterParamDisplay::connectors()
{
m_fibers = WModuleInputForwardData< WDataSetFibers >::createAndAdd( shared_from_this(), "fiberInput", "DataSetFibers to cluster and display" );
m_paramDS = WModuleInputForwardData< WDataSetScalar >::createAndAdd( shared_from_this(), "paramInput", "Parameter Dataset such as FA" );
m_fiberIC = WModuleInputForwardData< WDataSetFibers >::createAndAdd( shared_from_this(), "fiberInput", "DataSetFibers to cluster and display" );
m_paramIC = WModuleInputForwardData< WDataSetScalar >::createAndAdd( shared_from_this(), "paramInput", "Parameter Dataset such as FA" );
WModule::connectors();
}
......@@ -147,7 +147,7 @@ void WMClusterParamDisplay::initSubModules()
// wiring
debugLog() << "Start wiring";
m_paramDS->forward( m_clusterSlicer->getInputConnector( "paramInput" ) );
m_paramIC->forward( m_clusterSlicer->getInputConnector( "paramInput" ) );
m_gaussFiltering->getInputConnector( "in" )->connect( m_voxelizer->getOutputConnector( "voxelOutput" ) );
m_isoSurface->getInputConnector( "values" )->connect( m_gaussFiltering->getOutputConnector( "out" ) );
......@@ -158,7 +158,7 @@ void WMClusterParamDisplay::initSubModules()
m_meshRenderer->getInputConnector( "colorMap" )->connect( m_clusterSlicer->getOutputConnector( "colorMapOutput" ) );
m_voxelizer->getInputConnector( "tractInput" )->connect( m_detTractClustering->getOutputConnector( "clusterOutput" ) );
m_fibers->forward( m_detTractClustering->getInputConnector( "tractInput" ) ); // init rippling
m_fiberIC->forward( m_detTractClustering->getInputConnector( "tractInput" ) ); // init rippling
debugLog() << "Wiring done";
// forward properties
......
......@@ -101,18 +101,56 @@ protected:
virtual void initSubModules();
private:
boost::shared_ptr< WModuleInputForwardData< WDataSetFibers > > m_fibers; //!< Input connector required by this module.
boost::shared_ptr< WModuleInputForwardData< WDataSetScalar > > m_paramDS; //!< Input connector for the parameter dataset
boost::shared_ptr< WModule > m_detTractClustering; //!< Submodule doing clustering of the fibers and center line generation
boost::shared_ptr< WModule > m_voxelizer; //!< Submodule doing voxelization of a cluster
boost::shared_ptr< WModule > m_gaussFiltering; //!< Submodule blurring the generated voxelized dataset
boost::shared_ptr< WModule > m_isoSurface; //!< Selects the appropriate isovalue
boost::shared_ptr< WModule > m_clusterSlicer; //!< Module slicing the cluster volume
boost::shared_ptr< WModule > m_meshRenderer; //!< Renders the triangle Mesh with a certain color
WPropDouble m_isoValue; //!< Isovalue for selecting the volume
WPropBool m_drawIsoSurface; //!< En/Disable the display of the isosurface
/**
* Input connector required by this module.
*/
boost::shared_ptr< WModuleInputForwardData< WDataSetFibers > > m_fiberIC;
/**
* Input connector for the parameter dataset
*/
boost::shared_ptr< WModuleInputForwardData< WDataSetScalar > > m_paramIC;
/**
* Submodule doing clustering of the fibers and center line generation
*/
boost::shared_ptr< WModule > m_detTractClustering;
/**
* Submodule doing voxelization of a cluster
*/
boost::shared_ptr< WModule > m_voxelizer;
/**
* Submodule blurring the generated voxelized dataset
*/
boost::shared_ptr< WModule > m_gaussFiltering;
/**
* Selects the appropriate isovalue
*/
boost::shared_ptr< WModule > m_isoSurface;
/**
* Module slicing the cluster volume
*/
boost::shared_ptr< WModule > m_clusterSlicer;
/**
* Renders the triangle Mesh with a certain color
*/
boost::shared_ptr< WModule > m_meshRenderer;
/**
* Isovalue for selecting the volume
*/
WPropDouble m_isoValue;
/**
* En/Disable the display of the isosurface
*/
WPropBool m_drawIsoSurface;
};
#endif // WMCLUSTERPARAMDISPLAY_H
......
......@@ -88,12 +88,12 @@ const std::string WMClusterSlicer::getDescription() const
void WMClusterSlicer::connectors()
{
m_fiberClusterInput = WModuleInputData< WFiberCluster >::createAndAdd( shared_from_this(), "clusterInput", "A cluster of fibers" );
m_clusterDataSetInput = WModuleInputData< WDataSetScalar >::createAndAdd( shared_from_this(), "clusterDSInput", "DataSet from cluster" );
m_paramDataSetInput = WModuleInputData< WDataSetScalar >::createAndAdd( shared_from_this(), "paramInput", "DataSet of the parameters" );
m_triangleMeshInput = WModuleInputData< WTriangleMesh >::createAndAdd( shared_from_this(), "meshInput", "TrianglMesh" );
m_colorMapOutput = WModuleOutputData< WColoredVertices >::createAndAdd( shared_from_this(), "colorMapOutput", "VertexID and colors" );
m_meshOutput = WModuleOutputData< WTriangleMesh >::createAndAdd( shared_from_this(), "meshOutput", "The Mesh to forward it for rendering" );
m_fiberClusterIC = WModuleInputData< WFiberCluster >::createAndAdd( shared_from_this(), "clusterInput", "A cluster of fibers" );
m_voxelizedClusterIC = WModuleInputData< WDataSetScalar >::createAndAdd( shared_from_this(), "clusterDSInput", "DataSet from cluster" );
m_paramIC = WModuleInputData< WDataSetScalar >::createAndAdd( shared_from_this(), "paramInput", "DataSet of the parameters" );
m_triangleMeshIC = WModuleInputData< WTriangleMesh >::createAndAdd( shared_from_this(), "meshInput", "TrianglMesh" );
m_colorMapOC = WModuleOutputData< WColoredVertices >::createAndAdd( shared_from_this(), "colorMapOutput", "VertexID and colors" );
m_triangleMeshOC = WModuleOutputData< WTriangleMesh >::createAndAdd( shared_from_this(), "meshOutput", "The Mesh to forward it for rendering" );
WModule::connectors();
}
......@@ -138,8 +138,8 @@ void WMClusterSlicer::moduleMain()
WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->insert( m_rootNode );
m_moduleState.setResetable( true, true );
m_moduleState.add( m_paramDataSetInput->getDataChangedCondition() );
m_moduleState.add( m_triangleMeshInput->getDataChangedCondition() );
m_moduleState.add( m_paramIC->getDataChangedCondition() );
m_moduleState.add( m_triangleMeshIC->getDataChangedCondition() );
m_moduleState.add( m_drawSlices->getCondition() );
m_moduleState.add( m_drawIsoVoxels->getCondition() );
m_moduleState.add( m_fullUpdate );
......@@ -157,10 +157,10 @@ void WMClusterSlicer::moduleMain()
break;
}
boost::shared_ptr< WDataSetScalar > newClusterDS = m_clusterDataSetInput->getData();
boost::shared_ptr< WFiberCluster > newCluster = m_fiberClusterInput->getData();
boost::shared_ptr< WDataSetScalar > newParamDS = m_paramDataSetInput->getData();
boost::shared_ptr< WTriangleMesh > newMesh = m_triangleMeshInput->getData();
boost::shared_ptr< WDataSetScalar > newClusterDS = m_voxelizedClusterIC->getData();
boost::shared_ptr< WFiberCluster > newCluster = m_fiberClusterIC->getData();
boost::shared_ptr< WDataSetScalar > newParamDS = m_paramIC->getData();
boost::shared_ptr< WTriangleMesh > newMesh = m_triangleMeshIC->getData();
bool meshChanged = ( m_mesh != newMesh );
bool paramDSChanged = ( m_paramDS != newParamDS );
bool clusterChanged = ( m_cluster != newCluster );
......@@ -381,9 +381,9 @@ void WMClusterSlicer::sliceAndColorMesh( boost::shared_ptr< WTriangleMesh > mesh
debugLog() << "Mesh selected";
if( renderMesh != m_meshOutput->getData() )
if( renderMesh != m_triangleMeshOC->getData() )
{
m_meshOutput->updateData( renderMesh );
m_triangleMeshOC->updateData( renderMesh );
}
debugLog() << "Building mesh color map...";
......@@ -439,7 +439,7 @@ void WMClusterSlicer::sliceAndColorMesh( boost::shared_ptr< WTriangleMesh > mesh
m_colorMap->setData( cmData );
debugLog() << "Done with color map building";
m_colorMapOutput->updateData( m_colorMap );
m_colorMapOC->updateData( m_colorMap );
}
double WMClusterSlicer::mapMeanOntoScale( double meanValue ) const
......
......@@ -165,54 +165,191 @@ protected:
*/
double computeOptimalIsoValue( double coverage = 0.95 ) const;
osg::ref_ptr< WGEGroupNode > m_rootNode; //!< The root node used for this modules graphics.
osg::ref_ptr< osg::Geode > m_isoVoxelGeode; //!< Separate geode for voxels of the cluster volume
osg::ref_ptr< WGEGroupNode > m_sliceGeode; //!< Separate geode for slices
osg::ref_ptr< WGEGroupNode > m_samplePointsGeode; //!< Separate geode for the sample Points
typedef WModuleInputData< WFiberCluster > InputClusterType; //!< Internal alias for m_cluster type
boost::shared_ptr< InputClusterType > m_fiberClusterInput; //!< InputConnector for a fiber cluster with its CenterLine
typedef WModuleInputData< WDataSetScalar > InputDataSetType; //!< Internal alias for m_*DataSets types
boost::shared_ptr< InputDataSetType > m_clusterDataSetInput; //!< InputConnector for the dataset derived from a voxelized cluster
boost::shared_ptr< InputDataSetType > m_paramDataSetInput; //!< InputConnector for the dataset of parameters like FA etc.
typedef WModuleInputData< WTriangleMesh > InputMeshType; //!< Internal alias for the m_triangleMesh type
boost::shared_ptr< InputMeshType > m_triangleMeshInput; //!< InputConnector for the triangle mesh
typedef WModuleOutputData< WColoredVertices > OutputColorMapType; //!< Interal alias for the ColorMap Type
boost::shared_ptr< OutputColorMapType > m_colorMapOutput; //!< OutputConnector to forward the color Map to TriangleMeshRenderer
typedef WModuleOutputData< WTriangleMesh > OutputMeshType; //!< Internal alias for the Mesh Type
boost::shared_ptr< OutputMeshType > m_meshOutput; //!< OutputConnector to forwarde the selected Mesh (e.g. if component selection is enabled )
boost::shared_ptr< WFiberCluster > m_cluster; //!< A cluster with its CenterLine
boost::shared_ptr< WDataSetScalar > m_clusterDS; //!< Dataset derived from a voxelized cluster
boost::shared_ptr< WDataSetScalar > m_paramDS; //!< Dataset derived from a voxelized cluster
boost::shared_ptr< std::vector< std::pair< double, WPlane > > > m_slices; //!< stores all planes and their average parameters along centerLine
boost::shared_ptr< WTriangleMesh > m_mesh; //!< Reference to the TriangleMesh to make intersections
boost::shared_ptr< WColoredVertices > m_colorMap; //!< Stores the color for vertices belonging to the intersection with the mesh and the planes
boost::shared_ptr< WJoinContourTree > m_joinTree; //!< Stores the JoinTree
boost::shared_ptr< std::set< size_t > > m_isoVoxels; //!< Stores the voxels belonging to the cluster volume of a certain iso value
boost::shared_ptr< std::list< boost::shared_ptr< WTriangleMesh > > > m_components; //!< Mesh decomposed into connected components
boost::shared_ptr< WCondition > m_fullUpdate; //!< Indicates a complete update of display and computed data (time consuming)
WPropBool m_drawIsoVoxels; //!< En/Disable the display of cluster volume voxels
WPropBool m_drawSlices; //!< En/Disable the display of slices along center line
WPropDouble m_isoValue; //!< The isovalue selecting the size of the cluster volume
WPropInt m_meanSelector; //!< Selects the mean: 0 == arithmeticMean, 1 == geometricMean, 2 == median (default)
WPropInt m_planeNumX; //!< how many sample points in first direction of the slice
WPropInt m_planeNumY; //!< how many sample points in the second direction of the slice
WPropDouble m_planeStepWidth; //!< distance of the sample points on the slices
WPropDouble m_centerLineScale; //!< rescales the centerline for using more or less slices.
WPropBool m_selectBiggestComponentOnly; //!< If true, first the mesh is decomposed into its components (expensive!) & the biggest will be drawn
WPropBool m_alternateColoring; //!< En/Disables alternative mesh coloring strategy
WPropBool m_customScale; //!< En/Disables custom color scaling
WPropDouble m_minScale; //!< A synthetic minMean value. All mean values below are mapped to 0
WPropColor m_minScaleColor; //!< color used for minMean
WPropDouble m_maxScale; //!< A synthetic maxMean value. All mean value above are mapped to 1
WPropColor m_maxScaleColor; //!< color used for maxMean
double m_maxMean; //!< maximum average (of sample points of a plane) parameter value over all planes
double m_minMean; //!< minimum average (of sample points of a plane) parameter value over all planes
/**
* The root node used for this modules graphics.
*/
osg::ref_ptr< WGEGroupNode > m_rootNode;
/**
* Separate geode for voxels of the cluster volume
*/
osg::ref_ptr< osg::Geode > m_isoVoxelGeode;
/**
* Separate geode for slices
*/
osg::ref_ptr< WGEGroupNode > m_sliceGeode;
/**
* Separate geode for the sample Points
*/
osg::ref_ptr< WGEGroupNode > m_samplePointsGeode;
/**
* InputConnector for a fiber cluster with its CenterLine
*/
boost::shared_ptr< WModuleInputData< WFiberCluster > > m_fiberClusterIC;
/**
* InputConnector for the dataset derived from a voxelized cluster
*/
boost::shared_ptr< WModuleInputData< WDataSetScalar > > m_voxelizedClusterIC;
/**
* InputConnector for the dataset of parameters like FA etc.
*/
boost::shared_ptr< WModuleInputData< WDataSetScalar > > m_paramIC;
/**
* InputConnector for the triangle mesh
*/
boost::shared_ptr< WModuleInputData< WTriangleMesh > > m_triangleMeshIC;
/**
* OutputConnector to forward the color Map to TriangleMeshRenderer
*/
boost::shared_ptr< WModuleOutputData< WColoredVertices > > m_colorMapOC;
/**
* OutputConnector to forwarde the selected Mesh (e.g. if component selection is enabled )
*/
boost::shared_ptr< WModuleOutputData< WTriangleMesh > > m_triangleMeshOC;
/**
* A cluster with its CenterLine
*/
boost::shared_ptr< WFiberCluster > m_cluster;
/**
* Dataset derived from a voxelized cluster
*/
boost::shared_ptr< WDataSetScalar > m_clusterDS;
/**
* Dataset derived from a voxelized cluster
*/
boost::shared_ptr< WDataSetScalar > m_paramDS;
/**
* stores all planes and their average parameters along centerLine
*/
boost::shared_ptr< std::vector< std::pair< double, WPlane > > > m_slices;
/**
* Reference to the TriangleMesh to make intersections
*/
boost::shared_ptr< WTriangleMesh > m_mesh;
/**
* Stores the color for vertices belonging to the intersection with the mesh and the planes
*/
boost::shared_ptr< WColoredVertices > m_colorMap;
/**
* Stores the JoinTree
*/
boost::shared_ptr< WJoinContourTree > m_joinTree;
/**
* Stores the voxels belonging to the cluster volume of a certain iso value
*/
boost::shared_ptr< std::set< size_t > > m_isoVoxels;
/**
* Mesh decomposed into connected components
*/
boost::shared_ptr< std::list< boost::shared_ptr< WTriangleMesh > > > m_components;
/**
* Indicates a complete update of display and computed data (time consuming)
*/
boost::shared_ptr< WCondition > m_fullUpdate;
/**
* En/Disable the display of cluster volume voxels
*/
WPropBool m_drawIsoVoxels;
/**
* En/Disable the display of slices along center line
*/
WPropBool m_drawSlices;
/**
* The isovalue selecting the size of the cluster volume
*/
WPropDouble m_isoValue;
/**
* Selects the mean: 0 == arithmeticMean, 1 == geometricMean, 2 == median (default)
*/
WPropInt m_meanSelector;
/**
* how many sample points in first direction of the slice
*/
WPropInt m_planeNumX;
/**
* how many sample points in the second direction of the slice
*/
WPropInt m_planeNumY;
/**
* distance of the sample points on the slices
*/
WPropDouble m_planeStepWidth;
/**
* rescales the centerline for using more or less slices.
*/
WPropDouble m_centerLineScale;
/**
* If true, first the mesh is decomposed into its components (expensive!) & the biggest will be drawn
*/
WPropBool m_selectBiggestComponentOnly;
/**
* En/Disables alternative mesh coloring strategy
*/
WPropBool m_alternateColoring;
/**
* En/Disables custom color scaling
*/
WPropBool m_customScale;
/**
* A synthetic minMean value. All mean values below are mapped to 0
*/
WPropDouble m_minScale;
/**
* color used for minMean
*/
WPropColor m_minScaleColor;
/**
* A synthetic maxMean value. All mean value above are mapped to 1
*/
WPropDouble m_maxScale;
/**
* color used for maxMean
*/
WPropColor m_maxScaleColor;
/**
* maximum average (of sample points of a plane) parameter value over all planes
*/
double m_maxMean;
/**
* minimum average (of sample points of a plane) parameter value over all planes
*/
double m_minMean;
private:
/**
* A pair of plane indices. Just for convinience.
......
......@@ -83,7 +83,7 @@ const char** WMVoxelizer::getXPMIcon() const
void WMVoxelizer::moduleMain()
{
m_moduleState.setResetable();
m_moduleState.add( m_input->getDataChangedCondition() ); // additional fire-condition: "data changed" flag
m_moduleState.add( m_clusterIC->getDataChangedCondition() ); // additional fire-condition: "data changed" flag
m_moduleState.add( m_fullUpdate );
m_rootNode = new WGEManagedGroupNode( m_active );
......@@ -94,14 +94,14 @@ void WMVoxelizer::moduleMain()
while( !m_shutdownFlag() ) // loop until the module container requests the module to quit
{
if( !m_input->getData() ) // ok, the output has not yet sent data
if( !m_clusterIC->getData() ) // ok, the output has not yet sent data
{
// since there is no data yet we will eat property changes
m_rasterAlgo->get( true );
m_antialiased->get( true );
continue;
}
if( m_input->getData()->size() == 0 )
if( m_clusterIC->getData()->size() == 0 )
{
infoLog() << "Got empty fiber dataset. Ignoring.";
m_moduleState.wait();
......@@ -114,11 +114,11 @@ void WMVoxelizer::moduleMain()
++*progress;
// full update
if( m_antialiased->changed() || m_rasterAlgo->changed() || m_voxelsPerUnit->changed() ||
m_clusters != m_input->getData() || m_parameterAlgo->changed() )
m_clusters != m_clusterIC->getData() || m_parameterAlgo->changed() )
{
m_rasterAlgo->get( true );
m_antialiased->get( true );
m_clusters = m_input->getData();
m_clusters = m_clusterIC->getData();
update();
}
......@@ -242,11 +242,11 @@ void WMVoxelizer::update()
// update both outputs
boost::shared_ptr< WDataSetScalar > outputDataSet = rasterAlgo->generateDataSet();
m_output->updateData( outputDataSet );
m_voxelizedOC->updateData( outputDataSet );
if( paramAlgo )
{
boost::shared_ptr< WDataSetScalar > outputDataSetIntegration = paramAlgo->getDataSet();
m_parameterizationOutput->updateData( outputDataSetIntegration );
m_paramOC->updateData( outputDataSetIntegration );
}
m_rootNode->clear();
......@@ -275,10 +275,9 @@ void WMVoxelizer::raster( boost::shared_ptr< WRasterAlgorithm > algo ) const
void WMVoxelizer::connectors()
{
m_input = WModuleInputData< const WFiberCluster >::createAndAdd( shared_from_this(), "tractInput", "A cluster of tracts" );
m_output = WModuleOutputData< WDataSetScalar >::createAndAdd( shared_from_this(), "voxelOutput", "The voxelized data set" );
m_parameterizationOutput = WModuleOutputData< WDataSetScalar >::createAndAdd( shared_from_this(),
"parameterizationOutput",
m_clusterIC = WModuleInputData< const WFiberCluster >::createAndAdd( shared_from_this(), "tractInput", "A cluster of tracts" );
m_voxelizedOC = WModuleOutputData< WDataSetScalar >::createAndAdd( shared_from_this(), "voxelOutput", "The voxelized data set" );
m_paramOC = WModuleOutputData< WDataSetScalar >::createAndAdd( shared_from_this(), "parameterizationOutput",
"The parameter field for the voxelized fibers." );
WModule::connectors(); // call WModules initialization
}
......
......@@ -155,23 +155,18 @@ private:
/**
* Input connector for a fiber cluster
*/
boost::shared_ptr< WModuleInputData< const WFiberCluster > > m_input;
boost::shared_ptr< WModuleInputData< const WFiberCluster > > m_clusterIC;
/**
* Output connector for a voxelized cluster
*/
boost::shared_ptr< WModuleOutputData< WDataSetScalar > > m_output;
/**
* Output connector for a voxelized cluster (the fiber directions)
*/
boost::shared_ptr< WModuleOutputData< WDataSetScalar > > m_dirOutput;
boost::shared_ptr< WModuleOutputData< WDataSetScalar > > m_voxelizedOC;
/**
* Output providing parameterization to other algorithms. It provides a scalar field which gets filled with the parameterization of the
* fibers, i.e. current integrated length.
*/
boost::shared_ptr< WModuleOutputData< WDataSetScalar > > m_parameterizationOutput;
boost::shared_ptr< WModuleOutputData< WDataSetScalar > > m_paramOC;
/**
* Reference to the fiber cluster
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment