diff --git a/Documentation/Doxygen/UserManual/MITKModuleManualsList.dox b/Documentation/Doxygen/UserManual/MITKModuleManualsList.dox index e00a75aeee..81677a5fea 100644 --- a/Documentation/Doxygen/UserManual/MITKModuleManualsList.dox +++ b/Documentation/Doxygen/UserManual/MITKModuleManualsList.dox @@ -1,18 +1,19 @@ /** \page MITKModuleManualsListPage MITK Module Manuals \section MITKModuleManualsListPageOverview Overview The modules are shared libraries that provide functionality that can be used by developers. \section MITKModuleManualsListPageModuleManualList List of Module Manuals \li \subpage IGTGeneralModulePage \li \subpage MitkOpenCL_Overview \section MITKModuleManualsListPageAdditionalInformation Additional Information on Certain Modules \li \ref PlanarPropertiesPage \li \subpage DiffusionImagingPropertiesPage + \li \subpage ConnectomicsRenderingPropertiesPage */ diff --git a/Modules/DiffusionImaging/Documentation/doxygen/ConnectomicsRenderingProperties.dox b/Modules/DiffusionImaging/Documentation/doxygen/ConnectomicsRenderingProperties.dox new file mode 100644 index 0000000000..d39c849f01 --- /dev/null +++ b/Modules/DiffusionImaging/Documentation/doxygen/ConnectomicsRenderingProperties.dox @@ -0,0 +1,5 @@ +/** +\page ConnectomicsRenderingPropertiesPage Connectomics Rendering Properties + +The MITK connectomics module offers several different ways of visualizing connectomics network information. The corresponding properties are documented in \ref mitkConnectomicsRenderingProperties.h . +*/ \ No newline at end of file diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetwork.cpp b/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetwork.cpp index 4b6ccc0523..6150e1beca 100644 --- a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetwork.cpp +++ b/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetwork.cpp @@ -1,587 +1,689 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkConnectomicsNetwork.h" #include +#include /* Constructor and Destructor */ mitk::ConnectomicsNetwork::ConnectomicsNetwork() : m_IsModified( false ) { } mitk::ConnectomicsNetwork::~ConnectomicsNetwork() { } /* Wrapper methods */ bool mitk::ConnectomicsNetwork::EdgeExists( mitk::ConnectomicsNetwork::VertexDescriptorType vertexA, mitk::ConnectomicsNetwork::VertexDescriptorType vertexB ) const { return boost::edge(vertexA, vertexB, m_Network ).second; } void mitk::ConnectomicsNetwork::IncreaseEdgeWeight( mitk::ConnectomicsNetwork::VertexDescriptorType vertexA, mitk::ConnectomicsNetwork::VertexDescriptorType vertexB ) { m_Network[ boost::edge(vertexA, vertexB, m_Network ).first ].weight++; SetIsModified( true ); } void mitk::ConnectomicsNetwork::AddEdge( mitk::ConnectomicsNetwork::VertexDescriptorType vertexA, mitk::ConnectomicsNetwork::VertexDescriptorType vertexB ) { AddEdge(vertexA, vertexB, m_Network[ vertexA ].id, m_Network[ vertexB ].id ); } void mitk::ConnectomicsNetwork::AddEdge( mitk::ConnectomicsNetwork::VertexDescriptorType vertexA, mitk::ConnectomicsNetwork::VertexDescriptorType vertexB, int sourceID, int targetID, int weight ) { boost::add_edge( vertexA, vertexB, m_Network ); m_Network[ boost::edge(vertexA, vertexB, m_Network ).first ].sourceId = sourceID; m_Network[ boost::edge(vertexA, vertexB, m_Network ).first ].targetId = targetID; m_Network[ boost::edge(vertexA, vertexB, m_Network ).first ].weight = weight; m_Network[ boost::edge(vertexA, vertexB, m_Network ).first ].edge_weight = 1.0; SetIsModified( true ); } mitk::ConnectomicsNetwork::VertexDescriptorType mitk::ConnectomicsNetwork::AddVertex( int id ) { VertexDescriptorType vertex = boost::add_vertex( m_Network ); m_Network[vertex].id = id; SetIsModified( true ); return vertex; } void mitk::ConnectomicsNetwork::SetLabel( mitk::ConnectomicsNetwork::VertexDescriptorType vertex, std::string inLabel ) { m_Network[vertex].label = inLabel; SetIsModified( true ); } void mitk::ConnectomicsNetwork::SetCoordinates( mitk::ConnectomicsNetwork::VertexDescriptorType vertex, std::vector< float > inCoordinates ) { m_Network[vertex].coordinates = inCoordinates; SetIsModified( true ); } void mitk::ConnectomicsNetwork::clear() { m_Network.clear(); SetIsModified( true ); } /* Superclass methods, that need to be implemented */ void mitk::ConnectomicsNetwork::UpdateOutputInformation() { } void mitk::ConnectomicsNetwork::SetRequestedRegionToLargestPossibleRegion() { } bool mitk::ConnectomicsNetwork::RequestedRegionIsOutsideOfTheBufferedRegion() { return false; } bool mitk::ConnectomicsNetwork::VerifyRequestedRegion() { return true; } void mitk::ConnectomicsNetwork::SetRequestedRegion( itk::DataObject *data ) { } std::vector< mitk::ConnectomicsNetwork::NetworkNode > mitk::ConnectomicsNetwork::GetVectorOfAllNodes() const { boost::graph_traits::vertex_iterator iterator, end; // sets iterator to start end end to end boost::tie(iterator, end) = boost::vertices( m_Network ); std::vector< NetworkNode > vectorOfNodes; for ( ; iterator != end; ++iterator) { NetworkNode tempNode; // the value of an iterator is a descriptor tempNode = m_Network[ *iterator ]; vectorOfNodes.push_back( tempNode ); } return vectorOfNodes; } std::vector< mitk::ConnectomicsNetwork::VertexDescriptorType > mitk::ConnectomicsNetwork::GetVectorOfAllVertexDescriptors() const { boost::graph_traits::vertex_iterator iterator, end; // sets iterator to start end end to end boost::tie(iterator, end) = boost::vertices( m_Network ); std::vector< VertexDescriptorType > vectorOfDescriptors; for ( ; iterator != end; ++iterator) { vectorOfDescriptors.push_back( *iterator ); } return vectorOfDescriptors; } std::vector< std::pair< std::pair< mitk::ConnectomicsNetwork::NetworkNode, mitk::ConnectomicsNetwork::NetworkNode > , mitk::ConnectomicsNetwork::NetworkEdge > > mitk::ConnectomicsNetwork::GetVectorOfAllEdges() const { boost::graph_traits::edge_iterator iterator, end; // sets iterator to start end end to end boost::tie(iterator, end) = boost::edges( m_Network ); std::vector< std::pair< std::pair< NetworkNode, NetworkNode > , NetworkEdge > > vectorOfEdges; for ( ; iterator != end; ++iterator) { NetworkNode sourceNode, targetNode; NetworkEdge tempEdge; // the value of an iterator is a descriptor tempEdge = m_Network[ *iterator ]; sourceNode = m_Network[ boost::source( *iterator, m_Network ) ]; targetNode = m_Network[ boost::target( *iterator, m_Network ) ]; std::pair< NetworkNode, NetworkNode > nodePair( sourceNode, targetNode ); std::pair< std::pair< NetworkNode, NetworkNode > , NetworkEdge > edgePair( nodePair, tempEdge); vectorOfEdges.push_back( edgePair ); } return vectorOfEdges; } int mitk::ConnectomicsNetwork::GetNumberOfVertices() const { return boost::num_vertices( m_Network ); } -int mitk::ConnectomicsNetwork::GetNumberOfEdges() +int mitk::ConnectomicsNetwork::GetNumberOfEdges() const { return boost::num_edges( m_Network ); } int mitk::ConnectomicsNetwork::GetMaximumWeight() const { int maxWeight( 0 ); boost::graph_traits::edge_iterator iterator, end; // sets iterator to start end end to end boost::tie(iterator, end) = boost::edges( m_Network ); for ( ; iterator != end; ++iterator) { int tempWeight; // the value of an iterator is a descriptor tempWeight = m_Network[ *iterator ].weight; if( tempWeight > maxWeight ) { maxWeight = tempWeight; } } return maxWeight; } int mitk::ConnectomicsNetwork::GetNumberOfSelfLoops() { int noOfSelfLoops( 0 ); std::vector< std::pair< std::pair< NetworkNode, NetworkNode > , NetworkEdge > > edgeVector = GetVectorOfAllEdges(); for( int index = 0; index < edgeVector.size() ; index++ ) { double sourceX, sourceY, sourceZ, targetX, targetY, targetZ; sourceX = edgeVector[ index ].first.first.coordinates[0] ; sourceY = edgeVector[ index ].first.first.coordinates[1] ; sourceZ = edgeVector[ index ].first.first.coordinates[2] ; targetX = edgeVector[ index ].first.second.coordinates[0] ; targetY = edgeVector[ index ].first.second.coordinates[1] ; targetZ = edgeVector[ index ].first.second.coordinates[2] ; // if the coordinates are the same if( sourceX > ( targetX - 0.01 ) && sourceX < ( targetX + 0.01 ) && sourceY > ( targetY - 0.01 ) && sourceY < ( targetY + 0.01 ) && sourceZ > ( targetZ - 0.01 ) && sourceZ < ( targetZ + 0.01 ) ) { noOfSelfLoops++; } } return noOfSelfLoops; } double mitk::ConnectomicsNetwork::GetAverageDegree() { double vertices = (double) GetNumberOfVertices(); double edges = (double) GetNumberOfEdges(); return ( ( edges * 2.0 ) / vertices ); } double mitk::ConnectomicsNetwork::GetConnectionDensity() { double vertices = (double) GetNumberOfVertices(); double edges = (double) GetNumberOfEdges(); double numberOfPossibleEdges = vertices * ( vertices - 1 ) / 2 ; return ( edges / numberOfPossibleEdges ); } std::vector< int > mitk::ConnectomicsNetwork::GetDegreeOfNodes( ) const { std::vector< int > vectorOfDegree; boost::graph_traits::vertex_iterator iterator, end; // sets iterator to start end end to end boost::tie( iterator, end ) = boost::vertices( m_Network ); vectorOfDegree.resize( this->GetNumberOfVertices() ); for ( ; iterator != end; ++iterator) { // the value of an iterator is a descriptor vectorOfDegree[ m_Network[ *iterator ].id ] = GetVectorOfAdjacentNodes( *iterator ).size(); } return vectorOfDegree; } std::vector< mitk::ConnectomicsNetwork::VertexDescriptorType > mitk::ConnectomicsNetwork::GetVectorOfAdjacentNodes( mitk::ConnectomicsNetwork::VertexDescriptorType vertex ) const { std::vector< mitk::ConnectomicsNetwork::VertexDescriptorType > vectorOfAdjacentNodes; boost::graph_traits::adjacency_iterator adjIter, adjEnd; boost::tie( adjIter, adjEnd ) = boost::adjacent_vertices( vertex, m_Network); for ( ; adjIter != adjEnd; ++adjIter) { vectorOfAdjacentNodes.push_back( *adjIter ); } return vectorOfAdjacentNodes; } int mitk::ConnectomicsNetwork::GetMaximumDegree() const { int maximumDegree( 0 ); std::vector< int > vectorOfDegree = GetDegreeOfNodes(); for( int index( 0 ); index < vectorOfDegree.size(); ++index ) { if( maximumDegree < vectorOfDegree[ index ] ) { maximumDegree = vectorOfDegree[ index ]; } } return maximumDegree; } -std::vector< double > mitk::ConnectomicsNetwork::GetLocalClusteringCoefficients( ) +std::vector< double > mitk::ConnectomicsNetwork::GetLocalClusteringCoefficients( ) const { std::vector< double > vectorOfClusteringCoefficients; typedef boost::graph_traits::vertex_iterator vertexIter; vectorOfClusteringCoefficients.resize( this->GetNumberOfVertices() ); std::pair vertexPair; //for every vertex calculate the clustering coefficient for (vertexPair = vertices(m_Network); vertexPair.first != vertexPair.second; ++vertexPair.first) { vectorOfClusteringCoefficients[ m_Network[ *vertexPair.first ].id ] = boost::clustering_coefficient(m_Network,*vertexPair.first) ; } return vectorOfClusteringCoefficients; } std::vector< double > mitk::ConnectomicsNetwork::GetClusteringCoefficientsByDegree( ) { std::vector< double > vectorOfClusteringCoefficients = GetLocalClusteringCoefficients(); std::vector< int > vectorOfDegree = GetDegreeOfNodes(); std::vector< double > vectorOfClusteringCoefficientsByDegree; vectorOfClusteringCoefficientsByDegree.resize( GetMaximumDegree() + 1, 0 ); // c_{mean}(k) = frac{1}_{N_{k}} sum_{i in Y(k)} c_{i} // where N_{k} is the number of vertices of degree k // Y(k) is the set of vertices of degree k // c_{i} is the local clustering coefficient of vertex i for( int degree( 0 ); degree < vectorOfClusteringCoefficientsByDegree.size(); ++degree ) { vectorOfClusteringCoefficientsByDegree[ degree ] = 0; int n_k( 0 ); for( int index( 0 ); index < vectorOfDegree.size(); ++index ) { if( degree == vectorOfDegree[ index ] ) {// if in Y( degree ) vectorOfClusteringCoefficientsByDegree[ degree ] += vectorOfClusteringCoefficients[ index ]; n_k++; } } if( n_k != 0 ) { vectorOfClusteringCoefficientsByDegree[ degree ] = vectorOfClusteringCoefficientsByDegree[ degree ] / n_k; } } return vectorOfClusteringCoefficientsByDegree; } double mitk::ConnectomicsNetwork::GetGlobalClusteringCoefficient( ) { double globalClusteringCoefficient( 0.0 ); std::vector< double > vectorOfClusteringCoefficientsByDegree = GetClusteringCoefficientsByDegree(); std::vector< int > vectorOfDegree = GetDegreeOfNodes(); std::vector< int > degreeDistribution; degreeDistribution.resize( vectorOfClusteringCoefficientsByDegree.size(), 0 ); int normalizationParameter( 0 ); for( int index( 0 ); index < vectorOfDegree.size(); ++index ) { degreeDistribution[ vectorOfDegree[ index ] ]++; normalizationParameter++; } // c_{mean} = sum_{k} P_{k} c_{mean}(k) // where P_{k} is the degree distribution // k is the degree for( int degree( 0 ); degree < degreeDistribution.size(); ++degree ) { globalClusteringCoefficient += degreeDistribution[ degree ] / ( (double) normalizationParameter) * vectorOfClusteringCoefficientsByDegree[ degree ]; } return globalClusteringCoefficient; } mitk::ConnectomicsNetwork::NetworkType* mitk::ConnectomicsNetwork::GetBoostGraph() { return &m_Network; } bool mitk::ConnectomicsNetwork::GetIsModified() const { return m_IsModified; } void mitk::ConnectomicsNetwork::SetIsModified( bool value) { m_IsModified = value; } mitk::ConnectomicsNetwork::NetworkNode mitk::ConnectomicsNetwork::GetNode( VertexDescriptorType vertex ) const { return m_Network[ vertex ]; } mitk::ConnectomicsNetwork::NetworkEdge mitk::ConnectomicsNetwork::GetEdge( VertexDescriptorType vertexA, VertexDescriptorType vertexB ) const { return m_Network[ boost::edge(vertexA, vertexB, m_Network ).first ]; } void mitk::ConnectomicsNetwork::UpdateBounds( ) { float min = itk::NumericTraits::min(); float max = itk::NumericTraits::max(); float bounds[] = {max, min, max, min, max, min}; std::vector< mitk::ConnectomicsNetwork::NetworkNode > nodeVector = this->GetVectorOfAllNodes(); if( nodeVector.size() == 0 ) { bounds[0] = 0; bounds[1] = 1; bounds[2] = 0; bounds[3] = 1; bounds[4] = 0; bounds[5] = 1; } // for each direction, make certain the point is in between for( int index(0), end(nodeVector.size()) ; index < end; index++ ) { for( int direction(0); direction < nodeVector.at( index ).coordinates.size(); direction++ ) { if( nodeVector.at( index ).coordinates.at(direction) < bounds[ 2 * direction ] ) { bounds[ 2 * direction ] = nodeVector.at( index ).coordinates.at(direction); } if( nodeVector.at( index ).coordinates.at(direction) > bounds[ 2 * direction + 1] ) { bounds[ 2 * direction + 1] = nodeVector.at( index ).coordinates.at(direction); } } } // provide some border margin for(int i=0; i<=4; i+=2) { bounds[i] -=10; } for(int i=1; i<=5; i+=2) { bounds[i] +=10; } this->GetGeometry()->SetFloatBounds(bounds); this->GetTimeSlicedGeometry()->UpdateInformation(); } void mitk::ConnectomicsNetwork::PruneUnconnectedSingleNodes() { boost::graph_traits::vertex_iterator iterator, end; // set to true if iterators are invalidated by deleting a vertex bool vertexHasBeenRemoved( true ); // if no vertex has been removed in the last loop, we are done while( vertexHasBeenRemoved ) { vertexHasBeenRemoved = false; // sets iterator to start and end to end boost::tie(iterator, end) = boost::vertices( m_Network ); for ( ; iterator != end && !vertexHasBeenRemoved; ++iterator) { // If the node has no adjacent vertices it should be deleted if( GetVectorOfAdjacentNodes( *iterator ).size() == 0 ) { vertexHasBeenRemoved = true; // this invalidates all iterators boost::remove_vertex( *iterator, m_Network ); } } } UpdateIDs(); } void mitk::ConnectomicsNetwork::UpdateIDs() { boost::graph_traits::vertex_iterator v_i, v_end; boost::graph_traits::edge_iterator e_i, e_end; // update node ids boost::tie( v_i, v_end ) = boost::vertices( m_Network ); for ( ; v_i != v_end; ++v_i) { m_Network[*v_i].id = *v_i; } // update edge information boost::tie(e_i, e_end) = boost::edges( m_Network ); for ( ; e_i != e_end; ++e_i) { m_Network[ *e_i ].sourceId = m_Network[ boost::source( *e_i, m_Network ) ].id; m_Network[ *e_i ].targetId = m_Network[ boost::target( *e_i, m_Network ) ].id; } this->SetIsModified( true ); } void mitk::ConnectomicsNetwork::PruneEdgesBelowWeight( int targetWeight ) { boost::graph_traits::edge_iterator iterator, end; // set to true if iterators are invalidated by deleting a vertex bool edgeHasBeenRemoved( true ); // if no vertex has been removed in the last loop, we are done while( edgeHasBeenRemoved ) { edgeHasBeenRemoved = false; // sets iterator to start and end to end boost::tie(iterator, end) = boost::edges( m_Network ); for ( ; iterator != end && !edgeHasBeenRemoved; ++iterator) { // If the node has no adjacent edges it should be deleted if( m_Network[ *iterator ].weight < targetWeight ) { edgeHasBeenRemoved = true; // this invalidates all iterators boost::remove_edge( *iterator, m_Network ); } } } // this will remove any nodes which, after deleting edges are now // unconnected, also this calls UpdateIDs() PruneUnconnectedSingleNodes(); } + +std::vector< double > mitk::ConnectomicsNetwork::GetNodeBetweennessVector() const +{ + std::vector< double > betweennessVector; + + betweennessVector.clear(); + betweennessVector.resize( this->GetNumberOfVertices() ); + + boost::brandes_betweenness_centrality( + m_Network, + boost::centrality_map( + boost::make_iterator_property_map( betweennessVector.begin(), boost::get( &NetworkNode::id, m_Network ), double() ) + ).vertex_index_map( boost::get( &NetworkNode::id, m_Network ) ) + ); + + return betweennessVector; +} + +std::vector< double > mitk::ConnectomicsNetwork::GetEdgeBetweennessVector() const +{ + // std::map used for convenient initialization + typedef std::map EdgeIndexStdMap; + EdgeIndexStdMap stdEdgeIndex; + // associative property map needed for iterator property map-wrapper + typedef boost::associative_property_map< EdgeIndexStdMap > EdgeIndexMap; + EdgeIndexMap edgeIndex(stdEdgeIndex); + + boost::graph_traits::edge_iterator iterator, end; + + // sets iterator to start end end to end + boost::tie(iterator, end) = boost::edges( m_Network ); + + int i(0); + for ( ; iterator != end; ++iterator, ++i) + { + stdEdgeIndex.insert(std::pair< EdgeDescriptorType, int >( *iterator, i)); + } + + // Define EdgeCentralityMap + std::vector< double > edgeBetweennessVector(boost::num_edges( m_Network ), 0.0); + // Create the external property map + boost::iterator_property_map< std::vector< double >::iterator, EdgeIndexMap > + e_centrality_map(edgeBetweennessVector.begin(), edgeIndex); + + // Define VertexCentralityMap + typedef boost::property_map< NetworkType, boost::vertex_index_t>::type VertexIndexMap; + VertexIndexMap vertexIndex = get(boost::vertex_index, m_Network ); + std::vector< double > betweennessVector(boost::num_vertices( m_Network ), 0.0); + // Create the external property map + boost::iterator_property_map< std::vector< double >::iterator, VertexIndexMap > + v_centrality_map(betweennessVector.begin(), vertexIndex); + + boost::brandes_betweenness_centrality( m_Network, v_centrality_map, e_centrality_map ); + + return edgeBetweennessVector; +} + +std::vector< double > mitk::ConnectomicsNetwork::GetShortestDistanceVectorFromLabel( std::string targetLabel ) const +{ + std::vector< VertexDescriptorType > predecessorMap( boost::num_vertices( m_Network ) ); + int numberOfNodes( boost::num_vertices( m_Network ) ); + + std::vector< double > distanceMatrix; + distanceMatrix.resize( numberOfNodes ); + + boost::graph_traits::vertex_iterator iterator, end; + boost::tie(iterator, end) = boost::vertices( m_Network ); + + while( (iterator != end) && (m_Network[ *iterator ].label != targetLabel) ) + { + ++iterator; + } + + if( iterator == end ) + { + MITK_WARN << "Label not found"; + return distanceMatrix; + } + + boost::dijkstra_shortest_paths(m_Network, *iterator, boost::predecessor_map(&predecessorMap[ 0 ]).distance_map(&distanceMatrix[ 0 ]).weight_map( boost::get( &NetworkEdge::edge_weight ,m_Network ) ) ) ; + + return distanceMatrix; +} + +bool mitk::ConnectomicsNetwork::CheckForLabel( std::string targetLabel ) const +{ + boost::graph_traits::vertex_iterator iterator, end; + boost::tie(iterator, end) = boost::vertices( m_Network ); + + while( (iterator != end) && (m_Network[ *iterator ].label != targetLabel) ) + { + ++iterator; + } + + if( iterator == end ) + { + return false; + } + + return true; +} diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetwork.h b/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetwork.h index 2707538a76..0c919e1db8 100644 --- a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetwork.h +++ b/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetwork.h @@ -1,215 +1,227 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _MITK_ConnectomicsNetwork_H #define _MITK_ConnectomicsNetwork_H #include "MitkDiffusionImagingExports.h" #include "mitkBaseData.h" #include namespace mitk { /** * \brief Connectomics Network Class * * This class is designed to represent a connectomics network (brain network). It encapsulates a * boost adjacency list and provides additional capabilities. The information contained in the nodes and edges is: * * Network Node: *
    *
  • int ID - The id of the node *
  • string label - The label of the node, this can be any string, such as an anatomical label *
  • vector coordinates - The coordinates the node should be displayed at *
* * Network Edge: *
    *
  • int sourceId - The Id of the source node *
  • int targetId - The Id of the target node *
  • int weight - Weight of the edge as int (used for counting fibers) *
  • double edge_weight - Used for boost and algorithms, should be between 0 and 1 *
*/ class MitkDiffusionImaging_EXPORT ConnectomicsNetwork : public BaseData { public: /** Structs for the graph */ /** The Node */ struct NetworkNode { int id; std::string label; std::vector< float > coordinates; }; /** The Edge */ struct NetworkEdge { int sourceId; int targetId; int weight; // For now the number of times it was present double edge_weight; // For boost, currently set to 1 by default for unweighted calculations }; /** Typedefs **/ //typedef boost::adjacency_list< boost::listS, boost::listS, boost::undirectedS, NetworkNode, NetworkEdge > NetworkType; typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS, NetworkNode, NetworkEdge > NetworkType; typedef boost::graph_traits::vertex_descriptor VertexDescriptorType; typedef boost::graph_traits::edge_descriptor EdgeDescriptorType; // virtual methods that need to be implemented virtual void UpdateOutputInformation(); virtual void SetRequestedRegionToLargestPossibleRegion(); virtual bool RequestedRegionIsOutsideOfTheBufferedRegion(); virtual bool VerifyRequestedRegion(); virtual void SetRequestedRegion( itk::DataObject *data ); // Macros mitkClassMacro( ConnectomicsNetwork, BaseData ); itkNewMacro( Self ); ////////////////// Interface /////////////////// /** return whether an edge exists between the two given vertices */ bool EdgeExists( VertexDescriptorType vertexA, VertexDescriptorType vertexB ) const; /** increase the weight of an edge between the two given vertices */ void IncreaseEdgeWeight( VertexDescriptorType vertexA, VertexDescriptorType vertexB ); /** add an edge between two given vertices */ void AddEdge( VertexDescriptorType vertexA, VertexDescriptorType vertexB); /** add an edge between two given vertices ( with a specific weight ) */ void AddEdge( VertexDescriptorType vertexA, VertexDescriptorType vertexB, int sourceID, int targetID, int weight = 1 ); /** add a vertex with a specified id */ VertexDescriptorType AddVertex( int id); /** set the label of a vertex */ void SetLabel( VertexDescriptorType vertex, std::string inLabel ); /** set the coordinates of a vertex */ void SetCoordinates( VertexDescriptorType vertex, std::vector< float > inCoordinates ); /** clear the graph */ void clear(); /** return the node struct for a given node descriptor */ NetworkNode GetNode( VertexDescriptorType vertex ) const; /** return the edge struct for two given node descriptors */ NetworkEdge GetEdge( VertexDescriptorType vertexA, VertexDescriptorType vertexB ) const; /** get vector containing all the nodes of the network */ std::vector< NetworkNode > GetVectorOfAllNodes() const; /** get vector containing all the vertex descriptors of the network */ std::vector< VertexDescriptorType > GetVectorOfAllVertexDescriptors() const; /** get vector containing the descriptors of nodes adjacent to the vertex denoted by the given descriptor */ std::vector< VertexDescriptorType > GetVectorOfAdjacentNodes( VertexDescriptorType vertex ) const; /** get vector containing all the edges of the network and the connected nodes */ std::vector< std::pair< std::pair< NetworkNode, NetworkNode > , NetworkEdge > > GetVectorOfAllEdges() const; /** get overall number of vertices in the network */ int GetNumberOfVertices() const; /** get overall number of edges in the network */ - int GetNumberOfEdges(); + int GetNumberOfEdges() const; /** get number of vertices, that are connected to themselves */ int GetNumberOfSelfLoops(); /** get number of vertices, that are connected to themselves */ double GetAverageDegree(); /** get number of edges divided by number of possible edges */ double GetConnectionDensity(); /** Get the maximum weight of all edges */ int GetMaximumWeight() const; /** Get a vector in the format vector[ vertexID ] = degree */ std::vector< int > GetDegreeOfNodes( ) const; /** Get the maximum degree of all nodes */ int GetMaximumDegree() const; /** Get a vector in the format vector[ vertexID ] = clustering coefficient */ - std::vector< double > GetLocalClusteringCoefficients( ); + std::vector< double > GetLocalClusteringCoefficients( ) const; /** Get a vector in the format vector[ degree ] = average clustering coefficient */ std::vector< double > GetClusteringCoefficientsByDegree( ); /** Get the global clustering coefficient */ double GetGlobalClusteringCoefficient( ); + /** Get the betweenness centrality for each vertex in form of a vector of length (number vertices)*/ + std::vector< double > GetNodeBetweennessVector() const; + + /** Get the betweenness centrality for each edge in form of a vector of length (number edges)*/ + std::vector< double > GetEdgeBetweennessVector() const; + + /** Check whether a vertex with the specified label exists*/ + bool CheckForLabel( std::string targetLabel ) const; + + /** Get the shortest distance from a specified vertex to all other vertices in form of a vector of length (number vertices)*/ + std::vector< double > GetShortestDistanceVectorFromLabel( std::string targetLabel ) const; + /** Access boost graph directly */ NetworkType* GetBoostGraph(); /** Get the modified flag */ bool GetIsModified() const; /** Set the modified flag */ void SetIsModified( bool ); /** Update the bounds of the geometry to fit the network */ void UpdateBounds( ); /** Remove nodes not connected to any other node */ void PruneUnconnectedSingleNodes(); /** Remove edges below the specified weight * * targetWeight is the number of connecting fibers * * This will remove unconnected nodes after removal */ void PruneEdgesBelowWeight( int targetWeight ); protected: ConnectomicsNetwork(); virtual ~ConnectomicsNetwork(); /** This function will relabel all vertices and edges in a continuous manner * * Mainly important after removing vertices, to make sure that the ids run continuously from * 0 to number of vertices - 1 and edge target and source ids match the corresponding node. */ void UpdateIDs(); NetworkType m_Network; /// Flag which indicates whether the network has been modified since the last check /// /// mainly for rendering purposes bool m_IsModified; private: }; } // namespace mitk #endif /* _MITK_ConnectomicsNetwork_H */ diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsNetworkMapper3D.cpp b/Modules/DiffusionImaging/Rendering/mitkConnectomicsNetworkMapper3D.cpp index 13eaa56edf..a857776901 100644 --- a/Modules/DiffusionImaging/Rendering/mitkConnectomicsNetworkMapper3D.cpp +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsNetworkMapper3D.cpp @@ -1,181 +1,760 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkConnectomicsNetworkMapper3D.h" +#include +#include "vtkGraphLayout.h" +#include +#include "vtkGraphToPolyData.h" +#include +#include "vtkGlyph3D.h" +#include "vtkGlyphSource2D.h" + +#include "mitkConnectomicsRenderingProperties.h" +#include "mitkConnectomicsRenderingSchemeProperty.h" +#include "mitkConnectomicsRenderingEdgeFilteringProperty.h" +#include "mitkConnectomicsRenderingNodeFilteringProperty.h" +#include "mitkConnectomicsRenderingNodeColorParameterProperty.h" +#include "mitkConnectomicsRenderingNodeRadiusParameterProperty.h" +#include "mitkConnectomicsRenderingEdgeColorParameterProperty.h" +#include "mitkConnectomicsRenderingEdgeRadiusParameterProperty.h" +#include "mitkConnectomicsRenderingNodeThresholdParameterProperty.h" +#include "mitkConnectomicsRenderingEdgeThresholdParameterProperty.h" + +#include + mitk::ConnectomicsNetworkMapper3D::ConnectomicsNetworkMapper3D() { - //TODO: implement m_NetworkAssembly = vtkPropAssembly::New(); } mitk::ConnectomicsNetworkMapper3D:: ~ConnectomicsNetworkMapper3D() { - //TODO: implement m_NetworkAssembly->Delete(); } void mitk::ConnectomicsNetworkMapper3D::GenerateDataForRenderer(mitk::BaseRenderer* renderer) { - //TODO: implement - if( this->GetInput() == NULL ) { return; } - if( this->GetInput()->GetIsModified( ) ) + + bool propertiesHaveChanged = this->PropertiesChanged(); + + if( this->GetInput()->GetIsModified( ) || propertiesHaveChanged ) { GenerateData(); } } void mitk::ConnectomicsNetworkMapper3D::GenerateData() { m_NetworkAssembly->Delete(); m_NetworkAssembly = vtkPropAssembly::New(); // Here is the part where a graph is given and converted to points and connections between points... std::vector< mitk::ConnectomicsNetwork::NetworkNode > vectorOfNodes = this->GetInput()->GetVectorOfAllNodes(); std::vector< std::pair< std::pair< mitk::ConnectomicsNetwork::NetworkNode, mitk::ConnectomicsNetwork::NetworkNode > , mitk::ConnectomicsNetwork::NetworkEdge > > vectorOfEdges = this->GetInput()->GetVectorOfAllEdges(); - mitk::Point3D tempWorldPoint, tempCNFGeometryPoint; + // Decide on the style of rendering due to property - //////////////////////Create Spheres///////////////////////// - for(unsigned int i = 0; i < vectorOfNodes.size(); i++) + if( m_ChosenRenderingScheme == connectomicsRenderingMITKScheme ) { - vtkSmartPointer sphereSource = - vtkSmartPointer::New(); + mitk::Point3D tempWorldPoint, tempCNFGeometryPoint; + + //////////////////////Prepare coloring and radius//////////// + + std::vector< double > vectorOfNodeRadiusParameterValues; + vectorOfNodeRadiusParameterValues.resize( vectorOfNodes.size() ); + double maxNodeRadiusParameterValue( FillNodeParameterVector( &vectorOfNodeRadiusParameterValues, m_NodeRadiusParameter ) ); + + std::vector< double > vectorOfNodeColorParameterValues; + vectorOfNodeColorParameterValues.resize( vectorOfNodes.size() ); + double maxNodeColorParameterValue( FillNodeParameterVector( &vectorOfNodeColorParameterValues, m_NodeColorParameter ) ); + + std::vector< double > vectorOfEdgeRadiusParameterValues; + vectorOfEdgeRadiusParameterValues.resize( vectorOfEdges.size() ); + double maxEdgeRadiusParameterValue( FillEdgeParameterVector( &vectorOfEdgeRadiusParameterValues, m_EdgeRadiusParameter ) ); - for(unsigned int dimension = 0; dimension < 3; dimension++) + std::vector< double > vectorOfEdgeColorParameterValues; + vectorOfEdgeColorParameterValues.resize( vectorOfEdges.size() ); + double maxEdgeColorParameterValue( FillEdgeParameterVector( &vectorOfEdgeColorParameterValues, m_EdgeColorParameter ) ); + + //////////////////////Prepare Filtering////////////////////// + // true will be rendered + std::vector< bool > vectorOfNodeFilterBools( vectorOfNodes.size(), true ); + if( m_ChosenNodeFilter == connectomicsRenderingNodeThresholdingFilter ) { - tempCNFGeometryPoint.SetElement( dimension , vectorOfNodes[i].coordinates[dimension] ); + FillNodeFilterBoolVector( &vectorOfNodeFilterBools, m_NodeThresholdParameter ); } - this->GetData()->GetGeometry()->IndexToWorld( tempCNFGeometryPoint, tempWorldPoint ); + std::vector< bool > vectorOfEdgeFilterBools( vectorOfEdges.size(), true ); + if( m_ChosenEdgeFilter == connectomicsRenderingEdgeThresholdFilter ) + { + FillEdgeFilterBoolVector( &vectorOfEdgeFilterBools, m_EdgeThresholdParameter ); + } - sphereSource->SetCenter( tempWorldPoint[0] , tempWorldPoint[1], tempWorldPoint[2] ); - sphereSource->SetRadius(1.0); + //////////////////////Create Spheres///////////////////////// + for(unsigned int i = 0; i < vectorOfNodes.size(); i++) + { + vtkSmartPointer sphereSource = + vtkSmartPointer::New(); - vtkSmartPointer mapper = - vtkSmartPointer::New(); - mapper->SetInput(sphereSource->GetOutput()); + for(unsigned int dimension = 0; dimension < 3; dimension++) + { + tempCNFGeometryPoint.SetElement( dimension , vectorOfNodes[i].coordinates[dimension] ); + } - vtkSmartPointer actor = - vtkSmartPointer::New(); - actor->SetMapper(mapper); + this->GetData()->GetGeometry()->IndexToWorld( tempCNFGeometryPoint, tempWorldPoint ); - m_NetworkAssembly->AddPart(actor); - } + sphereSource->SetCenter( tempWorldPoint[0] , tempWorldPoint[1], tempWorldPoint[2] ); - //////////////////////Create Tubes///////////////////////// + // determine radius + double radiusFactor = vectorOfNodeRadiusParameterValues[i] / maxNodeRadiusParameterValue; - for(unsigned int i = 0; i < vectorOfEdges.size(); i++) - { + double radius = m_NodeRadiusStart + ( m_NodeRadiusEnd - m_NodeRadiusStart) * radiusFactor; + sphereSource->SetRadius( radius ); - vtkSmartPointer lineSource = - vtkSmartPointer::New(); + vtkSmartPointer mapper = + vtkSmartPointer::New(); + mapper->SetInput(sphereSource->GetOutput()); - for(unsigned int dimension = 0; dimension < 3; dimension++) - { - tempCNFGeometryPoint[ dimension ] = vectorOfEdges[i].first.first.coordinates[dimension]; + vtkSmartPointer actor = + vtkSmartPointer::New(); + actor->SetMapper(mapper); + + // determine color + double colorFactor = vectorOfNodeColorParameterValues[i] / maxNodeColorParameterValue; + + double redStart = m_NodeColorStart.GetElement( 0 ); + double greenStart = m_NodeColorStart.GetElement( 1 ); + double blueStart = m_NodeColorStart.GetElement( 2 ); + double redEnd = m_NodeColorEnd.GetElement( 0 ); + double greenEnd = m_NodeColorEnd.GetElement( 1 ); + double blueEnd = m_NodeColorEnd.GetElement( 2 ); + + double red = redStart + ( redEnd - redStart ) * colorFactor; + double green = greenStart + ( greenEnd - greenStart ) * colorFactor; + double blue = blueStart + ( blueEnd - blueStart ) * colorFactor; + + actor->GetProperty()->SetColor( red, green, blue); + + if( vectorOfNodeFilterBools[i] ) + { + m_NetworkAssembly->AddPart(actor); + } } - this->GetData()->GetGeometry()->IndexToWorld( tempCNFGeometryPoint, tempWorldPoint ); + //////////////////////Create Tubes///////////////////////// - lineSource->SetPoint1(tempWorldPoint[0], tempWorldPoint[1],tempWorldPoint[2] ); + double maxWeight = (double) this->GetInput()->GetMaximumWeight(); - for(unsigned int dimension = 0; dimension < 3; dimension++) + for(unsigned int i = 0; i < vectorOfEdges.size(); i++) { - tempCNFGeometryPoint[ dimension ] = vectorOfEdges[i].first.second.coordinates[dimension]; - } - this->GetData()->GetGeometry()->IndexToWorld( tempCNFGeometryPoint, tempWorldPoint ); + vtkSmartPointer lineSource = + vtkSmartPointer::New(); - lineSource->SetPoint2(tempWorldPoint[0], tempWorldPoint[1], tempWorldPoint[2] ); + for(unsigned int dimension = 0; dimension < 3; dimension++) + { + tempCNFGeometryPoint[ dimension ] = vectorOfEdges[i].first.first.coordinates[dimension]; + } - vtkSmartPointer tubes = vtkSmartPointer::New(); - tubes->SetInput( lineSource->GetOutput() ); - tubes->SetNumberOfSides( 12 ); - double radiusFactor = 1.0 + ((double) vectorOfEdges[i].second.weight) / 10.0 ; - tubes->SetRadius( std::log10( radiusFactor ) ); + this->GetData()->GetGeometry()->IndexToWorld( tempCNFGeometryPoint, tempWorldPoint ); - vtkSmartPointer mapper2 = - vtkSmartPointer::New(); - mapper2->SetInput( tubes->GetOutput() ); + lineSource->SetPoint1(tempWorldPoint[0], tempWorldPoint[1],tempWorldPoint[2] ); - vtkSmartPointer actor = - vtkSmartPointer::New(); - actor->SetMapper(mapper2); + for(unsigned int dimension = 0; dimension < 3; dimension++) + { + tempCNFGeometryPoint[ dimension ] = vectorOfEdges[i].first.second.coordinates[dimension]; + } - double maxWeight = (double) this->GetInput()->GetMaximumWeight(); - double colourFactor = vectorOfEdges[i].second.weight / maxWeight; - actor->GetProperty()->SetColor( colourFactor, colourFactor, colourFactor); + this->GetData()->GetGeometry()->IndexToWorld( tempCNFGeometryPoint, tempWorldPoint ); + + lineSource->SetPoint2(tempWorldPoint[0], tempWorldPoint[1], tempWorldPoint[2] ); + + vtkSmartPointer tubes = vtkSmartPointer::New(); + tubes->SetInput( lineSource->GetOutput() ); + tubes->SetNumberOfSides( 12 ); + + // determine radius + double radiusFactor = vectorOfEdgeRadiusParameterValues[i] / maxEdgeRadiusParameterValue; + + double radius = m_EdgeRadiusStart + ( m_EdgeRadiusEnd - m_EdgeRadiusStart) * radiusFactor; + tubes->SetRadius( radius ); + + // originally we used a logarithmic scaling, + // double radiusFactor = 1.0 + ((double) vectorOfEdges[i].second.weight) / 10.0 ; + // tubes->SetRadius( std::log10( radiusFactor ) ); + + vtkSmartPointer mapper2 = + vtkSmartPointer::New(); + mapper2->SetInput( tubes->GetOutput() ); + + vtkSmartPointer actor = + vtkSmartPointer::New(); + actor->SetMapper(mapper2); + // determine color + double colorFactor = vectorOfEdgeColorParameterValues[i] / maxEdgeColorParameterValue; - m_NetworkAssembly->AddPart(actor); + double redStart = m_EdgeColorStart.GetElement( 0 ); + double greenStart = m_EdgeColorStart.GetElement( 1 ); + double blueStart = m_EdgeColorStart.GetElement( 2 ); + double redEnd = m_EdgeColorEnd.GetElement( 0 ); + double greenEnd = m_EdgeColorEnd.GetElement( 1 ); + double blueEnd = m_EdgeColorEnd.GetElement( 2 ); + double red = redStart + ( redEnd - redStart ) * colorFactor; + double green = greenStart + ( greenEnd - greenStart ) * colorFactor; + double blue = blueStart + ( blueEnd - blueStart ) * colorFactor; + + actor->GetProperty()->SetColor( red, green, blue); + + if( vectorOfEdgeFilterBools[i] ) + { + m_NetworkAssembly->AddPart(actor); + } + } } + else if( m_ChosenRenderingScheme == connectomicsRenderingVTKScheme ) + { + vtkSmartPointer graph = + vtkSmartPointer::New(); - (static_cast ( GetData() ) )->SetIsModified( false ); + std::vector< vtkIdType > networkToVTKvector; + networkToVTKvector.resize(vectorOfNodes.size()); + + for(unsigned int i = 0; i < vectorOfNodes.size(); i++) + { + networkToVTKvector[vectorOfNodes[i].id] = graph->AddVertex(); + } + + for(unsigned int i = 0; i < vectorOfEdges.size(); i++) + { + graph->AddEdge(networkToVTKvector[vectorOfEdges[i].first.first.id], networkToVTKvector[vectorOfEdges[i].first.second.id]); + } - //this->UpdateVtkObjects(); + vtkSmartPointer points = + vtkSmartPointer::New(); + for(unsigned int i = 0; i < vectorOfNodes.size(); i++) + { + double x = vectorOfNodes[i].coordinates[0]; + double y = vectorOfNodes[i].coordinates[1]; + double z = vectorOfNodes[i].coordinates[2]; + points->InsertNextPoint( x, y, z); + } + graph->SetPoints(points); + + vtkGraphLayout* layout = vtkGraphLayout::New(); + layout->SetInput(graph); + layout->SetLayoutStrategy(vtkPassThroughLayoutStrategy::New()); + + vtkGraphToPolyData* graphToPoly = vtkGraphToPolyData::New(); + graphToPoly->SetInputConnection(layout->GetOutputPort()); + + // Create the standard VTK polydata mapper and actor + // for the connections (edges) in the tree. + vtkPolyDataMapper* edgeMapper = vtkPolyDataMapper::New(); + edgeMapper->SetInputConnection(graphToPoly->GetOutputPort()); + vtkActor* edgeActor = vtkActor::New(); + edgeActor->SetMapper(edgeMapper); + edgeActor->GetProperty()->SetColor(0.0, 0.5, 1.0); + + // Glyph the points of the tree polydata to create + // VTK_VERTEX cells at each vertex in the tree. + vtkGlyph3D* vertGlyph = vtkGlyph3D::New(); + vertGlyph->SetInputConnection(0, graphToPoly->GetOutputPort()); + vtkGlyphSource2D* glyphSource = vtkGlyphSource2D::New(); + glyphSource->SetGlyphTypeToVertex(); + vertGlyph->SetInputConnection(1, glyphSource->GetOutputPort()); + + // Create a mapper for the vertices, and tell the mapper + // to use the specified color array. + vtkPolyDataMapper* vertMapper = vtkPolyDataMapper::New(); + vertMapper->SetInputConnection(vertGlyph->GetOutputPort()); + /*if (colorArray) + { + vertMapper->SetScalarModeToUsePointFieldData(); + vertMapper->SelectColorArray(colorArray); + vertMapper->SetScalarRange(colorRange); + }*/ + + // Create an actor for the vertices. Move the actor forward + // in the z direction so it is drawn on top of the edge actor. + vtkActor* vertActor = vtkActor::New(); + vertActor->SetMapper(vertMapper); + vertActor->GetProperty()->SetPointSize(5); + vertActor->SetPosition(0, 0, 0.001); + + m_NetworkAssembly->AddPart(edgeActor); + m_NetworkAssembly->AddPart(vertActor); + } + (static_cast ( GetData() ) )->SetIsModified( false ); } const mitk::ConnectomicsNetwork* mitk::ConnectomicsNetworkMapper3D::GetInput() { return static_cast ( GetData() ); } - void mitk::ConnectomicsNetworkMapper3D::SetDefaultProperties(DataNode* node, BaseRenderer* renderer , bool overwrite) { - //TODO: implement - + // Initialize enumeration properties + + mitk::ConnectomicsRenderingSchemeProperty::Pointer connectomicsRenderingScheme = + mitk::ConnectomicsRenderingSchemeProperty::New(); + mitk::ConnectomicsRenderingEdgeFilteringProperty::Pointer connectomicsRenderingEdgeFiltering = + mitk::ConnectomicsRenderingEdgeFilteringProperty::New(); + mitk::ConnectomicsRenderingNodeFilteringProperty::Pointer connectomicsRenderingNodeFiltering = + mitk::ConnectomicsRenderingNodeFilteringProperty::New(); + + mitk::ConnectomicsRenderingNodeColorParameterProperty::Pointer connectomicsRenderingNodeGradientColorParameter = + mitk::ConnectomicsRenderingNodeColorParameterProperty::New(); + mitk::ConnectomicsRenderingNodeRadiusParameterProperty::Pointer connectomicsRenderingNodeRadiusParameter = + mitk::ConnectomicsRenderingNodeRadiusParameterProperty::New(); + mitk::ConnectomicsRenderingEdgeColorParameterProperty::Pointer connectomicsRenderingEdgeGradientColorParameter = + mitk::ConnectomicsRenderingEdgeColorParameterProperty::New(); + mitk::ConnectomicsRenderingEdgeRadiusParameterProperty::Pointer connectomicsRenderingEdgeRadiusParameter = + mitk::ConnectomicsRenderingEdgeRadiusParameterProperty::New(); + + mitk::ConnectomicsRenderingNodeThresholdParameterProperty::Pointer connectomicsRenderingNodeThresholdParameter = + mitk::ConnectomicsRenderingNodeThresholdParameterProperty::New(); + mitk::ConnectomicsRenderingEdgeThresholdParameterProperty::Pointer connectomicsRenderingEdgeThresholdParameter = + mitk::ConnectomicsRenderingEdgeThresholdParameterProperty::New(); + + // set the properties + node->AddProperty( connectomicsRenderingSchemePropertyName.c_str(), + connectomicsRenderingScheme, renderer, overwrite ); + + node->AddProperty( connectomicsRenderingEdgeFilteringPropertyName.c_str(), + connectomicsRenderingEdgeFiltering, renderer, overwrite ); + node->AddProperty( connectomicsRenderingEdgeThresholdFilterParameterName.c_str(), + connectomicsRenderingEdgeThresholdParameter, renderer, overwrite ); + node->AddProperty( connectomicsRenderingEdgeThresholdFilterThresholdName.c_str(), + connectomicsRenderingEdgeThresholdFilterThresholdDefault, renderer, overwrite ); + + node->AddProperty( connectomicsRenderingNodeFilteringPropertyName.c_str(), + connectomicsRenderingNodeFiltering, renderer, overwrite ); + node->AddProperty( connectomicsRenderingNodeThresholdFilterParameterName.c_str(), + connectomicsRenderingNodeThresholdParameter, renderer, overwrite ); + node->AddProperty( connectomicsRenderingNodeThresholdFilterThresholdName.c_str(), + connectomicsRenderingNodeThresholdFilterThresholdDefault, renderer, overwrite ); + + node->AddProperty( connectomicsRenderingNodeGradientStartColorName.c_str(), + connectomicsRenderingNodeGradientStartColorDefault, renderer, overwrite ); + node->AddProperty( connectomicsRenderingNodeGradientEndColorName.c_str(), + connectomicsRenderingNodeGradientEndColorDefault, renderer, overwrite ); + node->AddProperty( connectomicsRenderingNodeGradientColorParameterName.c_str(), + connectomicsRenderingNodeGradientColorParameter, renderer, overwrite ); + + node->AddProperty( connectomicsRenderingNodeRadiusStartName.c_str(), + connectomicsRenderingNodeRadiusStartDefault, renderer, overwrite ); + node->AddProperty( connectomicsRenderingNodeRadiusEndName.c_str(), + connectomicsRenderingNodeRadiusEndDefault, renderer, overwrite ); + node->AddProperty( connectomicsRenderingNodeRadiusParameterName.c_str(), + connectomicsRenderingNodeRadiusParameter, renderer, overwrite ); + + node->AddProperty( connectomicsRenderingNodeChosenNodeName.c_str(), + connectomicsRenderingNodeChosenNodeDefault, renderer, overwrite ); + + node->AddProperty( connectomicsRenderingEdgeGradientStartColorName.c_str(), + connectomicsRenderingEdgeGradientStartColorDefault, renderer, overwrite ); + node->AddProperty( connectomicsRenderingEdgeGradientEndColorName.c_str(), + connectomicsRenderingEdgeGradientEndColorDefault, renderer, overwrite ); + node->AddProperty( connectomicsRenderingEdgeGradientColorParameterName.c_str(), + connectomicsRenderingEdgeGradientColorParameter, renderer, overwrite ); + + node->AddProperty( connectomicsRenderingEdgeRadiusStartName.c_str(), + connectomicsRenderingEdgeRadiusStartDefault, renderer, overwrite ); + node->AddProperty( connectomicsRenderingEdgeRadiusEndName.c_str(), + connectomicsRenderingEdgeRadiusEndDefault, renderer, overwrite ); + node->AddProperty( connectomicsRenderingEdgeRadiusParameterName.c_str(), + connectomicsRenderingEdgeRadiusParameter, renderer, overwrite ); - // hand it to the superclass for base default properties Superclass::SetDefaultProperties(node, renderer, overwrite); } void mitk::ConnectomicsNetworkMapper3D::ApplyProperties(mitk::BaseRenderer* renderer) { //TODO: implement } void mitk::ConnectomicsNetworkMapper3D::SetVtkMapperImmediateModeRendering(vtkMapper *mapper) { //TODO: implement } void mitk::ConnectomicsNetworkMapper3D::UpdateVtkObjects() { //TODO: implement } vtkProp* mitk::ConnectomicsNetworkMapper3D::GetVtkProp(mitk::BaseRenderer *renderer) { return m_NetworkAssembly; } + +bool mitk::ConnectomicsNetworkMapper3D::PropertiesChanged() +{ + mitk::ConnectomicsRenderingSchemeProperty * renderingScheme = + static_cast< mitk::ConnectomicsRenderingSchemeProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingSchemePropertyName.c_str() ) ); + mitk::ConnectomicsRenderingEdgeFilteringProperty * edgeFilter = + static_cast< mitk::ConnectomicsRenderingEdgeFilteringProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingEdgeFilteringPropertyName.c_str() ) ); + mitk::FloatProperty * edgeThreshold = static_cast< mitk::FloatProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingEdgeThresholdFilterThresholdName.c_str() ) ); + mitk::ConnectomicsRenderingNodeFilteringProperty * nodeFilter = + static_cast< mitk::ConnectomicsRenderingNodeFilteringProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingNodeFilteringPropertyName.c_str() ) ); + + mitk::ConnectomicsRenderingNodeThresholdParameterProperty * nodeThresholdParameter = + static_cast< mitk::ConnectomicsRenderingNodeThresholdParameterProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingNodeThresholdFilterParameterName.c_str() ) ); + mitk::ConnectomicsRenderingEdgeThresholdParameterProperty * edgeThresholdParameter = + static_cast< mitk::ConnectomicsRenderingEdgeThresholdParameterProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingEdgeThresholdFilterParameterName.c_str() ) ); + + mitk::FloatProperty * nodeThreshold = static_cast< mitk::FloatProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingNodeThresholdFilterThresholdName.c_str() ) ); + mitk::ColorProperty * nodeColorStart = static_cast< mitk::ColorProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingNodeGradientStartColorName.c_str() ) ); + mitk::ColorProperty * nodeColorEnd = static_cast< mitk::ColorProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingNodeGradientEndColorName.c_str() ) ); + mitk::FloatProperty * nodeRadiusStart = static_cast< mitk::FloatProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingNodeRadiusStartName.c_str() ) ); + mitk::FloatProperty * nodeRadiusEnd = static_cast< mitk::FloatProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingNodeRadiusEndName.c_str() ) ); + mitk::StringProperty * chosenNode = static_cast< mitk::StringProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingNodeChosenNodeName.c_str() ) ); + mitk::ColorProperty * edgeColorStart = static_cast< mitk::ColorProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingEdgeGradientStartColorName.c_str() ) ); + mitk::ColorProperty * edgeColorEnd = static_cast< mitk::ColorProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingEdgeGradientEndColorName.c_str() ) ); + mitk::FloatProperty * edgeRadiusStart = static_cast< mitk::FloatProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingEdgeRadiusStartName.c_str() ) ); + mitk::FloatProperty * edgeRadiusEnd = static_cast< mitk::FloatProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingEdgeRadiusEndName.c_str() ) ); + mitk::ConnectomicsRenderingNodeColorParameterProperty * nodeColorParameter = + static_cast< mitk::ConnectomicsRenderingNodeColorParameterProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingNodeGradientColorParameterName.c_str() ) ); + mitk::ConnectomicsRenderingNodeRadiusParameterProperty * nodeRadiusParameter = + static_cast< mitk::ConnectomicsRenderingNodeRadiusParameterProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingNodeRadiusParameterName.c_str() ) ); + mitk::ConnectomicsRenderingEdgeColorParameterProperty * edgeColorParameter = + static_cast< mitk::ConnectomicsRenderingEdgeColorParameterProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingEdgeGradientColorParameterName.c_str() ) ); + mitk::ConnectomicsRenderingEdgeRadiusParameterProperty * edgeRadiusParameter = + static_cast< mitk::ConnectomicsRenderingEdgeRadiusParameterProperty * > ( + this->GetDataNode()->GetProperty( connectomicsRenderingEdgeRadiusParameterName.c_str() ) ); + + if( + m_ChosenRenderingScheme != renderingScheme->GetValueAsString() || + m_ChosenEdgeFilter != edgeFilter->GetValueAsString() || + m_EdgeThreshold != edgeThreshold->GetValue() || + m_EdgeThresholdParameter != edgeThresholdParameter->GetValueAsString() || + m_ChosenNodeFilter != nodeFilter->GetValueAsString() || + m_NodeThreshold != nodeThreshold->GetValue() || + m_NodeThresholdParameter != nodeThresholdParameter->GetValueAsString() || + m_NodeColorStart != nodeColorStart->GetValue() || + m_NodeColorEnd != nodeColorEnd->GetValue() || + m_NodeRadiusStart != nodeRadiusStart->GetValue() || + m_NodeRadiusEnd != nodeRadiusEnd->GetValue() || + m_ChosenNodeLabel != chosenNode->GetValueAsString() || + m_EdgeColorStart != edgeColorStart->GetValue() || + m_EdgeColorEnd != edgeColorEnd->GetValue() || + m_EdgeRadiusStart != edgeRadiusStart->GetValue() || + m_EdgeRadiusEnd != edgeRadiusEnd->GetValue() || + m_NodeColorParameter != nodeColorParameter->GetValueAsString() || + m_NodeRadiusParameter != nodeRadiusParameter->GetValueAsString() || + m_EdgeColorParameter != edgeColorParameter->GetValueAsString() || + m_EdgeRadiusParameter != edgeRadiusParameter->GetValueAsString() + ) + { + m_ChosenRenderingScheme = renderingScheme->GetValueAsString(); + m_ChosenEdgeFilter = edgeFilter->GetValueAsString(); + m_EdgeThreshold = edgeThreshold->GetValue(); + m_EdgeThresholdParameter = edgeThresholdParameter->GetValueAsString(); + m_ChosenNodeFilter = nodeFilter->GetValueAsString(); + m_NodeThreshold = nodeThreshold->GetValue(); + m_NodeThresholdParameter = nodeThresholdParameter->GetValueAsString(); + m_NodeColorStart = nodeColorStart->GetValue(); + m_NodeColorEnd = nodeColorEnd->GetValue(); + m_NodeRadiusStart = nodeRadiusStart->GetValue(); + m_NodeRadiusEnd = nodeRadiusEnd->GetValue(); + m_ChosenNodeLabel = chosenNode->GetValueAsString(); + m_EdgeColorStart = edgeColorStart->GetValue(); + m_EdgeColorEnd = edgeColorEnd->GetValue(); + m_EdgeRadiusStart = edgeRadiusStart->GetValue(); + m_EdgeRadiusEnd = edgeRadiusEnd->GetValue(); + m_NodeColorParameter = nodeColorParameter->GetValueAsString(); + m_NodeRadiusParameter = nodeRadiusParameter->GetValueAsString(); + m_EdgeColorParameter = edgeColorParameter->GetValueAsString(); + m_EdgeRadiusParameter = edgeRadiusParameter->GetValueAsString(); + + return true; + } + + return false; + +} + +double mitk::ConnectomicsNetworkMapper3D::FillNodeParameterVector( std::vector< double > * parameterVector, std::string parameterName ) +{ + int end( parameterVector->size() ); + + // constant parameter - uniform style + if( parameterName == connectomicsRenderingNodeParameterConstant ) + { + for(int index(0); index < end; index++) + { + parameterVector->at( index ) = 1.0; + } + return 1.0; + } + + double maximum( 0.0 ); + + // using the degree as parameter + if( parameterName == connectomicsRenderingNodeParameterDegree ) + { + std::vector< int > vectorOfDegree = this->GetInput()->GetDegreeOfNodes(); + for(int index(0); index < end; index++) + { + parameterVector->at( index ) = vectorOfDegree[ index ]; + } + + maximum = *std::max_element( parameterVector->begin(), parameterVector->end() ); + } + + // using betweenness centrality as parameter + if( parameterName == connectomicsRenderingNodeParameterBetweenness ) + { + std::vector< double > vectorOfBetweenness = this->GetInput()->GetNodeBetweennessVector(); + for(int index(0); index < end; index++) + { + parameterVector->at( index ) = vectorOfBetweenness[index]; + } + maximum = *std::max_element( parameterVector->begin(), parameterVector->end() ); + } + + // using clustering coefficient as parameter + if( parameterName == connectomicsRenderingNodeParameterClustering ) + { + const std::vector< double > vectorOfClustering = this->GetInput()->GetLocalClusteringCoefficients(); + for(int index(0); index < end; index++) + { + parameterVector->at( index ) = vectorOfClustering[index]; + } + maximum = *std::max_element( parameterVector->begin(), parameterVector->end() ); + } + + // using distance to a specific node as parameter + if( parameterName == connectomicsRenderingNodeParameterColoringShortestPath ) + { + bool labelFound( this->GetInput()->CheckForLabel( m_ChosenNodeLabel ) ); + // check whether the chosen node is valid + if( !labelFound ) + { + MITK_WARN << "Node chosen for rendering is not valid."; + for(int index(0); index < end; index++) + { + parameterVector->at( index ) = 1.0; + } + return 1.0; + } + else + { + const std::vector< double > distanceVector = this->GetInput()->GetShortestDistanceVectorFromLabel( m_ChosenNodeLabel ); + for(int index(0); index < end; index++) + { + parameterVector->at( index ) = distanceVector[index]; + } + maximum = *std::max_element( parameterVector->begin(), parameterVector->end() ); + } + } + + // if the maximum is nearly zero + if( std::abs( maximum ) < mitk::eps ) + { + maximum = 1.0; + } + + return maximum; +} + +double mitk::ConnectomicsNetworkMapper3D::FillEdgeParameterVector( std::vector< double > * parameterVector, std::string parameterName ) +{ + int end( parameterVector->size() ); + + // constant parameter - uniform style + if( parameterName == connectomicsRenderingEdgeParameterConstant ) + { + for(int index(0); index < end; index++) + { + parameterVector->at( index ) = 1.0; + } + return 1.0; + } + + double maximum( 0.0 ); + + // using the weight as parameter + if( parameterName == connectomicsRenderingEdgeParameterWeight ) + { + std::vector< std::pair< + std::pair< mitk::ConnectomicsNetwork::NetworkNode, mitk::ConnectomicsNetwork::NetworkNode > + , mitk::ConnectomicsNetwork::NetworkEdge > > vectorOfEdges = this->GetInput()->GetVectorOfAllEdges(); + + for(int index(0); index < end; index++) + { + parameterVector->at( index ) = vectorOfEdges[ index ].second.weight; + } + + maximum = *std::max_element( parameterVector->begin(), parameterVector->end() ); + } + + // using the edge centrality as parameter + if( parameterName == connectomicsRenderingEdgeParameterCentrality ) + { + const std::vector< double > vectorOfCentrality = this->GetInput()->GetEdgeBetweennessVector(); + for(int index(0); index < end; index++) + { + parameterVector->at( index ) = vectorOfCentrality[index]; + } + + maximum = *std::max_element( parameterVector->begin(), parameterVector->end() ); + } + + // if the maximum is nearly zero + if( std::abs( maximum ) < mitk::eps ) + { + maximum = 1.0; + } + + return maximum; +} + +void mitk::ConnectomicsNetworkMapper3D::FillNodeFilterBoolVector( std::vector< bool > * boolVector, std::string parameterName ) +{ + std::vector< double > parameterVector; + parameterVector.resize( boolVector->size() ); + int end( parameterVector.size() ); + + // using the degree as parameter + if( parameterName == connectomicsRenderingNodeParameterDegree ) + { + std::vector< int > vectorOfDegree = this->GetInput()->GetDegreeOfNodes(); + for(int index(0); index < end; index++) + { + parameterVector.at( index ) = vectorOfDegree[ index ]; + } + } + + // using betweenness centrality as parameter + if( parameterName == connectomicsRenderingNodeParameterBetweenness ) + { + std::vector< double > vectorOfBetweenness = this->GetInput()->GetNodeBetweennessVector(); + for(int index(0); index < end; index++) + { + parameterVector.at( index ) = vectorOfBetweenness[index]; + } + } + + // using clustering coefficient as parameter + if( parameterName == connectomicsRenderingNodeParameterClustering ) + { + const std::vector< double > vectorOfClustering = this->GetInput()->GetLocalClusteringCoefficients(); + for(int index(0); index < end; index++) + { + parameterVector.at( index ) = vectorOfClustering[index]; + } + } + + for( int index( 0 ), end( boolVector->size() ); index < end; index++ ) + { + if( parameterVector.at( index ) >= m_NodeThreshold ) + { + boolVector->at( index ) = true; + } + else + { + boolVector->at( index ) = false; + } + } + + return; + +} + +void mitk::ConnectomicsNetworkMapper3D::FillEdgeFilterBoolVector( std::vector< bool > * boolVector, std::string parameterName ) +{ + std::vector< double > parameterVector; + parameterVector.resize( boolVector->size() ); + int end( parameterVector.size() ); + + + // using the weight as parameter + if( parameterName == connectomicsRenderingEdgeParameterWeight ) + { + std::vector< std::pair< + std::pair< mitk::ConnectomicsNetwork::NetworkNode, mitk::ConnectomicsNetwork::NetworkNode > + , mitk::ConnectomicsNetwork::NetworkEdge > > vectorOfEdges = this->GetInput()->GetVectorOfAllEdges(); + + for(int index(0); index < end; index++) + { + parameterVector.at( index ) = vectorOfEdges[ index ].second.weight; + } + } + + // using the edge centrality as parameter + if( parameterName == connectomicsRenderingEdgeParameterCentrality ) + { + const std::vector< double > vectorOfCentrality = this->GetInput()->GetEdgeBetweennessVector(); + for(int index(0); index < end; index++) + { + parameterVector.at( index ) = vectorOfCentrality[index]; + } + } + + for( int index( 0 ), end( boolVector->size() ); index < end; index++ ) + { + if( parameterVector.at( index ) >= m_EdgeThreshold ) + { + boolVector->at( index ) = true; + } + else + { + boolVector->at( index ) = false; + } + } + + return; +} diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsNetworkMapper3D.h b/Modules/DiffusionImaging/Rendering/mitkConnectomicsNetworkMapper3D.h index ff2653f0fb..bdd93dd0c9 100644 --- a/Modules/DiffusionImaging/Rendering/mitkConnectomicsNetworkMapper3D.h +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsNetworkMapper3D.h @@ -1,107 +1,136 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef ConnectomicsNetworkMapper3D_H_HEADER_INCLUDED #define ConnectomicsNetworkMapper3D_H_HEADER_INCLUDED // VTK includes #include #include "vtkPropAssembly.h" // MITK includes // base class #include "mitkVtkMapper3D.h" // data type #include "mitkConnectomicsNetwork.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "MitkDiffusionImagingExports.h" namespace mitk { /** * \brief Mapper for Networks * \ingroup Mapper */ class MitkDiffusionImaging_EXPORT ConnectomicsNetworkMapper3D : public VtkMapper3D { public: mitkClassMacro(ConnectomicsNetworkMapper3D, VtkMapper3D); itkNewMacro(Self); virtual vtkProp *GetVtkProp(mitk::BaseRenderer *renderer); //looks like deprecated.. should be replaced bz GetViewProp() static void SetDefaultProperties(DataNode* node, BaseRenderer* renderer = NULL, bool overwrite = false ); virtual void ApplyProperties(mitk::BaseRenderer* renderer); static void SetVtkMapperImmediateModeRendering(vtkMapper *mapper); virtual void GenerateDataForRenderer(mitk::BaseRenderer* renderer); virtual void GenerateData(); virtual const mitk::ConnectomicsNetwork* GetInput(); protected: ConnectomicsNetworkMapper3D(); virtual ~ConnectomicsNetworkMapper3D(); void UpdateVtkObjects(); vtkPropAssembly *m_NetworkAssembly; - - - - + /** + * \brief Returns true if the properties have changed since the last data generation + */ + bool PropertiesChanged(); + + // Create vectors for customizing color and radius and return maximum + double FillNodeParameterVector( std::vector< double > * parameterVector, std::string parameterName ); + double FillEdgeParameterVector( std::vector< double > * parameterVector, std::string parameterName ); + + void FillNodeFilterBoolVector( std::vector< bool > * boolVector, std::string parameterName ); + void FillEdgeFilterBoolVector( std::vector< bool > * boolVector, std::string parameterName ); + + // Property storing members + std::string m_ChosenRenderingScheme; + std::string m_ChosenEdgeFilter; + std::string m_EdgeThresholdParameter; + double m_EdgeThreshold; + std::string m_ChosenNodeFilter; + std::string m_NodeThresholdParameter; + double m_NodeThreshold; + mitk::Color m_NodeColorStart; + mitk::Color m_NodeColorEnd; + double m_NodeRadiusStart; + double m_NodeRadiusEnd; + std::string m_ChosenNodeLabel; + mitk::Color m_EdgeColorStart; + mitk::Color m_EdgeColorEnd; + double m_EdgeRadiusStart; + double m_EdgeRadiusEnd; + std::string m_NodeRadiusParameter; + std::string m_NodeColorParameter; + std::string m_EdgeRadiusParameter; + std::string m_EdgeColorParameter; }; } // namespace mitk #endif /* ConnectomicsNetworkMapper3D_H_HEADER_INCLUDED */ diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.cpp b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.cpp new file mode 100644 index 0000000000..8dc1881b2b --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.cpp @@ -0,0 +1,70 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "mitkConnectomicsRenderingEdgeColorParameterProperty.h" +#include "mitkConnectomicsRenderingProperties.h" + +#define EDGE_COLOR_CONSTANT 0 +#define EDGE_COLOR_WEIGHT 1 +#define EDGE_COLOR_CENTRALITY 2 + +mitk::ConnectomicsRenderingEdgeColorParameterProperty::ConnectomicsRenderingEdgeColorParameterProperty( ) +{ + AddRenderingEdgeColorParameters(); + SetValue( EDGE_COLOR_CONSTANT ); +} + + +mitk::ConnectomicsRenderingEdgeColorParameterProperty::ConnectomicsRenderingEdgeColorParameterProperty( const IdType& value ) +{ + AddRenderingEdgeColorParameters(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ) ; + } + else + { + SetValue( EDGE_COLOR_CONSTANT ); + } +} + +mitk::ConnectomicsRenderingEdgeColorParameterProperty::ConnectomicsRenderingEdgeColorParameterProperty( const std::string& value ) +{ + AddRenderingEdgeColorParameters(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ); + } + else + { + SetValue( EDGE_COLOR_CONSTANT ); + } +} + + + +void mitk::ConnectomicsRenderingEdgeColorParameterProperty::AddRenderingEdgeColorParameters() +{ + AddEnum( connectomicsRenderingEdgeParameterConstant , EDGE_COLOR_CONSTANT ); + AddEnum( connectomicsRenderingEdgeParameterWeight , EDGE_COLOR_WEIGHT ); + AddEnum( connectomicsRenderingEdgeParameterCentrality , EDGE_COLOR_CENTRALITY ); +} + + +bool mitk::ConnectomicsRenderingEdgeColorParameterProperty::AddEnum( const std::string& name, const IdType& id ) +{ + return Superclass::AddEnum( name, id ); +} diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.h b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.h new file mode 100644 index 0000000000..46faf6c0f8 --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.h @@ -0,0 +1,94 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#ifndef _MITK_CONNECTOMICS_RENDERING_EDGE_COLOR_PARAMETER_PROPERTY__H_ +#define _MITK_CONNECTOMICS_RENDERING_EDGE_COLOR_PARAMETER_PROPERTY__H_ + +#include "mitkEnumerationProperty.h" +#include "MitkDiffusionImagingExports.h" + +namespace mitk +{ + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable: 4522) +#endif + +/** + * Encapsulates the enumeration of different rendering schemes for connectomics networks + */ +class MitkDiffusionImaging_EXPORT ConnectomicsRenderingEdgeColorParameterProperty : public EnumerationProperty +{ +public: + + mitkClassMacro( ConnectomicsRenderingEdgeColorParameterProperty, EnumerationProperty ); + + itkNewMacro(ConnectomicsRenderingEdgeColorParameterProperty); + + mitkNewMacro1Param(ConnectomicsRenderingEdgeColorParameterProperty, const IdType&); + + mitkNewMacro1Param(ConnectomicsRenderingEdgeColorParameterProperty, const std::string&); + + using BaseProperty::operator=; + +protected: + + /** + * Constructor. Sets the representation to a default value of 0 + */ + ConnectomicsRenderingEdgeColorParameterProperty( ); + + /** + * Constructor. Sets the parameter to the given value. If it is not + * valid, the value is set to 0 + * @param value the integer representation of the parameter + */ + ConnectomicsRenderingEdgeColorParameterProperty( const IdType& value ); + + /** + * Constructor. Sets the parameter to the given value. If it is not + * valid, the value is set to 0 + * @param value the string representation of the parameter + */ + ConnectomicsRenderingEdgeColorParameterProperty( const std::string& value ); + + /** + * this function is overridden as protected, so that the user may not add + * additional enumerations. + */ + virtual bool AddEnum( const std::string& name, const IdType& id ); + + /** + * Adds the enumeration types as defined by vtk to the list of known + * enumeration values. + */ + virtual void AddRenderingEdgeColorParameters(); + +private: + + // purposely not implemented + ConnectomicsRenderingEdgeColorParameterProperty(const ConnectomicsRenderingEdgeColorParameterProperty&); + ConnectomicsRenderingEdgeColorParameterProperty& operator=(const ConnectomicsRenderingEdgeColorParameterProperty&); +}; + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +} // end of namespace mitk + +#endif diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.cpp b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.cpp new file mode 100644 index 0000000000..dd2630ed13 --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.cpp @@ -0,0 +1,70 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "mitkConnectomicsRenderingEdgeFilteringProperty.h" +#include "mitkConnectomicsRenderingProperties.h" + +#define NO_FILTER 0 +#define SHORTEST_PATH_FILTER 1 +#define THRESHOLDING_FILTER 2 + +mitk::ConnectomicsRenderingEdgeFilteringProperty::ConnectomicsRenderingEdgeFilteringProperty( ) +{ + AddRenderingFilter(); + SetValue( NO_FILTER ); +} + + +mitk::ConnectomicsRenderingEdgeFilteringProperty::ConnectomicsRenderingEdgeFilteringProperty( const IdType& value ) +{ + AddRenderingFilter(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ) ; + } + else + { + SetValue( NO_FILTER ); + } +} + +mitk::ConnectomicsRenderingEdgeFilteringProperty::ConnectomicsRenderingEdgeFilteringProperty( const std::string& value ) +{ + AddRenderingFilter(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ); + } + else + { + SetValue( NO_FILTER ); + } +} + + + +void mitk::ConnectomicsRenderingEdgeFilteringProperty::AddRenderingFilter() +{ + AddEnum( connectomicsRenderingEdgeNoFilter, NO_FILTER ); + //AddEnum( connectomicsRenderingEdgeShortestPathFilter, SHORTEST_PATH_FILTER ); + AddEnum( connectomicsRenderingEdgeThresholdFilter, THRESHOLDING_FILTER ); +} + + +bool mitk::ConnectomicsRenderingEdgeFilteringProperty::AddEnum( const std::string& name, const IdType& id ) +{ + return Superclass::AddEnum( name, id ); +} diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.h b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.h new file mode 100644 index 0000000000..479986d5f7 --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.h @@ -0,0 +1,94 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#ifndef _MITK_CONNECTOMICS_RENDERING_EDGE_FILTERING_PROPERTY__H_ +#define _MITK_CONNECTOMICS_RENDERING_EDGE_FILTERING_PROPERTY__H_ + +#include "mitkEnumerationProperty.h" +#include "MitkDiffusionImagingExports.h" + +namespace mitk +{ + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable: 4522) +#endif + +/** + * Encapsulates the enumeration of different edge filtering options for rendering connectomics networks + */ +class MitkDiffusionImaging_EXPORT ConnectomicsRenderingEdgeFilteringProperty : public EnumerationProperty +{ +public: + + mitkClassMacro( ConnectomicsRenderingEdgeFilteringProperty, EnumerationProperty ); + + itkNewMacro(ConnectomicsRenderingEdgeFilteringProperty); + + mitkNewMacro1Param(ConnectomicsRenderingEdgeFilteringProperty, const IdType&); + + mitkNewMacro1Param(ConnectomicsRenderingEdgeFilteringProperty, const std::string&); + + using BaseProperty::operator=; + +protected: + + /** + * Constructor. Sets the representation to a default value of 0 + */ + ConnectomicsRenderingEdgeFilteringProperty( ); + + /** + * Constructor. Sets the filter to the given value. If it is not + * valid, the value is set to 0 + * @param value the integer representation of the filter + */ + ConnectomicsRenderingEdgeFilteringProperty( const IdType& value ); + + /** + * Constructor. Sets the filter to the given value. If it is not + * valid, the value is set to 0 + * @param value the string representation of the filter + */ + ConnectomicsRenderingEdgeFilteringProperty( const std::string& value ); + + /** + * this function is overridden as protected, so that the user may not add + * additional enumerations. + */ + virtual bool AddEnum( const std::string& name, const IdType& id ); + + /** + * Adds the enumeration types as defined by vtk to the list of known + * enumeration values. + */ + virtual void AddRenderingFilter(); + +private: + + // purposely not implemented + ConnectomicsRenderingEdgeFilteringProperty(const ConnectomicsRenderingEdgeFilteringProperty&); + ConnectomicsRenderingEdgeFilteringProperty& operator=(const ConnectomicsRenderingEdgeFilteringProperty&); +}; + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +} // end of namespace mitk + +#endif diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.cpp b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.cpp new file mode 100644 index 0000000000..c71385669a --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.cpp @@ -0,0 +1,70 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "mitkConnectomicsRenderingEdgeRadiusParameterProperty.h" +#include "mitkConnectomicsRenderingProperties.h" + +#define EDGE_RADIUS_CONSTANT 0 +#define EDGE_RADIUS_WEIGHT 1 +#define EDGE_RADIUS_CENTRALITY 2 + +mitk::ConnectomicsRenderingEdgeRadiusParameterProperty::ConnectomicsRenderingEdgeRadiusParameterProperty( ) +{ + AddRenderingEdgeRadiusParameters(); + SetValue( EDGE_RADIUS_CONSTANT ); +} + + +mitk::ConnectomicsRenderingEdgeRadiusParameterProperty::ConnectomicsRenderingEdgeRadiusParameterProperty( const IdType& value ) +{ + AddRenderingEdgeRadiusParameters(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ) ; + } + else + { + SetValue( EDGE_RADIUS_CONSTANT ); + } +} + +mitk::ConnectomicsRenderingEdgeRadiusParameterProperty::ConnectomicsRenderingEdgeRadiusParameterProperty( const std::string& value ) +{ + AddRenderingEdgeRadiusParameters(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ); + } + else + { + SetValue( EDGE_RADIUS_CONSTANT ); + } +} + + + +void mitk::ConnectomicsRenderingEdgeRadiusParameterProperty::AddRenderingEdgeRadiusParameters() +{ + AddEnum( connectomicsRenderingEdgeParameterConstant , EDGE_RADIUS_CONSTANT ); + AddEnum( connectomicsRenderingEdgeParameterWeight , EDGE_RADIUS_WEIGHT ); + AddEnum( connectomicsRenderingEdgeParameterCentrality , EDGE_RADIUS_CENTRALITY ); +} + + +bool mitk::ConnectomicsRenderingEdgeRadiusParameterProperty::AddEnum( const std::string& name, const IdType& id ) +{ + return Superclass::AddEnum( name, id ); +} diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.h b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.h new file mode 100644 index 0000000000..0c24abcd20 --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.h @@ -0,0 +1,94 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#ifndef _MITK_CONNECTOMICS_RENDERING_EDGE_RADIUS_PARAMETER_PROPERTY__H_ +#define _MITK_CONNECTOMICS_RENDERING_EDGE_RADIUS_PARAMETER_PROPERTY__H_ + +#include "mitkEnumerationProperty.h" +#include "MitkDiffusionImagingExports.h" + +namespace mitk +{ + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable: 4522) +#endif + +/** + * Encapsulates the enumeration of different rendering schemes for connectomics networks + */ +class MitkDiffusionImaging_EXPORT ConnectomicsRenderingEdgeRadiusParameterProperty : public EnumerationProperty +{ +public: + + mitkClassMacro( ConnectomicsRenderingEdgeRadiusParameterProperty, EnumerationProperty ); + + itkNewMacro(ConnectomicsRenderingEdgeRadiusParameterProperty); + + mitkNewMacro1Param(ConnectomicsRenderingEdgeRadiusParameterProperty, const IdType&); + + mitkNewMacro1Param(ConnectomicsRenderingEdgeRadiusParameterProperty, const std::string&); + + using BaseProperty::operator=; + +protected: + + /** + * Constructor. Sets the representation to a default value of 0 + */ + ConnectomicsRenderingEdgeRadiusParameterProperty( ); + + /** + * Constructor. Sets the parameter to the given value. If it is not + * valid, the value is set to 0 + * @param value the integer representation of the parameter + */ + ConnectomicsRenderingEdgeRadiusParameterProperty( const IdType& value ); + + /** + * Constructor. Sets the parameter to the given value. If it is not + * valid, the value is set to 0 + * @param value the string representation of the parameter + */ + ConnectomicsRenderingEdgeRadiusParameterProperty( const std::string& value ); + + /** + * this function is overridden as protected, so that the user may not add + * additional enumerations. + */ + virtual bool AddEnum( const std::string& name, const IdType& id ); + + /** + * Adds the enumeration types as defined by vtk to the list of known + * enumeration values. + */ + virtual void AddRenderingEdgeRadiusParameters(); + +private: + + // purposely not implemented + ConnectomicsRenderingEdgeRadiusParameterProperty(const ConnectomicsRenderingEdgeRadiusParameterProperty&); + ConnectomicsRenderingEdgeRadiusParameterProperty& operator=(const ConnectomicsRenderingEdgeRadiusParameterProperty&); +}; + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +} // end of namespace mitk + +#endif diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.cpp b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.cpp new file mode 100644 index 0000000000..0241e2bb13 --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.cpp @@ -0,0 +1,68 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "mitkConnectomicsRenderingEdgeThresholdParameterProperty.h" +#include "mitkConnectomicsRenderingProperties.h" + +#define EDGE_THRESHOLD_WEIGHT 0 +#define EDGE_THRESHOLD_CENTRALITY 1 + +mitk::ConnectomicsRenderingEdgeThresholdParameterProperty::ConnectomicsRenderingEdgeThresholdParameterProperty( ) +{ + AddRenderingEdgeThresholdParameters(); + SetValue( EDGE_THRESHOLD_WEIGHT ); +} + + +mitk::ConnectomicsRenderingEdgeThresholdParameterProperty::ConnectomicsRenderingEdgeThresholdParameterProperty( const IdType& value ) +{ + AddRenderingEdgeThresholdParameters(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ) ; + } + else + { + SetValue( EDGE_THRESHOLD_WEIGHT ); + } +} + +mitk::ConnectomicsRenderingEdgeThresholdParameterProperty::ConnectomicsRenderingEdgeThresholdParameterProperty( const std::string& value ) +{ + AddRenderingEdgeThresholdParameters(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ); + } + else + { + SetValue( EDGE_THRESHOLD_WEIGHT ); + } +} + + + +void mitk::ConnectomicsRenderingEdgeThresholdParameterProperty::AddRenderingEdgeThresholdParameters() +{ + AddEnum( connectomicsRenderingEdgeParameterWeight , EDGE_THRESHOLD_WEIGHT ); + AddEnum( connectomicsRenderingEdgeParameterCentrality , EDGE_THRESHOLD_CENTRALITY ); +} + + +bool mitk::ConnectomicsRenderingEdgeThresholdParameterProperty::AddEnum( const std::string& name, const IdType& id ) +{ + return Superclass::AddEnum( name, id ); +} diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.h b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.h new file mode 100644 index 0000000000..3a0d7bef6e --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.h @@ -0,0 +1,94 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#ifndef _MITK_CONNECTOMICS_RENDERING_EDGE_THRESHOLD_PARAMETER_PROPERTY__H_ +#define _MITK_CONNECTOMICS_RENDERING_EDGE_THRESHOLD_PARAMETER_PROPERTY__H_ + +#include "mitkEnumerationProperty.h" +#include "MitkDiffusionImagingExports.h" + +namespace mitk +{ + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable: 4522) +#endif + +/** + * Encapsulates the enumeration of different rendering schemes for connectomics networks + */ +class MitkDiffusionImaging_EXPORT ConnectomicsRenderingEdgeThresholdParameterProperty : public EnumerationProperty +{ +public: + + mitkClassMacro( ConnectomicsRenderingEdgeThresholdParameterProperty, EnumerationProperty ); + + itkNewMacro(ConnectomicsRenderingEdgeThresholdParameterProperty); + + mitkNewMacro1Param(ConnectomicsRenderingEdgeThresholdParameterProperty, const IdType&); + + mitkNewMacro1Param(ConnectomicsRenderingEdgeThresholdParameterProperty, const std::string&); + + using BaseProperty::operator=; + +protected: + + /** + * Constructor. Sets the representation to a default value of 0 + */ + ConnectomicsRenderingEdgeThresholdParameterProperty( ); + + /** + * Constructor. Sets the parameter to the given value. If it is not + * valid, the value is set to 0 + * @param value the integer representation of the parameter + */ + ConnectomicsRenderingEdgeThresholdParameterProperty( const IdType& value ); + + /** + * Constructor. Sets the parameter to the given value. If it is not + * valid, the value is set to 0 + * @param value the string representation of the parameter + */ + ConnectomicsRenderingEdgeThresholdParameterProperty( const std::string& value ); + + /** + * this function is overridden as protected, so that the user may not add + * additional enumerations. + */ + virtual bool AddEnum( const std::string& name, const IdType& id ); + + /** + * Adds the enumeration types as defined by vtk to the list of known + * enumeration values. + */ + virtual void AddRenderingEdgeThresholdParameters(); + +private: + + // purposely not implemented + ConnectomicsRenderingEdgeThresholdParameterProperty(const ConnectomicsRenderingEdgeThresholdParameterProperty&); + ConnectomicsRenderingEdgeThresholdParameterProperty& operator=(const ConnectomicsRenderingEdgeThresholdParameterProperty&); +}; + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +} // end of namespace mitk + +#endif diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.cpp b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.cpp new file mode 100644 index 0000000000..849fced415 --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.cpp @@ -0,0 +1,71 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "mitkConnectomicsRenderingNodeColorParameterProperty.h" +#include "mitkConnectomicsRenderingProperties.h" + +#define NODE_COLOR_CONSTANT 0 +#define NODE_COLOR_DEGREE 1 +#define NODE_COLOR_BETWEENNESS 2 +#define NODE_COLOR_CLUSTERING 3 +#define NODE_COLOR_SHORTEST_PATH 4 + +mitk::ConnectomicsRenderingNodeColorParameterProperty::ConnectomicsRenderingNodeColorParameterProperty( ) +{ + AddRenderingNodeColorParameters(); + SetValue( NODE_COLOR_CONSTANT ); +} + + +mitk::ConnectomicsRenderingNodeColorParameterProperty::ConnectomicsRenderingNodeColorParameterProperty( const IdType& value ) +{ + AddRenderingNodeColorParameters(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ) ; + } + else + { + SetValue( NODE_COLOR_CONSTANT ); + } +} + +mitk::ConnectomicsRenderingNodeColorParameterProperty::ConnectomicsRenderingNodeColorParameterProperty( const std::string& value ) +{ + AddRenderingNodeColorParameters(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ); + } + else + { + SetValue( NODE_COLOR_CONSTANT ); + } +} + +void mitk::ConnectomicsRenderingNodeColorParameterProperty::AddRenderingNodeColorParameters() +{ + AddEnum( connectomicsRenderingNodeParameterConstant , NODE_COLOR_CONSTANT ); + AddEnum( connectomicsRenderingNodeParameterDegree , NODE_COLOR_DEGREE ); + AddEnum( connectomicsRenderingNodeParameterBetweenness , NODE_COLOR_BETWEENNESS ); + AddEnum( connectomicsRenderingNodeParameterClustering , NODE_COLOR_CLUSTERING ); + AddEnum( connectomicsRenderingNodeParameterColoringShortestPath , NODE_COLOR_SHORTEST_PATH ); +} + +bool mitk::ConnectomicsRenderingNodeColorParameterProperty::AddEnum( const std::string& name, const IdType& id ) +{ + return Superclass::AddEnum( name, id ); +} diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.h b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.h new file mode 100644 index 0000000000..8fb31f7eb8 --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.h @@ -0,0 +1,94 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#ifndef _MITK_CONNECTOMICS_RENDERING_NODE_COLOR_PARAMETER_PROPERTY__H_ +#define _MITK_CONNECTOMICS_RENDERING_NODE_COLOR_PARAMETER_PROPERTY__H_ + +#include "mitkEnumerationProperty.h" +#include "MitkDiffusionImagingExports.h" + +namespace mitk +{ + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable: 4522) +#endif + +/** + * Encapsulates the enumeration of different rendering schemes for connectomics networks + */ +class MitkDiffusionImaging_EXPORT ConnectomicsRenderingNodeColorParameterProperty : public EnumerationProperty +{ +public: + + mitkClassMacro( ConnectomicsRenderingNodeColorParameterProperty, EnumerationProperty ); + + itkNewMacro(ConnectomicsRenderingNodeColorParameterProperty); + + mitkNewMacro1Param(ConnectomicsRenderingNodeColorParameterProperty, const IdType&); + + mitkNewMacro1Param(ConnectomicsRenderingNodeColorParameterProperty, const std::string&); + + using BaseProperty::operator=; + +protected: + + /** + * Constructor. Sets the representation to a default value of 0 + */ + ConnectomicsRenderingNodeColorParameterProperty( ); + + /** + * Constructor. Sets the parameter to the given value. If it is not + * valid, the value is set to 0 + * @param value the integer representation of the parameter + */ + ConnectomicsRenderingNodeColorParameterProperty( const IdType& value ); + + /** + * Constructor. Sets the parameter to the given value. If it is not + * valid, the value is set to 0 + * @param value the string representation of the parameter + */ + ConnectomicsRenderingNodeColorParameterProperty( const std::string& value ); + + /** + * this function is overridden as protected, so that the user may not add + * additional enumerations. + */ + virtual bool AddEnum( const std::string& name, const IdType& id ); + + /** + * Adds the enumeration types as defined by vtk to the list of known + * enumeration values. + */ + virtual void AddRenderingNodeColorParameters(); + +private: + + // purposely not implemented + ConnectomicsRenderingNodeColorParameterProperty(const ConnectomicsRenderingNodeColorParameterProperty&); + ConnectomicsRenderingNodeColorParameterProperty& operator=(const ConnectomicsRenderingNodeColorParameterProperty&); +}; + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +} // end of namespace mitk + +#endif diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeFilteringProperty.cpp b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeFilteringProperty.cpp new file mode 100644 index 0000000000..265785f019 --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeFilteringProperty.cpp @@ -0,0 +1,68 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "mitkConnectomicsRenderingNodeFilteringProperty.h" +#include "mitkConnectomicsRenderingProperties.h" + +#define NO_FILTER 0 +#define THRESHOLDING_FILTER 1 + +mitk::ConnectomicsRenderingNodeFilteringProperty::ConnectomicsRenderingNodeFilteringProperty( ) +{ + AddRenderingFilter(); + SetValue( NO_FILTER ); +} + + +mitk::ConnectomicsRenderingNodeFilteringProperty::ConnectomicsRenderingNodeFilteringProperty( const IdType& value ) +{ + AddRenderingFilter(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ) ; + } + else + { + SetValue( NO_FILTER ); + } +} + +mitk::ConnectomicsRenderingNodeFilteringProperty::ConnectomicsRenderingNodeFilteringProperty( const std::string& value ) +{ + AddRenderingFilter(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ); + } + else + { + SetValue( NO_FILTER ); + } +} + + + +void mitk::ConnectomicsRenderingNodeFilteringProperty::AddRenderingFilter() +{ + AddEnum( connectomicsRenderingNodeNoFilter, NO_FILTER ); + AddEnum( connectomicsRenderingNodeThresholdingFilter, THRESHOLDING_FILTER ); +} + + +bool mitk::ConnectomicsRenderingNodeFilteringProperty::AddEnum( const std::string& name, const IdType& id ) +{ + return Superclass::AddEnum( name, id ); +} diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeFilteringProperty.h b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeFilteringProperty.h new file mode 100644 index 0000000000..b0855549c1 --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeFilteringProperty.h @@ -0,0 +1,94 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#ifndef _MITK_CONNECTOMICS_RENDERING_NODE_FILTERING_PROPERTY__H_ +#define _MITK_CONNECTOMICS_RENDERING_NODE_FILTERING_PROPERTY__H_ + +#include "mitkEnumerationProperty.h" +#include "MitkDiffusionImagingExports.h" + +namespace mitk +{ + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable: 4522) +#endif + +/** + * Encapsulates the enumeration of different node filtering options for rendering connectomics networks + */ +class MitkDiffusionImaging_EXPORT ConnectomicsRenderingNodeFilteringProperty : public EnumerationProperty +{ +public: + + mitkClassMacro( ConnectomicsRenderingNodeFilteringProperty, EnumerationProperty ); + + itkNewMacro(ConnectomicsRenderingNodeFilteringProperty); + + mitkNewMacro1Param(ConnectomicsRenderingNodeFilteringProperty, const IdType&); + + mitkNewMacro1Param(ConnectomicsRenderingNodeFilteringProperty, const std::string&); + + using BaseProperty::operator=; + +protected: + + /** + * Constructor. Sets the representation to a default value of 0 + */ + ConnectomicsRenderingNodeFilteringProperty( ); + + /** + * Constructor. Sets the filter to the given value. If it is not + * valid, the value is set to 0 + * @param value the integer representation of the filter + */ + ConnectomicsRenderingNodeFilteringProperty( const IdType& value ); + + /** + * Constructor. Sets the filter to the given value. If it is not + * valid, the value is set to 0 + * @param value the string representation of the filter + */ + ConnectomicsRenderingNodeFilteringProperty( const std::string& value ); + + /** + * this function is overridden as protected, so that the user may not add + * additional enumerations. + */ + virtual bool AddEnum( const std::string& name, const IdType& id ); + + /** + * Adds the enumeration types as defined by vtk to the list of known + * enumeration values. + */ + virtual void AddRenderingFilter(); + +private: + + // purposely not implemented + ConnectomicsRenderingNodeFilteringProperty(const ConnectomicsRenderingNodeFilteringProperty&); + ConnectomicsRenderingNodeFilteringProperty& operator=(const ConnectomicsRenderingNodeFilteringProperty&); +}; + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +} // end of namespace mitk + +#endif diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.cpp b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.cpp new file mode 100644 index 0000000000..08261cc4a1 --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.cpp @@ -0,0 +1,72 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "mitkConnectomicsRenderingNodeRadiusParameterProperty.h" +#include "mitkConnectomicsRenderingProperties.h" + +#define NODE_RADIUS_CONSTANT 0 +#define NODE_RADIUS_DEGREE 1 +#define NODE_RADIUS_BETWEENNESS 2 +#define NODE_RADIUS_CLUSTERING 3 + +mitk::ConnectomicsRenderingNodeRadiusParameterProperty::ConnectomicsRenderingNodeRadiusParameterProperty( ) +{ + AddRenderingNodeRadiusParameters(); + SetValue( NODE_RADIUS_CONSTANT ); +} + + +mitk::ConnectomicsRenderingNodeRadiusParameterProperty::ConnectomicsRenderingNodeRadiusParameterProperty( const IdType& value ) +{ + AddRenderingNodeRadiusParameters(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ) ; + } + else + { + SetValue( NODE_RADIUS_CONSTANT ); + } +} + +mitk::ConnectomicsRenderingNodeRadiusParameterProperty::ConnectomicsRenderingNodeRadiusParameterProperty( const std::string& value ) +{ + AddRenderingNodeRadiusParameters(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ); + } + else + { + SetValue( NODE_RADIUS_CONSTANT ); + } +} + + + +void mitk::ConnectomicsRenderingNodeRadiusParameterProperty::AddRenderingNodeRadiusParameters() +{ + AddEnum( connectomicsRenderingNodeParameterConstant, NODE_RADIUS_CONSTANT ); + AddEnum( connectomicsRenderingNodeParameterDegree , NODE_RADIUS_DEGREE ); + AddEnum( connectomicsRenderingNodeParameterBetweenness , NODE_RADIUS_BETWEENNESS ); + AddEnum( connectomicsRenderingNodeParameterClustering , NODE_RADIUS_CLUSTERING ); +} + + +bool mitk::ConnectomicsRenderingNodeRadiusParameterProperty::AddEnum( const std::string& name, const IdType& id ) +{ + return Superclass::AddEnum( name, id ); +} diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.h b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.h new file mode 100644 index 0000000000..820c2abd7d --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.h @@ -0,0 +1,94 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#ifndef _MITK_CONNECTOMICS_RENDERING_NODE_RADIUS_PARAMETER_PROPERTY__H_ +#define _MITK_CONNECTOMICS_RENDERING_NODE_RADIUS_PARAMETER_PROPERTY__H_ + +#include "mitkEnumerationProperty.h" +#include "MitkDiffusionImagingExports.h" + +namespace mitk +{ + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable: 4522) +#endif + +/** + * Encapsulates the enumeration of different rendering schemes for connectomics networks + */ +class MitkDiffusionImaging_EXPORT ConnectomicsRenderingNodeRadiusParameterProperty : public EnumerationProperty +{ +public: + + mitkClassMacro( ConnectomicsRenderingNodeRadiusParameterProperty, EnumerationProperty ); + + itkNewMacro(ConnectomicsRenderingNodeRadiusParameterProperty); + + mitkNewMacro1Param(ConnectomicsRenderingNodeRadiusParameterProperty, const IdType&); + + mitkNewMacro1Param(ConnectomicsRenderingNodeRadiusParameterProperty, const std::string&); + + using BaseProperty::operator=; + +protected: + + /** + * Constructor. Sets the representation to a default value of 0 + */ + ConnectomicsRenderingNodeRadiusParameterProperty( ); + + /** + * Constructor. Sets the parameter to the given value. If it is not + * valid, the value is set to 0 + * @param value the integer representation of the parameter + */ + ConnectomicsRenderingNodeRadiusParameterProperty( const IdType& value ); + + /** + * Constructor. Sets the parameter to the given value. If it is not + * valid, the value is set to 0 + * @param value the string representation of the parameter + */ + ConnectomicsRenderingNodeRadiusParameterProperty( const std::string& value ); + + /** + * this function is overridden as protected, so that the user may not add + * additional enumerations. + */ + virtual bool AddEnum( const std::string& name, const IdType& id ); + + /** + * Adds the enumeration types as defined by vtk to the list of known + * enumeration values. + */ + virtual void AddRenderingNodeRadiusParameters(); + +private: + + // purposely not implemented + ConnectomicsRenderingNodeRadiusParameterProperty(const ConnectomicsRenderingNodeRadiusParameterProperty&); + ConnectomicsRenderingNodeRadiusParameterProperty& operator=(const ConnectomicsRenderingNodeRadiusParameterProperty&); +}; + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +} // end of namespace mitk + +#endif diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.cpp b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.cpp new file mode 100644 index 0000000000..0fbb89f439 --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.cpp @@ -0,0 +1,70 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "mitkConnectomicsRenderingNodeThresholdParameterProperty.h" +#include "mitkConnectomicsRenderingProperties.h" + +#define NODE_THRESHOLD_DEGREE 0 +#define NODE_THRESHOLD_BETWEENNESS 1 +#define NODE_THRESHOLD_CLUSTERING 2 + +mitk::ConnectomicsRenderingNodeThresholdParameterProperty::ConnectomicsRenderingNodeThresholdParameterProperty( ) +{ + AddRenderingNodeThresholdParameters(); + SetValue( NODE_THRESHOLD_DEGREE ); +} + + +mitk::ConnectomicsRenderingNodeThresholdParameterProperty::ConnectomicsRenderingNodeThresholdParameterProperty( const IdType& value ) +{ + AddRenderingNodeThresholdParameters(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ) ; + } + else + { + SetValue( NODE_THRESHOLD_DEGREE ); + } +} + +mitk::ConnectomicsRenderingNodeThresholdParameterProperty::ConnectomicsRenderingNodeThresholdParameterProperty( const std::string& value ) +{ + AddRenderingNodeThresholdParameters(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ); + } + else + { + SetValue( NODE_THRESHOLD_DEGREE ); + } +} + + + +void mitk::ConnectomicsRenderingNodeThresholdParameterProperty::AddRenderingNodeThresholdParameters() +{ + AddEnum( connectomicsRenderingNodeParameterDegree , NODE_THRESHOLD_DEGREE ); + AddEnum( connectomicsRenderingNodeParameterBetweenness , NODE_THRESHOLD_BETWEENNESS ); + AddEnum( connectomicsRenderingNodeParameterClustering , NODE_THRESHOLD_CLUSTERING ); +} + + +bool mitk::ConnectomicsRenderingNodeThresholdParameterProperty::AddEnum( const std::string& name, const IdType& id ) +{ + return Superclass::AddEnum( name, id ); +} diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.h b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.h new file mode 100644 index 0000000000..22bef2a13f --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.h @@ -0,0 +1,94 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#ifndef _MITK_CONNECTOMICS_RENDERING_NODE_THRESHOLD_PARAMETER_PROPERTY__H_ +#define _MITK_CONNECTOMICS_RENDERING_NODE_THRESHOLD_PARAMETER_PROPERTY__H_ + +#include "mitkEnumerationProperty.h" +#include "MitkDiffusionImagingExports.h" + +namespace mitk +{ + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable: 4522) +#endif + +/** + * Encapsulates the enumeration of different rendering schemes for connectomics networks + */ +class MitkDiffusionImaging_EXPORT ConnectomicsRenderingNodeThresholdParameterProperty : public EnumerationProperty +{ +public: + + mitkClassMacro( ConnectomicsRenderingNodeThresholdParameterProperty, EnumerationProperty ); + + itkNewMacro(ConnectomicsRenderingNodeThresholdParameterProperty); + + mitkNewMacro1Param(ConnectomicsRenderingNodeThresholdParameterProperty, const IdType&); + + mitkNewMacro1Param(ConnectomicsRenderingNodeThresholdParameterProperty, const std::string&); + + using BaseProperty::operator=; + +protected: + + /** + * Constructor. Sets the representation to a default value of 0 + */ + ConnectomicsRenderingNodeThresholdParameterProperty( ); + + /** + * Constructor. Sets the parameter to the given value. If it is not + * valid, the value is set to 0 + * @param value the integer representation of the parameter + */ + ConnectomicsRenderingNodeThresholdParameterProperty( const IdType& value ); + + /** + * Constructor. Sets the parameter to the given value. If it is not + * valid, the value is set to 0 + * @param value the string representation of the parameter + */ + ConnectomicsRenderingNodeThresholdParameterProperty( const std::string& value ); + + /** + * this function is overridden as protected, so that the user may not add + * additional enumerations. + */ + virtual bool AddEnum( const std::string& name, const IdType& id ); + + /** + * Adds the enumeration types as defined by vtk to the list of known + * enumeration values. + */ + virtual void AddRenderingNodeThresholdParameters(); + +private: + + // purposely not implemented + ConnectomicsRenderingNodeThresholdParameterProperty(const ConnectomicsRenderingNodeThresholdParameterProperty&); + ConnectomicsRenderingNodeThresholdParameterProperty& operator=(const ConnectomicsRenderingNodeThresholdParameterProperty&); +}; + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +} // end of namespace mitk + +#endif diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingProperties.h b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingProperties.h new file mode 100644 index 0000000000..1ac8e5d82b --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingProperties.h @@ -0,0 +1,328 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + + +#ifndef ConnectomicsRenderingProperties_H_HEADER_INCLUDED +#define ConnectomicsRenderingProperties_H_HEADER_INCLUDED + +#include +#include "mitkproperties.h" +#include "mitkStringProperty.h" +#include "mitkEnumerationProperty.h" +#include "mitkColorProperty.h" + +namespace mitk { + + /** \file mitkConnectomicsRenderingProperties.h + * \brief This file defines the rendering properties available for connectomics networks in MITK. + * + * This file collects and explains the properties which can be used to modify the visualisation + * of connectomics networks. + */ + + // Switching between rendering modes + /** + * \brief Define the rendering scheme to be used. + * + * Currently there are two possible rendering schemes in MITK. + *
    + *
  1. The VTK Graph Layout + *
  2. The MITK Connectomics Visualisation - Default + *
+ * + * The VTK Graph Layout is faster than the MITK Connectomics Visualisation, but provides less features + * and settings. + */ + const std::string connectomicsRenderingSchemePropertyName = "Connectomics.Rendering.Scheme"; + + /** + * \brief Much faster but less features. + */ + const std::string connectomicsRenderingVTKScheme = "VTK Graph Layout"; + + /** + * \brief Slower but with several visualisation options. + */ + const std::string connectomicsRenderingMITKScheme = "MITK Connectomics Visualisation"; + + // All options below are only for the MITK Connectomics Visualisation scheme + + //////////////////////////////////////// + // Filtering Options + //////////////////////////////////////// + + /** \brief Edge filter option + * + * This option controls the filtering of edges for visualization purposes. Edges filtered out will not be shown, but still included in calculations. + * + * Currently there these options: + *
    + *
  1. No Edge Filtering - Default + *
  2. Shortest Path to Node + *
  3. Thresholding + *
+ * + */ + const std::string connectomicsRenderingEdgeFilteringPropertyName = "Connectomics.Rendering.Edges.Filtering"; + + /** + * \brief Do not filter edges + */ + const std::string connectomicsRenderingEdgeNoFilter = "No Edge Filtering"; + + /** + * \brief Only show edges which are part of a shortest path to the selected node from any other node + */ + const std::string connectomicsRenderingEdgeShortestPathFilter = "Shortest Path to Node"; + + /** + * \brief Show only edges above a certain parameter threshold + */ + const std::string connectomicsRenderingEdgeThresholdFilter = "Thresholding"; + + /** + * \brief Parameter to be thresholded + */ + const std::string connectomicsRenderingEdgeThresholdFilterParameterName = "Connectomics.Rendering.Edges.Filtering.ThresholdParameter"; + + /** + * \brief Threshold + */ + const std::string connectomicsRenderingEdgeThresholdFilterThresholdName = "Connectomics.Rendering.Edges.Filtering.Threshold"; + + /** \brief Node filter option + * + * This option controls the filtering of nodes for visualization purposes. Nodes filtered out will not be shown, but still included in calculations. + * + * Currently there these options: + *
    + *
  1. No Node Filtering - Default + *
  2. Thresholding + *
+ * + */ + const std::string connectomicsRenderingNodeFilteringPropertyName = "Connectomics.Rendering.Nodes.Filtering"; + + /** + * \brief Do not filter nodes + */ + const std::string connectomicsRenderingNodeNoFilter = "No Node Filtering"; + + /** + * \brief Only show nodes above a certain parameter threshold + */ + const std::string connectomicsRenderingNodeThresholdingFilter = "Thresholding"; + + /** + * \brief Parameter to be thresholded + */ + const std::string connectomicsRenderingNodeThresholdFilterParameterName = "Connectomics.Rendering.Nodes.Filtering.ThresholdParameter"; + + /** + * \brief Threshold + */ + const std::string connectomicsRenderingNodeThresholdFilterThresholdName = "Connectomics.Rendering.Nodes.Filtering.Threshold"; + + // Default values + const mitk::StringProperty::Pointer connectomicsRenderingEdgeThresholdFilterParameterDefault = + mitk::StringProperty::New( "" ); + const mitk::FloatProperty::Pointer connectomicsRenderingEdgeThresholdFilterThresholdDefault = + mitk::FloatProperty::New( 1.0 ); + + const mitk::StringProperty::Pointer connectomicsRenderingNodeThresholdFilterParameterDefault = + mitk::StringProperty::New( "" ); + const mitk::FloatProperty::Pointer connectomicsRenderingNodeThresholdFilterThresholdDefault = + mitk::FloatProperty::New( 1.0 ); + + //////////////////////////////////////// + // Node Options + //////////////////////////////////////// + + // Color gradient + /** + * \brief Start Color + * + * The start color that will be used for gradient creation + */ + const std::string connectomicsRenderingNodeGradientStartColorName = "Connectomics.Rendering.Nodes.Gradient.StartColor"; + + /** + * \brief End Color + * + * The end color that will be used for gradient creation + */ + const std::string connectomicsRenderingNodeGradientEndColorName = "Connectomics.Rendering.Nodes.Gradient.EndColor"; + + /** + * \brief Color parameter + * + * This parameter will be used to select the color of the node. + */ + const std::string connectomicsRenderingNodeGradientColorParameterName = "Connectomics.Rendering.Nodes.Gradient.Parameter"; + + /** + * \brief The chosen node label + * + * This node will be used for any visualisation requiring a specific node + */ + const std::string connectomicsRenderingNodeChosenNodeName = "Connectomics.Rendering.Nodes.ChosenNode"; + + // Radius + /** + * \brief Start Radius + * + * The start radius that will be used + */ + const std::string connectomicsRenderingNodeRadiusStartName = "Connectomics.Rendering.Nodes.Radius.Start"; + + /** + * \brief End Radius + * + * The end radius that will be used + */ + const std::string connectomicsRenderingNodeRadiusEndName = "Connectomics.Rendering.Nodes.Radius.End"; + + /** + * \brief Radius parameter + * + * This parameter will be used to select the radius of the node. + */ + const std::string connectomicsRenderingNodeRadiusParameterName = "Connectomics.Rendering.Nodes.Radius.Parameter"; + + // Possible parameters + /** + * \brief Using the node degree as parameter + */ + const std::string connectomicsRenderingNodeParameterDegree = "Degree"; + + /** + * \brief Using the node betweenness as parameter + */ + const std::string connectomicsRenderingNodeParameterBetweenness = "Betweenness centrality"; + + /** + * \brief Using the node clustering coefficient as parameter + */ + const std::string connectomicsRenderingNodeParameterClustering = "Clustering coefficient"; + + /** + * \brief Color nodes by shortest path length to a chosen node + */ + const std::string connectomicsRenderingNodeParameterColoringShortestPath = "Shortest Path Steps"; + + /** + * \brief Constant + * + * The node property will be constant. + */ + const std::string connectomicsRenderingNodeParameterConstant = "Constant"; + + // Default values + const mitk::StringProperty::Pointer connectomicsRenderingNodeChosenNodeDefault = + mitk::StringProperty::New(""); + + const mitk::ColorProperty::Pointer connectomicsRenderingNodeGradientStartColorDefault = + mitk::ColorProperty::New(0.0f, 0.0f, 1.0f); + const mitk::ColorProperty::Pointer connectomicsRenderingNodeGradientEndColorDefault = + mitk::ColorProperty::New(0.0f, 1.0f, 0.0f); + + const mitk::FloatProperty::Pointer connectomicsRenderingNodeRadiusStartDefault = + mitk::FloatProperty::New( 1.0 ); + const mitk::FloatProperty::Pointer connectomicsRenderingNodeRadiusEndDefault = + mitk::FloatProperty::New( 1.0 ); + + //////////////////////////////////////// + // Edge Options + //////////////////////////////////////// + + + // Color gradient + /** + * \brief Start Color + * + * The start color that will be used for gradient creation + */ + const std::string connectomicsRenderingEdgeGradientStartColorName = "Connectomics.Rendering.Edges.Gradient.StartColor"; + + /** + * \brief End Color + * + * The end color that will be used for gradient creation + */ + const std::string connectomicsRenderingEdgeGradientEndColorName = "Connectomics.Rendering.Edges.Gradient.EndColor"; + + /** + * \brief Color parameter + * + * This parameter will be used to select the color of the edge. + */ + const std::string connectomicsRenderingEdgeGradientColorParameterName = "Connectomics.Rendering.Edges.Gradient.Parameter"; + + // Radius + /** + * \brief Start Radius + * + * The start radius that will be used + */ + const std::string connectomicsRenderingEdgeRadiusStartName = "Connectomics.Rendering.Edges.Radius.Start"; + + /** + * \brief End Radius + * + * The end radius that will be used + */ + const std::string connectomicsRenderingEdgeRadiusEndName = "Connectomics.Rendering.Edges.Radius.End"; + + /** + * \brief Radius parameter + * + * This parameter will be used to select the radius of the edge. + */ + const std::string connectomicsRenderingEdgeRadiusParameterName = "Connectomics.Rendering.Edges.Radius.Parameter"; + + // Possible parameters + /** + * \brief Using the weight as parameter + */ + const std::string connectomicsRenderingEdgeParameterWeight = "Weight"; + + /** + * \brief Using the edge centrality as parameter + */ + const std::string connectomicsRenderingEdgeParameterCentrality = "Edge betweenness centrality"; + + /** + * \brief Constant + * + * The edge property will be constant. + */ + const std::string connectomicsRenderingEdgeParameterConstant = "Constant"; + + // Default values + const mitk::ColorProperty::Pointer connectomicsRenderingEdgeGradientStartColorDefault = + mitk::ColorProperty::New(0.8f, 0.0f, 0.6f); + const mitk::ColorProperty::Pointer connectomicsRenderingEdgeGradientEndColorDefault = + mitk::ColorProperty::New(0.0f, 0.8f, 0.2f); + + const mitk::FloatProperty::Pointer connectomicsRenderingEdgeRadiusStartDefault = + mitk::FloatProperty::New( 0.1 ); + const mitk::FloatProperty::Pointer connectomicsRenderingEdgeRadiusEndDefault = + mitk::FloatProperty::New( 0.4 ); + +} // namespace mitk + + +#endif /* ConnectomicsRenderingProperties_H_HEADER_INCLUDED */ diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingSchemeProperty.cpp b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingSchemeProperty.cpp new file mode 100644 index 0000000000..988fb32bd1 --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingSchemeProperty.cpp @@ -0,0 +1,68 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "mitkConnectomicsRenderingSchemeProperty.h" +#include "mitkConnectomicsRenderingProperties.h" + +#define MITK_SCHEME 0 +#define VTK_SCHEME 1 + +mitk::ConnectomicsRenderingSchemeProperty::ConnectomicsRenderingSchemeProperty( ) +{ + AddRenderingSchemes(); + SetValue( MITK_SCHEME ); +} + + +mitk::ConnectomicsRenderingSchemeProperty::ConnectomicsRenderingSchemeProperty( const IdType& value ) +{ + AddRenderingSchemes(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ) ; + } + else + { + SetValue( MITK_SCHEME ); + } +} + +mitk::ConnectomicsRenderingSchemeProperty::ConnectomicsRenderingSchemeProperty( const std::string& value ) +{ + AddRenderingSchemes(); + if ( IsValidEnumerationValue( value ) ) + { + SetValue( value ); + } + else + { + SetValue( MITK_SCHEME ); + } +} + + + +void mitk::ConnectomicsRenderingSchemeProperty::AddRenderingSchemes() +{ + AddEnum( connectomicsRenderingMITKScheme, MITK_SCHEME ); + AddEnum( connectomicsRenderingVTKScheme, VTK_SCHEME ); +} + + +bool mitk::ConnectomicsRenderingSchemeProperty::AddEnum( const std::string& name, const IdType& id ) +{ + return Superclass::AddEnum( name, id ); +} diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingSchemeProperty.h b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingSchemeProperty.h new file mode 100644 index 0000000000..8a51bd540c --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingSchemeProperty.h @@ -0,0 +1,94 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#ifndef _MITK_CONNECTOMICS_RENDERING_SCHEME_PROPERTY__H_ +#define _MITK_CONNECTOMICS_RENDERING_SCHEME_PROPERTY__H_ + +#include "mitkEnumerationProperty.h" +#include "MitkDiffusionImagingExports.h" + +namespace mitk +{ + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable: 4522) +#endif + +/** + * Encapsulates the enumeration of different rendering schemes for connectomics networks + */ +class MitkDiffusionImaging_EXPORT ConnectomicsRenderingSchemeProperty : public EnumerationProperty +{ +public: + + mitkClassMacro( ConnectomicsRenderingSchemeProperty, EnumerationProperty ); + + itkNewMacro(ConnectomicsRenderingSchemeProperty); + + mitkNewMacro1Param(ConnectomicsRenderingSchemeProperty, const IdType&); + + mitkNewMacro1Param(ConnectomicsRenderingSchemeProperty, const std::string&); + + using BaseProperty::operator=; + +protected: + + /** + * Constructor. Sets the representation to a default value of 0 + */ + ConnectomicsRenderingSchemeProperty( ); + + /** + * Constructor. Sets the scheme to the given value. If it is not + * valid, the value is set to 0 + * @param value the integer representation of the scheme + */ + ConnectomicsRenderingSchemeProperty( const IdType& value ); + + /** + * Constructor. Sets the scheme to the given value. If it is not + * valid, the value is set to 0 + * @param value the string representation of the scheme + */ + ConnectomicsRenderingSchemeProperty( const std::string& value ); + + /** + * this function is overridden as protected, so that the user may not add + * additional enumerations. + */ + virtual bool AddEnum( const std::string& name, const IdType& id ); + + /** + * Adds the enumeration types as defined by vtk to the list of known + * enumeration values. + */ + virtual void AddRenderingSchemes(); + +private: + + // purposely not implemented + ConnectomicsRenderingSchemeProperty(const ConnectomicsRenderingSchemeProperty&); + ConnectomicsRenderingSchemeProperty& operator=(const ConnectomicsRenderingSchemeProperty&); +}; + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +} // end of namespace mitk + +#endif diff --git a/Modules/DiffusionImaging/files.cmake b/Modules/DiffusionImaging/files.cmake index f4316a6d56..14bf0c87b7 100644 --- a/Modules/DiffusionImaging/files.cmake +++ b/Modules/DiffusionImaging/files.cmake @@ -1,259 +1,282 @@ set(CPP_FILES # DicomImport DicomImport/mitkDicomDiffusionImageReader.cpp DicomImport/mitkGroupDiffusionHeadersFilter.cpp DicomImport/mitkDicomDiffusionImageHeaderReader.cpp DicomImport/mitkGEDicomDiffusionImageHeaderReader.cpp DicomImport/mitkPhilipsDicomDiffusionImageHeaderReader.cpp DicomImport/mitkSiemensDicomDiffusionImageHeaderReader.cpp DicomImport/mitkSiemensMosaicDicomDiffusionImageHeaderReader.cpp # DataStructures IODataStructures/mitkDiffusionImagingObjectFactory.cpp # DataStructures -> DWI IODataStructures/DiffusionWeightedImages/mitkDiffusionImageHeaderInformation.cpp IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSource.cpp IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageReader.cpp IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriter.cpp IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageIOFactory.cpp IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriterFactory.cpp IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSerializer.cpp # DataStructures -> QBall IODataStructures/QBallImages/mitkQBallImageSource.cpp IODataStructures/QBallImages/mitkNrrdQBallImageReader.cpp IODataStructures/QBallImages/mitkNrrdQBallImageWriter.cpp IODataStructures/QBallImages/mitkNrrdQBallImageIOFactory.cpp IODataStructures/QBallImages/mitkNrrdQBallImageWriterFactory.cpp IODataStructures/QBallImages/mitkQBallImage.cpp IODataStructures/QBallImages/mitkQBallImageSerializer.cpp # DataStructures -> Tensor IODataStructures/TensorImages/mitkTensorImageSource.cpp IODataStructures/TensorImages/mitkNrrdTensorImageReader.cpp IODataStructures/TensorImages/mitkNrrdTensorImageWriter.cpp IODataStructures/TensorImages/mitkNrrdTensorImageIOFactory.cpp IODataStructures/TensorImages/mitkNrrdTensorImageWriterFactory.cpp IODataStructures/TensorImages/mitkTensorImage.cpp IODataStructures/TensorImages/mitkTensorImageSerializer.cpp # DataStructures -> FiberBundleX IODataStructures/FiberBundleX/mitkFiberBundleX.cpp IODataStructures/FiberBundleX/mitkFiberBundleXWriter.cpp IODataStructures/FiberBundleX/mitkFiberBundleXReader.cpp IODataStructures/FiberBundleX/mitkFiberBundleXIOFactory.cpp IODataStructures/FiberBundleX/mitkFiberBundleXWriterFactory.cpp IODataStructures/FiberBundleX/mitkFiberBundleXSerializer.cpp IODataStructures/FiberBundleX/mitkFiberBundleXThreadMonitor.cpp # DataStructures -> PlanarFigureComposite IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.cpp # DataStructures -> Tbss IODataStructures/TbssImages/mitkTbssImageSource.cpp IODataStructures/TbssImages/mitkTbssRoiImageSource.cpp IODataStructures/TbssImages/mitkNrrdTbssImageReader.cpp IODataStructures/TbssImages/mitkNrrdTbssImageIOFactory.cpp IODataStructures/TbssImages/mitkNrrdTbssRoiImageReader.cpp IODataStructures/TbssImages/mitkNrrdTbssRoiImageIOFactory.cpp IODataStructures/TbssImages/mitkTbssImage.cpp IODataStructures/TbssImages/mitkTbssRoiImage.cpp IODataStructures/TbssImages/mitkNrrdTbssImageWriter.cpp IODataStructures/TbssImages/mitkNrrdTbssImageWriterFactory.cpp IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriter.cpp IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriterFactory.cpp IODataStructures/TbssImages/mitkTbssImporter.cpp # DataStructures Connectomics IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetwork.cpp IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkReader.cpp IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkIOFactory.cpp IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkSerializer.cpp IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkWriter.cpp IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkWriterFactory.cpp IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkDefinitions.cpp IODataStructures/ConnectomicsNetwork/mitkConnectomicsConstantsManager.cpp # Rendering Rendering/vtkMaskedProgrammableGlyphFilter.cpp Rendering/mitkCompositeMapper.cpp Rendering/mitkVectorImageVtkGlyphMapper3D.cpp Rendering/vtkOdfSource.cxx Rendering/vtkThickPlane.cxx Rendering/mitkOdfNormalizationMethodProperty.cpp Rendering/mitkOdfScaleByProperty.cpp Rendering/mitkFiberBundleXMapper2D.cpp Rendering/mitkFiberBundleXMapper3D.cpp Rendering/mitkFiberBundleXThreadMonitorMapper3D.cpp Rendering/mitkTbssImageMapper.cpp Rendering/mitkPlanarFigureMapper3D.cpp + + # Rendering Connectomics Rendering/mitkConnectomicsNetworkMapper3D.cpp + Rendering/mitkConnectomicsRenderingSchemeProperty.cpp + Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.cpp + Rendering/mitkConnectomicsRenderingNodeFilteringProperty.cpp + Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.cpp + Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.cpp + Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.cpp + Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.cpp + Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.cpp + Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.cpp # Interactions Interactions/mitkFiberBundleInteractor.cpp # Algorithms Algorithms/mitkPartialVolumeAnalysisHistogramCalculator.cpp Algorithms/mitkPartialVolumeAnalysisClusteringCalculator.cpp Algorithms/mitkTractAnalyzer.cpp # Algorithms Connectomics Algorithms/Connectomics/mitkConnectomicsNetworkCreator.cpp Algorithms/Connectomics/mitkConnectomicsHistogramBase.cpp Algorithms/Connectomics/mitkConnectomicsDegreeHistogram.cpp Algorithms/Connectomics/mitkConnectomicsShortestPathHistogram.cpp Algorithms/Connectomics/mitkConnectomicsBetweennessHistogram.cpp Algorithms/Connectomics/mitkConnectomicsHistogramCache.cpp Algorithms/Connectomics/mitkConnectomicsSyntheticNetworkGenerator.cpp Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingPermutationBase.cpp Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingPermutationModularity.cpp Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingManager.cpp Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingCostFunctionBase.cpp Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingCostFunctionModularity.cpp Algorithms/Connectomics/itkConnectomicsNetworkToConnectivityMatrixImageFilter.cpp # Tractography Tractography/GibbsTracking/mitkParticleGrid.cpp Tractography/GibbsTracking/mitkMetropolisHastingsSampler.cpp Tractography/GibbsTracking/mitkEnergyComputer.cpp Tractography/GibbsTracking/mitkGibbsEnergyComputer.cpp Tractography/GibbsTracking/mitkFiberBuilder.cpp # Function Collection mitkDiffusionFunctionCollection.cpp ) set(H_FILES # function Collection mitkDiffusionFunctionCollection.h # Rendering Rendering/mitkDiffusionImageMapper.h Rendering/mitkTbssImageMapper.h Rendering/mitkOdfVtkMapper2D.h Rendering/mitkFiberBundleXMapper3D.h Rendering/mitkFiberBundleXMapper2D.h Rendering/mitkFiberBundleXThreadMonitorMapper3D.h - Rendering/mitkConnectomicsNetworkMapper3D.h Rendering/mitkPlanarFigureMapper3D.h + # Rendering Connectomics + Rendering/mitkConnectomicsNetworkMapper3D.h + Rendering/mitkConnectomicsRenderingProperties.h + Rendering/mitkConnectomicsRenderingSchemeProperty.h + Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.h + Rendering/mitkConnectomicsRenderingNodeFilteringProperty.h + Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.h + Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.h + Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.h + Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.h + Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.h + Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.h + # Reconstruction Reconstruction/itkDiffusionQballReconstructionImageFilter.h Reconstruction/mitkTeemDiffusionTensor3DReconstructionImageFilter.h Reconstruction/itkAnalyticalDiffusionQballReconstructionImageFilter.h Reconstruction/itkDiffusionMultiShellQballReconstructionImageFilter.h Reconstruction/itkPointShell.h Reconstruction/itkOrientationDistributionFunction.h Reconstruction/itkDiffusionIntravoxelIncoherentMotionReconstructionImageFilter.h Reconstruction/itkRegularizedIVIMLocalVariationImageFilter.h Reconstruction/itkRegularizedIVIMReconstructionFilter.h Reconstruction/itkRegularizedIVIMReconstructionSingleIteration.h # IO Datastructures IODataStructures/DiffusionWeightedImages/mitkDiffusionImage.h IODataStructures/TbssImages/mitkTbssImporter.h # DataStructures -> FiberBundleX IODataStructures/FiberBundleX/mitkFiberBundleX.h IODataStructures/FiberBundleX/mitkFiberBundleXWriter.h IODataStructures/FiberBundleX/mitkFiberBundleXReader.h IODataStructures/FiberBundleX/mitkFiberBundleXIOFactory.h IODataStructures/FiberBundleX/mitkFiberBundleXWriterFactory.h IODataStructures/FiberBundleX/mitkFiberBundleXSerializer.h IODataStructures/FiberBundleX/mitkFiberBundleXThreadMonitor.h # Datastructures Connectomics IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetwork.h IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkReader.h IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkIOFactory.h IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkSerializer.h IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkWriter.h IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkWriterFactory.h IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkDefinitions.h IODataStructures/ConnectomicsNetwork/mitkConnectomicsConstantsManager.h # Tractography Tractography/itkGibbsTrackingFilter.h Tractography/itkStochasticTractographyFilter.h Tractography/itkStreamlineTrackingFilter.h Tractography/GibbsTracking/mitkParticle.h Tractography/GibbsTracking/mitkParticleGrid.h Tractography/GibbsTracking/mitkMetropolisHastingsSampler.h Tractography/GibbsTracking/mitkSimpSamp.h Tractography/GibbsTracking/mitkEnergyComputer.h Tractography/GibbsTracking/mitkGibbsEnergyComputer.h Tractography/GibbsTracking/mitkSphereInterpolator.h Tractography/GibbsTracking/mitkFiberBuilder.h # Algorithms Algorithms/itkDiffusionQballGeneralizedFaImageFilter.h Algorithms/itkDiffusionQballPrepareVisualizationImageFilter.h Algorithms/itkTensorDerivedMeasurementsFilter.h Algorithms/itkBrainMaskExtractionImageFilter.h Algorithms/itkB0ImageExtractionImageFilter.h Algorithms/itkB0ImageExtractionToSeparateImageFilter.h Algorithms/itkTensorImageToDiffusionImageFilter.h Algorithms/itkTensorToL2NormImageFilter.h Algorithms/itkTractDensityImageFilter.h Algorithms/itkTractsToFiberEndingsImageFilter.h Algorithms/itkTractsToRgbaImageFilter.h Algorithms/itkGaussianInterpolateImageFunction.h Algorithms/mitkPartialVolumeAnalysisHistogramCalculator.h Algorithms/mitkPartialVolumeAnalysisClusteringCalculator.h Algorithms/itkDiffusionTensorPrincipalDirectionImageFilter.h Algorithms/itkCartesianToPolarVectorImageFilter.h Algorithms/itkPolarToCartesianVectorImageFilter.h Algorithms/itkDistanceMapFilter.h Algorithms/itkProjectionFilter.h Algorithms/itkSkeletonizationFilter.h Algorithms/itkResidualImageFilter.h Algorithms/itkExtractChannelFromRgbaImageFilter.h Algorithms/itkTensorReconstructionWithEigenvalueCorrectionFilter.h Algorithms/itkElectrostaticRepulsionDiffusionGradientReductionFilter.h Algorithms/itkMergeDiffusionImagesFilter.h Algorithms/itkDwiPhantomGenerationFilter.h Algorithms/itkFiniteDiffOdfMaximaExtractionFilter.h Algorithms/itkMrtrixPeakImageConverter.h Algorithms/itkFslPeakImageConverter.h Algorithms/itkFslShCoefficientImageConverter.h Algorithms/itkOdfMaximaExtractionFilter.h Algorithms/itkFibersFromPlanarFiguresFilter.h Algorithms/itkTractsToDWIImageFilter.h Algorithms/itkTractsToVectorImageFilter.h Algorithms/itkResampleDwiImageFilter.h # Algorithms Connectomics Algorithms/Connectomics/mitkConnectomicsNetworkCreator.h Algorithms/Connectomics/mitkConnectomicsHistogramBase.h Algorithms/Connectomics/mitkConnectomicsDegreeHistogram.h Algorithms/Connectomics/mitkConnectomicsShortestPathHistogram.h Algorithms/Connectomics/mitkConnectomicsBetweennessHistogram.h Algorithms/Connectomics/mitkConnectomicsHistogramCache.h Algorithms/Connectomics/mitkConnectomicsSyntheticNetworkGenerator.h Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingPermutationBase.h Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingPermutationModularity.h Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingManager.h Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingCostFunctionBase.h Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingCostFunctionModularity.h Algorithms/Connectomics/itkConnectomicsNetworkToConnectivityMatrixImageFilter.h SignalModels/mitkDiffusionSignalModel.h SignalModels/mitkTensorModel.h SignalModels/mitkBallModel.h SignalModels/mitkStickModel.h SignalModels/mitkDiffusionNoiseModel.h SignalModels/mitkRicianNoiseModel.h SignalModels/mitkKspaceArtifact.h SignalModels/mitkGibbsRingingArtifact.h SignalModels/mitkT2SmearingArtifact.h ) set( TOOL_FILES ) if(WIN32) endif(WIN32) #MITK_MULTIPLEX_PICTYPE( Algorithms/mitkImageRegistrationMethod-TYPE.cpp )