Commit 926372ea authored by Mathias Goldau's avatar Mathias Goldau

[REMOVE] Module fiberStipples, does not need CPU generated geometry for each...

[REMOVE] Module fiberStipples, does not need CPU generated geometry for each slice. Instead it uses now one time generated geometry modified by a linearTranslation Callback, which is damn fast.
parent dcc93f1e
//---------------------------------------------------------------------------
//
// 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 <cmath>
// #include <string>
// #include <vector>
//
// #include <osg/ref_ptr>
//
// #include "core/common/exceptions/WTypeMismatch.h"
// #include "core/common/WLogger.h"
// #include "core/dataHandler/WDataSetScalar.h"
// #include "core/dataHandler/WGridRegular3D.h"
// #include "core/graphicsEngine/WGEGroupNode.h"
// #include "WSPSliceBuilder.h"
//
// WSPSliceBuilder::WSPSliceBuilder( ProbTractList probTracts, WPropGroup sliceGroup, std::vector< WPropGroup > colorMap )
// : m_slicePos( 3 ),
// m_probTracts( probTracts ),
// m_sliceBB( 3 ),
// m_colorMap( colorMap ) // yes this is a COPY of the vector but WPropGroup is a boost::shared_ptr so updates will propagate!
// {
// m_slicePos[2] = sliceGroup->findProperty( "Axial Position" )->toPropDouble();
// m_slicePos[1] = sliceGroup->findProperty( "Coronal Position" )->toPropDouble();
// m_slicePos[0] = sliceGroup->findProperty( "Sagittal Position" )->toPropDouble();
//
// checkAndExtractGrids();
// computeSliceBB(); // just to be sure those are initialized, since they may change due to m_slicePos[0], et al. anyway
// }
//
// WSPSliceBuilder::~WSPSliceBuilder()
// {
// // since we are having virtual member functions we also need a virtual destructor
// }
//
// // helper functions only to be DRY
// namespace
// {
// /**
// * Try a cast to WGridRegular3D, and return the cast result if it was successful, otherwise throw an exception of
// * WTypeMismatched.
// *
// * \param dataset The dataset of which the grid is taken from to check.
// *
// * \return The grid of the dataset casted to WGridRegular3D.
// */
// boost::shared_ptr< const WGridRegular3D > ensureWGridRegular3D( boost::shared_ptr< const WDataSetScalar > dataset )
// {
// boost::shared_ptr< const WGridRegular3D > result = boost::shared_dynamic_cast< WGridRegular3D >( dataset->getGrid() );
// if( !result )
// {
// wlog::error( "WSPSliceBuilder" ) << "Cast to WGridRegular3D failed.";
// throw WTypeMismatch( "WSPSliceBuilder::extractGrid(): WGridRegular3D expected, but cast failed." );
// }
// return result;
// }
// }
//
// void WSPSliceBuilder::checkAndExtractGrids()
// {
// if( m_probTracts.empty() )
// {
// m_grid.reset();
// }
// else
// {
// try
// {
// m_grid = ensureWGridRegular3D( m_probTracts.front() );
//
// for( ProbTractList::const_iterator cit = m_probTracts.begin(); cit != m_probTracts.end(); ++cit )
// {
// boost::shared_ptr< const WGridRegular3D > grid = ensureWGridRegular3D( *cit );
// // TODO(math): ensure that each WGridRegular3D is the same once the operator== is available for WGridRegular3D
// // grid == m_grid
// }
// }
// catch( const WTypeMismatch& e )
// {
// wlog::error( "WSPSliceBuilder" ) << "At least one probabilistic tractogram has a grid which is not castable to WGridRegluar3D";
// throw e;
// }
// }
// }
//
// WColor WSPSliceBuilder::colorMap( size_t probTractNum ) const
// {
// std::string dataSetFileName = m_probTracts[probTractNum]->getFilename();
//
// for( size_t i = 0; i < m_colorMap.size(); ++i )
// {
// std::string colorMapFileName = m_colorMap[i]->findProperty( "Filename" )->toPropString()->get();
// if( colorMapFileName == dataSetFileName )
// {
// return m_colorMap[i]->findProperty( "Color" )->toPropColor()->get();
// }
// }
//
// // keep old behaviour
// return m_colorMap.at( probTractNum )->findProperty( "Color" )->toPropColor()->get();
// }
//
// bool WSPSliceBuilder::alphaBelowThreshold( const WColor& c, const double threshold ) const
// {
// return c[3] < threshold;
// }
//
// WColor WSPSliceBuilder::lookUpColor( const WPosition& pos, size_t tractID ) const
// {
// WColor c = colorMap( tractID );
// bool success = false;
// double probability = m_probTracts.at( tractID )->interpolate( pos, &success );
// if( m_probTracts.at( tractID )->getMax() > 1 )
// {
// probability /= static_cast< double >( m_probTracts.at( tractID )->getMax() );
// }
// if( c[3] != 0.0 )
// {
// // linear mapping
// c[3] = ( success ? probability : -1.0 );
//
// // // sinusiodal mapping
// // double pi2 = 2*3.14159265358979323846;
// // c[3] = ( success ? ( pi2*probability - std::sin(pi2*probability) ) / ( pi2 ) : -1.0 );
//
// // // square root mapping
// // c[3] = ( success ? std::sqrt( probability ) : -1.0 );
// }
//
// return c;
// }
//
// osg::ref_ptr< osg::Vec4Array > WSPSliceBuilder::computeColorsFor( const osg::Vec3& pos ) const
// {
// osg::ref_ptr< osg::Vec4Array > result( new osg::Vec4Array );
// result->reserve( m_probTracts.size() );
//
// // for each probabilisitc tractogram look up if its probability at this vertex is below a certain threshold or not
// for( size_t tractID = 0; tractID < m_probTracts.size(); ++tractID )
// {
// WColor c = lookUpColor( WPosition( pos ), tractID );
// if( c[3] != -1.0 )
// {
// result->push_back( c );
// }
// }
//
// return result;
// }
//
// void WSPSliceBuilder::computeSliceBB()
// {
// if( !m_grid )
// {
// wlog::warn( "WSPSliceBuilder" ) << "Invalid grid while BB computation!";
// return;
// }
// m_sliceBB[0] = WBoundingBox( m_grid->getOrigin() + m_slicePos[0]->get() * m_grid->getDirectionX(),
// m_grid->getOrigin() + m_slicePos[0]->get() * m_grid->getDirectionX() + m_grid->getNbCoordsY() * m_grid->getDirectionY() +
// m_grid->getNbCoordsZ() * m_grid->getDirectionZ() );
// m_sliceBB[1] = WBoundingBox( m_grid->getOrigin() + m_slicePos[1]->get() * m_grid->getDirectionY(),
// m_grid->getOrigin() + m_slicePos[1]->get() * m_grid->getDirectionY() + m_grid->getNbCoordsX() * m_grid->getDirectionX() +
// m_grid->getNbCoordsZ() * m_grid->getDirectionZ() );
// m_sliceBB[2] = WBoundingBox( m_grid->getOrigin() + m_slicePos[2]->get() * m_grid->getDirectionZ(),
// m_grid->getOrigin() + m_slicePos[2]->get() * m_grid->getDirectionZ() + m_grid->getNbCoordsY() * m_grid->getDirectionY() +
// m_grid->getNbCoordsX() * m_grid->getDirectionX() );
// }
//---------------------------------------------------------------------------
//
// 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 WSPSLICEBUILDER_H
#define WSPSLICEBUILDER_H
// #include <vector>
//
// #include <boost/shared_ptr.hpp>
//
// #include <osg/ref_ptr>
//
// #include "core/common/WBoundingBox.h"
// #include "core/common/WProperties.h"
// #include "core/common/WPropertyTypes.h"
//
// // forward declarations
// class WDataSetScalar;
// class WGEGroupNode;
// template< typename T >
// class WGridRegular3DTemplate;
//
// /**
// * This Builder is used to generate views of probabilistic tractograms ala Schmahmann and Pandya.
// */
// class WSPSliceBuilder
// {
// public:
// /**
// * Vector of scalar datasets e.g. probabilistic tractograms.
// */
// typedef std::vector< boost::shared_ptr< const WDataSetScalar > > ProbTractList;
//
// /**
// * Creates a geode builder to build axial, coronal and sagittal slices ala Schahmann y Pandya.
// *
// * \param probTracts The vector of probabilistic tractograms which should be taken into account.
// * \param sliceGroup Slice positions
// * \param colorMap For each connected probabilistic trac its color
// */
// WSPSliceBuilder( ProbTractList probTracts, WPropGroup sliceGroup, std::vector< WPropGroup > colorMap );
//
// /**
// * Destructs this. We need a virtual desturctor as long as we have virtual member functions...
// */
// virtual ~WSPSliceBuilder();
//
// /**
// * Do some preprocessing which is needed for every slice redraw, e.g. when the slice has moved.
// */
// virtual void preprocess() = 0;
//
// /**
// * This generates for each axis a group node with some geodes.
// *
// * \param sliceNum 0 == xSlice, 1 ySlice, 2 zSlice.
// *
// * \return The group of nodes for the given slice.
// */
// virtual osg::ref_ptr< WGEGroupNode > generateSlice( const unsigned char sliceNum ) const = 0;
//
// protected:
// /**
// * Very simple color mapping which is used temporarily, later we want to substitute this with a color chooser as properties.
// *
// * \param probTractNum Index of the probabilisitc tractrogram to get the color for.
// *
// * \return The color for the given prob tract index.
// */
// WColor colorMap( size_t probTractNum ) const;
//
// /**
// * Compares the color's alpha value and the threshold.
// *
// * \param c The given color
// * \param threshold The given Threshold
// *
// * \return ture if the color has an alpha value below the given threshold.
// */
// bool alphaBelowThreshold( const WColor& c, const double threshold ) const;
//
// /**
// * For a certain tractogram the color is looked up in the color map and the alpha value is set to the interpolated
// * probability value.
// *
// * \param pos The position to look up the color and probability.
// * \param tractID For which tract the color should be looked up
// *
// * \return The color of the tract, where the alpha value is either the interpolated tract probability or -1.0 if interpolation has failed.
// */
// WColor lookUpColor( const WPosition& pos, size_t tractID ) const;
//
// /**
// * Compute for each probabilistic tractogram the color at the given pos and sets the alpha value to the interpolated probability.
// *
// * \param pos The position to look up colors and probabilities for.
// *
// * \return The vector of colors.
// */
// osg::ref_ptr< osg::Vec4Array > computeColorsFor( const osg::Vec3& pos ) const;
//
// /**
// * Computes the bouding boxes for the slices.
// *
// * \note Whenever the xPos, yPos or zPos of the slice change those have to be recomputed!
// */
// void computeSliceBB();
//
// /**
// * The grid of the first tractogram. It is assumed that all given probablilisitc tractograms operate on the same grid.
// */
// boost::shared_ptr< const WGridRegular3DTemplate< double > > m_grid;
//
// /**
// * Hold the current position of each slice given from the properties
// */
// std::vector< boost::shared_ptr< const WPVDouble > > m_slicePos;
//
// /**
// * List of probabilisitc tractograms.
// */
// ProbTractList m_probTracts;
//
// /**
// * Axis aligned bounding box for each slice.
// */
// std::vector< WBoundingBox > m_sliceBB;
//
// private:
// /**
// * Ensures that every grid of each probabilistic tractogram is of type WGridRegular3D and that they are all the same.
// *
// * \todo Check that each grid is the same as soon as operator== for WGridRegular3D is available
// * \throw WTypeMismatched when a grid was found which is not castable to WGridRegular3D
// */
// void checkAndExtractGrids();
//
// /**
// * Reference to the color properites.
// */
// std::vector< WPropGroup > m_colorMap;
// };
//
#endif // WSPSLICEBUILDER_H
//---------------------------------------------------------------------------
//
// 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 <list>
// #include <vector>
//
// #include <boost/lambda/bind.hpp>
//
// #include <osg/Geometry>
// #include <osg/LineStipple>
//
// #include "core/common/datastructures/WFiber.h"
// #include "core/common/exceptions/WTypeMismatch.h"
// #include "core/common/math/linearAlgebra/WPosition.h"
// #include "core/common/WLogger.h"
// #include "core/dataHandler/WDataSetFibers.h"
// #include "core/dataHandler/WDataSetScalar.h"
// #include "core/dataHandler/WGridRegular3D.h"
// #include "core/graphicsEngine/WGEGeodeUtils.h"
// #include "core/graphicsEngine/WGEGroupNode.h"
// #include "core/graphicsEngine/WGEManagedGroupNode.h"
// #include "WSPSliceBuilderTracts.h"
//
// WSPSliceBuilderTracts::WSPSliceBuilderTracts( ProbTractList probTracts, WPropGroup sliceGroup, std::vector< WPropGroup > colorMap,
// boost::shared_ptr< const WDataSetFibers > detTracts, WPropGroup tractGroup )
// : WSPSliceBuilder( probTracts, sliceGroup, colorMap ),
// m_detTracts( detTracts ),
// m_intersectionList( 3 )
// {
// if( m_probTracts.empty() || !m_detTracts )
// {
// wlog::warn( "WSPSliceBuilder" ) << "No probabilistic tractograms were given for slice geode generation!";
// }
//
// m_maxDistance = tractGroup->findProperty( "Slices Environment" )->toPropDouble();
// m_probThreshold = tractGroup->findProperty( "Prob Threshold" )->toPropDouble();
// m_showIntersections = tractGroup->findProperty( "Show Intersections" )->toPropBool();
// m_showProjections = tractGroup->findProperty( "Show Projections" )->toPropBool();
//
// // compute BB for each deterministic tract
// m_tractBB.clear();
// m_tractBB.reserve( detTracts->size() );
// for( size_t i = 0; i < detTracts->size(); ++i )
// {
// m_tractBB.push_back( computeBoundingBox( ( *detTracts )[i] ) );
// }
// }
//
// void WSPSliceBuilderTracts::preprocess()
// {
// computeSliceBB();
//
// // tidy up old intersections
// for( unsigned char sliceNum = 0; sliceNum <= 2; ++sliceNum )
// {
// m_intersectionList[ sliceNum ].clear();
// }
//
// for( size_t tract = 0; tract < m_detTracts->getLineStartIndexes()->size() ; ++tract )
// {
// // check each slice
// for( unsigned char sliceNum = 0; sliceNum <= 2; ++sliceNum )
// {
// if( m_sliceBB[ sliceNum ].intersects( m_tractBB[ tract ] ) )
// {
// m_intersectionList[ sliceNum ].push_back( tract );
// }
// }
// }
// }
//
// void WSPSliceBuilderTracts::projectTractOnSlice( const unsigned char sliceNum, osg::ref_ptr< osg::Vec3Array > vertices, const int slicePos ) const
// {
// WAssert( vertices, "Bug: a given internal array was not expected empty here!" );
// WAssert( sliceNum <= 2, "Bug: The selected sliceNum ( 0 == x, 1 == y, 2 == z ) was invalid" );
//
// for( osg::Vec3Array::iterator vertex = vertices->begin(); vertex != vertices->end(); ++vertex )
// {
// ( *vertex )[ sliceNum ] = slicePos;
// }
// }
//
// osg::ref_ptr< osg::Vec4Array > WSPSliceBuilderTracts::colorVertices( osg::ref_ptr< const osg::Vec3Array > vertices ) const
// {
// osg::ref_ptr< osg::Vec4Array > result( new osg::Vec4Array );
// result->reserve( vertices->size() );
//
// for( osg::Vec3Array::const_iterator cit = vertices->begin(); cit != vertices->end(); ++cit )
// {
// osg::ref_ptr< osg::Vec4Array > colors = computeColorsFor( *cit );
//
// // erase those colors where the alpha (aka probability) is below the threshold
// colors->erase( std::remove_if( colors->begin(), colors->end(), boost::bind( &WSPSliceBuilderTracts::alphaBelowThreshold, this, _1,
// m_probThreshold->get() ) ), colors->end() );
//
// // compose all eligible vertices to one color!
// WColor color( 0.0, 0.0, 0.0, 0.0 );
// double share = static_cast< double >( colors->size() );
// if( share > wlimits::DBL_EPS )
// {
// for( osg::Vec4Array::const_iterator vc = colors->begin(); vc != colors->end(); ++vc )
// {
// WAssert( ( *vc )[3] >= m_probThreshold->get(), "Bug: There were colors left, below the given threshold" );
// color += *vc / share;
// }
// }
//
// result->push_back( color );
// }
//
// WAssert( result->size() == vertices->size(), "Bug: There are not as many colors as vertices computed!" );
// return result;
// }
//
// osg::ref_ptr< WGEGroupNode > WSPSliceBuilderTracts::generateSlice( const unsigned char sliceNum ) const
// {
// WAssert( sliceNum <= 2, "Bug: Invalid slice number given: must be 0, 1 or 2." );
// // select slicePos, intersections and bounding box
// const std::list< size_t >& intersections = m_intersectionList[ sliceNum ];
// const WBoundingBox& bb = m_sliceBB[ sliceNum ];
// const int slicePos = m_slicePos[ sliceNum ]->get();
//
// osg::ref_ptr< osg::Geode > intersectionGeode = new osg::Geode;
// osg::ref_ptr< osg::Geode > projectionGeode = new osg::Geode;
// osg::ref_ptr< osg::Vec3Array > vertices = osg::ref_ptr< osg::Vec3Array >( new osg::Vec3Array );
// osg::ref_ptr< osg::Vec4Array > colors = osg::ref_ptr< osg::Vec4Array >( new osg::Vec4Array );
// colors->push_back( osg::Vec4( 1.0, 0.0, 0.0, 1.0 ) );
// osg::ref_ptr< osg::Geometry > geometry = osg::ref_ptr< osg::Geometry >( new osg::Geometry );
//
// osg::ref_ptr< osg::Vec3Array > pv = osg::ref_ptr< osg::Vec3Array >( new osg::Vec3Array );
// osg::ref_ptr< osg::Geometry > pg = osg::ref_ptr< osg::Geometry >( new osg::Geometry );
// osg::ref_ptr< osg::Vec4Array > pc = osg::ref_ptr< osg::Vec4Array >( new osg::Vec4Array );
//
// WDataSetFibers::VertexArray fibVerts = m_detTracts->getVertices();
//
// for( std::list< size_t >::const_iterator cit = intersections.begin(); cit != intersections.end(); ++cit )
// {
// size_t sidx = m_detTracts->getLineStartIndexes()->at( *cit ) * 3;
// size_t len = m_detTracts->getLineLengths()->at( *cit );
// size_t k = 0;
// while( k < len )
// {
// size_t startIdx = vertices->size();
// // proceed to a vertex inside the deltaX environment
// while( ( k < len ) && std::abs( slicePos - fibVerts->at( ( 3 * k ) + sidx + sliceNum ) ) > m_maxDistance->get() )
// {
// k++;
// }
// osg::ref_ptr< osg::Vec3Array > candidate = osg::ref_ptr< osg::Vec3Array >( new osg::Vec3Array );
// WBoundingBox cBB;
// while( ( k < len ) && std::abs( slicePos - fibVerts->at( ( 3 * k ) + sidx + sliceNum ) ) <= m_maxDistance->get() )
// {
// WPosition cv( fibVerts->at( ( 3 * k ) + sidx ),
// fibVerts->at( ( 3 * k ) + sidx + 1 ),
// fibVerts->at( ( 3 * k ) + sidx + 2 ) );
// candidate->push_back( cv );
// cBB.expandBy( cv );
// k++;
// }
// if( !candidate->empty() && cBB.intersects( bb ) )
// {
// vertices->insert( vertices->end(), candidate->begin(), candidate->end() );
// geometry->addPrimitiveSet( new osg::DrawArrays( osg::PrimitiveSet::LINE_STRIP, startIdx, candidate->size() ) );
// osg::ref_ptr< osg::Vec4Array > candidateColors = colorVertices( candidate );
// pc->insert( pc->end(), candidateColors->begin(), candidateColors->end() );
// projectTractOnSlice( sliceNum, candidate, slicePos );
// pv->insert( pv->end(), candidate->begin(), candidate->end() );
// pg->addPrimitiveSet( new osg::DrawArrays( osg::PrimitiveSet::LINE_STRIP, startIdx, candidate->size() ) );
// }
// // note: this loop will terminate since either the first while loop is true or the second or both!
// }
// }
// pg->setVertexArray( pv );
// pg->setColorArray( pc );
// pg->setColorBinding( osg::Geometry::BIND_PER_VERTEX );
//
// geometry->setVertexArray( vertices );
// geometry->setColorArray( colors );
// geometry->setColorBinding( osg::Geometry::BIND_OVERALL );
//
// intersectionGeode->addDrawable( geometry );
// intersectionGeode->addDrawable( wge::generateBoundingBoxGeode( bb, WColor( 0.0, 0.0, 0.0, 1.0 ) )->getDrawable( 0 ) );
// projectionGeode->addDrawable( pg );
// projectionGeode->addDrawable( wge::generateBoundingBoxGeode( bb, WColor( 0.0, 0.0, 0.0, 1.0 ) )->getDrawable( 0 ) );
//
// osg::StateSet* state = projectionGeode->getOrCreateStateSet();
// // transparent colors are really transparent and not black
// state->setMode( GL_BLEND, osg::StateAttribute::ON );
// // transparent colors are rendered at last, so not use the background color but the color of the nav slices
// state->setRenderingHint( osg::StateSet::TRANSPARENT_BIN );
//
// osg::ref_ptr<osg::LineStipple> ls = new osg::LineStipple();
// ls->setPattern( 0x00FF );
// ls->setFactor( 2 );
//
// state->setAttributeAndModes( ls.get(), osg::StateAttribute::ON );
// osg::ref_ptr< WGEManagedGroupNode > intersectionGroup = new WGEManagedGroupNode( m_showIntersections );
// intersectionGroup->insert( intersectionGeode );
// osg::ref_ptr< WGEManagedGroupNode > projectionGroup = new WGEManagedGroupNode( m_showProjections );
// projectionGroup->insert( projectionGeode );
// osg::ref_ptr< WGEGroupNode > result = new WGEGroupNode();
// result->clear();
// result->insert( intersectionGroup );
// result->insert( projectionGroup );
// return result;
// }
//---------------------------------------------------------------------------
//
// 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 WSPSLICEBUILDERTRACTS_H
#define WSPSLICEBUILDERTRACTS_H
// #include <list>
// #include <utility>
// #include <vector>
//
// #include <boost/shared_ptr.hpp>
//
// #include <osg/Geode>
//
// #include "core/common/WBoundingBox.h"
// #include "core/common/WProperties.h"
// #include "core/common/WPropertyTypes.h"
// #include "WSPSliceBuilder.h"
//
// class WDataSetFibers;
//
// /**
// * This Builder is used to generate views of probabilistic tractograms ala Schmahmann and Pandya. After creating a builder instance
// * you must calculate the intersections (with preprocess) again and again whenever a slice has moved.
// */
// class WSPSliceBuilderTracts : public WSPSliceBuilder
// {
// public:
// /**
// * Creates a geode builder to build axial, coronal and sagittal slices ala Schahmann y Pandya. After this initialization,
// * the user needs still to call the \ref preprocess() member function in order to get right results.
// *
// * \param probTracts The list of probabilistic tractograms which should be taken into account.
// * \param sliceGroup Slice positions
// * \param colorMap For each connected probabilistic trac its color
// * \param detTracts The deterministic fibers which are used to show the probabilistic tracts.
// * \param tractGroup The properties for visualization for the deterministic tract method
// */
// WSPSliceBuilderTracts( ProbTractList probTracts, WPropGroup sliceGroup, std::vector< WPropGroup > colorMap,
// boost::shared_ptr< const WDataSetFibers > detTracts, WPropGroup tractGroup );
//
// /**
// * Implements the preprocessing interface \ref WSPSliceBuilder.
// * For each slice compute the deterministic trac indices which are intersecting with it.
// */
// void preprocess();
//