Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
Creates connectomics networks from fibers and parcellation. More...
#include <mitkConnectomicsNetworkCreator.h>
Public Types | |
enum | MappingStrategy { EndElementPosition, EndElementPositionAvoidingWhiteMatter, JustEndPointVerticesNoLabel, PrecomputeAndDistance } |
typedef itk::Image< int, 3 > | ITKImageType |
typedef itk::Point< float, 3 > | PointType |
typedef itk::VectorContainer< unsigned int, PointType > | TractType |
typedef itk::VectorContainer< unsigned int, TractType::Pointer > | TractContainerType |
typedef mitk::ConnectomicsNetwork::VertexDescriptorType | VertexType |
typedef mitk::ConnectomicsNetwork::EdgeDescriptorType | EdgeType |
typedef mitk::ConnectomicsNetwork::NetworkNode | NetworkNode |
typedef std::pair< VertexType, VertexType > | ConnectionType |
typedef int | ImageLabelType |
typedef std::pair< ImageLabelType, ImageLabelType > | ImageLabelPairType |
Public Member Functions | |
mitkClassMacroItkParent (ConnectomicsNetworkCreator, itk::Object) | |
Pointer | Clone () const |
void | CreateNetworkFromFibersAndSegmentation () |
void | SetFiberBundle (mitk::FiberBundle::Pointer fiberBundle) |
void | SetSegmentation (mitk::Image::Pointer segmentation) |
mitk::ConnectomicsNetwork::Pointer | GetNetwork () |
virtual void | SetMappingStrategy (MappingStrategy _arg) |
virtual void | SetEndPointSearchRadius (double _arg) |
virtual void | SetZeroLabelInvalid (bool _arg) |
void | CalculateCenterOfMass () |
Calculate the locations of vertices. More... | |
Static Public Member Functions | |
static Pointer | New () |
Protected Member Functions | |
ConnectomicsNetworkCreator () | |
ConnectomicsNetworkCreator (mitk::Image::Pointer segmentation, mitk::FiberBundle::Pointer fiberBundle) | |
~ConnectomicsNetworkCreator () | |
void | AddConnectionToNetwork (ConnectionType newConnection) |
VertexType | ReturnAssociatedVertexForLabel (ImageLabelType label) |
ConnectionType | ReturnAssociatedVertexPairForLabelPair (ImageLabelPairType labelpair) |
ImageLabelPairType | ReturnLabelForFiberTract (TractType::Pointer singleTract, MappingStrategy strategy) |
void | SupplyVertexWithInformation (ImageLabelType &label, VertexType &vertex) |
std::string | LabelToString (ImageLabelType &label) |
bool | IsNonWhiteMatterLabel (int labelInQuestion) |
bool | IsBackgroundLabel (int labelInQuestion) |
void | LinearExtensionUntilGreyMatter (std::vector< int > &indexVectorOfPointsToUse, TractType::Pointer singleTract, int &label, itk::Index< 3 > &mitkIndex) |
void | RetractionUntilBrainMatter (bool retractFront, TractType::Pointer singleTract, int &label, itk::Index< 3 > &mitkIndex) |
std::vector< double > | GetCenterOfMass (int label) |
Get the location of the center of mass for a specific label This can throw an exception if the label is not found. More... | |
itk::Point< float, 3 > | GetItkPoint (double point[3]) |
void | CreateNewNode (int label, itk::Index< 3 >, bool useIndex) |
Creates a new node. More... | |
ImageLabelPairType | EndElementPositionLabel (TractType::Pointer singleTract) |
ImageLabelPairType | PrecomputeVertexLocationsBySegmentation (TractType::Pointer singleTract) |
ImageLabelPairType | JustEndPointVerticesNoLabelTest (TractType::Pointer singleTract) |
ImageLabelPairType | EndElementPositionLabelAvoidingWhiteMatter (TractType::Pointer singleTract) |
void | FiberToSegmentationCoords (mitk::Point3D &fiberCoord, mitk::Point3D &segCoord) |
void | SegmentationToFiberCoords (mitk::Point3D &segCoord, mitk::Point3D &fiberCoord) |
Protected Attributes | |
mitk::FiberBundle::Pointer | m_FiberBundle |
mitk::Image::Pointer | m_Segmentation |
ITKImageType::Pointer | m_SegmentationItk |
mitk::ConnectomicsNetwork::Pointer | m_ConNetwork |
int | idCounter |
std::map< ImageLabelType, VertexType > | m_LabelToVertexMap |
std::map< ImageLabelType, NetworkNode > | m_LabelToNodePropertyMap |
bool | allowLoops |
bool | m_UseCoMCoordinates |
std::map< int, std::vector< double > > | m_LabelsToCoordinatesMap |
MappingStrategy | m_MappingStrategy |
double | m_EndPointSearchRadius |
bool | m_ZeroLabelInvalid |
bool | m_AbortConnection |
Static Protected Attributes | |
static const int | freesurfer_Left_Cerebral_White_Matter |
static const int | freesurfer_Left_Cerebellum_White_Matter |
static const int | freesurfer_Left_Cerebellum_Cortex |
static const int | freesurfer_Brain_Stem |
static const int | freesurfer_Right_Cerebral_White_Matter |
static const int | freesurfer_Right_Cerebellum_White_Matter |
static const int | freesurfer_Right_Cerebellum_Cortex |
Creates connectomics networks from fibers and parcellation.
This class needs a parcellation image and a fiber image to be set. Then you can create a connectomics network from the two, using different strategies.
Definition at line 42 of file mitkConnectomicsNetworkCreator.h.
typedef std::pair< VertexType, VertexType > mitk::ConnectomicsNetworkCreator::ConnectionType |
Definition at line 77 of file mitkConnectomicsNetworkCreator.h.
Definition at line 75 of file mitkConnectomicsNetworkCreator.h.
typedef std::pair< ImageLabelType, ImageLabelType > mitk::ConnectomicsNetworkCreator::ImageLabelPairType |
Definition at line 81 of file mitkConnectomicsNetworkCreator.h.
typedef int mitk::ConnectomicsNetworkCreator::ImageLabelType |
Types for labels
Definition at line 80 of file mitkConnectomicsNetworkCreator.h.
typedef itk::Image<int, 3 > mitk::ConnectomicsNetworkCreator::ITKImageType |
Type for Images
Definition at line 65 of file mitkConnectomicsNetworkCreator.h.
Definition at line 76 of file mitkConnectomicsNetworkCreator.h.
typedef itk::Point<float,3> mitk::ConnectomicsNetworkCreator::PointType |
Types for the standardized Tract
Definition at line 68 of file mitkConnectomicsNetworkCreator.h.
typedef itk::VectorContainer< unsigned int, TractType::Pointer > mitk::ConnectomicsNetworkCreator::TractContainerType |
Definition at line 70 of file mitkConnectomicsNetworkCreator.h.
typedef itk::VectorContainer<unsigned int, PointType> mitk::ConnectomicsNetworkCreator::TractType |
Definition at line 69 of file mitkConnectomicsNetworkCreator.h.
typedef mitk::ConnectomicsNetwork::VertexDescriptorType mitk::ConnectomicsNetworkCreator::VertexType |
Types for Network
Definition at line 74 of file mitkConnectomicsNetworkCreator.h.
Enum for different ways to create the mapping from fibers to network
Enumerator | |
---|---|
EndElementPosition | |
EndElementPositionAvoidingWhiteMatter | |
JustEndPointVerticesNoLabel | |
PrecomputeAndDistance |
Definition at line 48 of file mitkConnectomicsNetworkCreator.h.
|
protected |
Definition at line 34 of file mitkConnectomicsNetworkCreator.cpp.
|
protected |
Definition at line 51 of file mitkConnectomicsNetworkCreator.cpp.
References mitk::CastToItkImage(), and m_SegmentationItk.
|
protected |
Definition at line 68 of file mitkConnectomicsNetworkCreator.cpp.
|
protected |
Add a connection to the network
Definition at line 142 of file mitkConnectomicsNetworkCreator.cpp.
References MITK_DEBUG.
void mitk::ConnectomicsNetworkCreator::CalculateCenterOfMass | ( | ) |
Calculate the locations of vertices.
Calculate the center of mass for each label and store the information. This will need a set parcellation image. Unless this function is called the first location where a label is encountered will be used. After calling this function the center of mass will be used instead.
Definition at line 759 of file mitkConnectomicsNetworkCreator.cpp.
Pointer mitk::ConnectomicsNetworkCreator::Clone | ( | ) | const |
void mitk::ConnectomicsNetworkCreator::CreateNetworkFromFibersAndSegmentation | ( | ) |
Given a fiber bundle and a parcellation are set, this will create a network from both
Definition at line 92 of file mitkConnectomicsNetworkCreator.cpp.
References mitk::ConnectomicsConstantsManager::CONNECTOMICS_WARNING_INFO_NETWORK_CREATED, MBI_INFO, mitk::New(), and mitk::ConnectomicsNetwork::New().
|
protected |
Creates a new node.
A new node will be created, using the label and either the supplied coordinates or the center of mass coordinates, depending on the supplied bool.
Definition at line 835 of file mitkConnectomicsNetworkCreator.cpp.
References mitk::ConnectomicsNetwork::NetworkNode::coordinates, and mitk::ConnectomicsNetwork::NetworkNode::label.
|
protected |
Use the position of the end and starting element only to map to labels
Map a fiber to a vertex by taking the value of the parcellation image at the same world coordinates as the last and first element of the tract.
Definition at line 226 of file mitkConnectomicsNetworkCreator.cpp.
References mitk::ConnectomicsConstantsManager::CONNECTOMICS_ERROR_INVALID_DIMENSION_NEED_3, and MBI_ERROR.
|
protected |
Use the position of the end and starting element unless it is in white matter, then search for nearby parcellation to map to labels
Map a fiber to a vertex by taking the value of the parcellation image at the same world coordinates as the last and first element of the tract. If this happens to be white matter, then try to extend the fiber in a line and take the first non-white matter parcel, that is intersected.
Definition at line 276 of file mitkConnectomicsNetworkCreator.cpp.
References mitk::ConnectomicsConstantsManager::CONNECTOMICS_ERROR_INVALID_DIMENSION_NEED_3, and MBI_ERROR.
|
protected |
Convert fiber index to segmentation index coordinates
Definition at line 463 of file mitkConnectomicsNetworkCreator.cpp.
|
protected |
Get the location of the center of mass for a specific label This can throw an exception if the label is not found.
Definition at line 820 of file mitkConnectomicsNetworkCreator.cpp.
References MITK_ERROR.
|
protected |
Convert point to itk point
Definition at line 83 of file mitkConnectomicsNetworkCreator.cpp.
mitk::ConnectomicsNetwork::Pointer mitk::ConnectomicsNetworkCreator::GetNetwork | ( | ) |
Definition at line 458 of file mitkConnectomicsNetworkCreator.cpp.
|
protected |
Check whether the label in question belongs to background according to the freesurfer table
Definition at line 498 of file mitkConnectomicsNetworkCreator.cpp.
|
protected |
Check whether the label in question belongs to white matter according to the freesurfer table
Definition at line 481 of file mitkConnectomicsNetworkCreator.cpp.
|
protected |
Use the position of the end and starting element only to map to labels
Just take first and last position, no labelling, nothing
Definition at line 395 of file mitkConnectomicsNetworkCreator.cpp.
References mitk::ConnectomicsConstantsManager::CONNECTOMICS_ERROR_INVALID_DIMENSION_NEED_3, and MBI_ERROR.
|
protected |
Create a string from the label
Definition at line 448 of file mitkConnectomicsNetworkCreator.cpp.
|
protected |
Extend a straight line through the given points and look for the first non white matter label
It will try extend in the direction of the points in the vector so a vector {B,C} will result in extending from C in the direction C-B
Definition at line 507 of file mitkConnectomicsNetworkCreator.cpp.
References mitk::ConnectomicsConstantsManager::CONNECTOMICS_WARNING_DID_NOT_FIND_WHITE, mitk::ConnectomicsConstantsManager::CONNECTOMICS_WARNING_ESTIMATING_BEYOND_END, mitk::ConnectomicsConstantsManager::CONNECTOMICS_WARNING_ESTIMATING_BEYOND_START, mitk::ConnectomicsConstantsManager::CONNECTOMICS_WARNING_ESTIMATING_LESS_THAN_2, mitk::ConnectomicsConstantsManager::CONNECTOMICS_WARNING_MORE_POINTS_THAN_PRESENT, and MBI_WARN.
mitk::ConnectomicsNetworkCreator::mitkClassMacroItkParent | ( | ConnectomicsNetworkCreator | , |
itk::Object | |||
) |
Standard class typedefs. Method for creation through the object factory.
|
protected |
Map by distance between elements and vertices depending on their volume
First go through the parcellation and compute the coordinates of the future vertices. Assign a radius according on their volume. Then map an edge to a label by considering the nearest vertices and comparing the distance to them to their radii.
Definition at line 269 of file mitkConnectomicsNetworkCreator.cpp.
|
protected |
Retract fiber until the first brain matter label is hit
The bool parameter controls whether the front or the end is retracted
Definition at line 632 of file mitkConnectomicsNetworkCreator.cpp.
|
protected |
Determine if a label is already identified with a vertex, otherwise create a new one
Definition at line 169 of file mitkConnectomicsNetworkCreator.cpp.
|
protected |
Return the vertexes associated with a pair of labels
Definition at line 190 of file mitkConnectomicsNetworkCreator.cpp.
|
protected |
Return the pair of labels which identify the areas connected by a single fiber
Definition at line 198 of file mitkConnectomicsNetworkCreator.cpp.
References mitk::ConnectomicsConstantsManager::CONNECTOMICS_ERROR_INVALID_MAPPING, and MBI_ERROR.
|
protected |
Convert segmentation index to fiber index coordinates
Definition at line 472 of file mitkConnectomicsNetworkCreator.cpp.
|
virtual |
void mitk::ConnectomicsNetworkCreator::SetFiberBundle | ( | mitk::FiberBundle::Pointer | fiberBundle | ) |
Definition at line 72 of file mitkConnectomicsNetworkCreator.cpp.
|
virtual |
void mitk::ConnectomicsNetworkCreator::SetSegmentation | ( | mitk::Image::Pointer | segmentation | ) |
Definition at line 77 of file mitkConnectomicsNetworkCreator.cpp.
References mitk::CastToItkImage().
|
virtual |
|
protected |
Assign the additional information which should be part of the vertex
Definition at line 438 of file mitkConnectomicsNetworkCreator.cpp.
|
protected |
Definition at line 211 of file mitkConnectomicsNetworkCreator.h.
|
staticprotected |
Definition at line 239 of file mitkConnectomicsNetworkCreator.h.
|
staticprotected |
Definition at line 238 of file mitkConnectomicsNetworkCreator.h.
|
staticprotected |
Definition at line 237 of file mitkConnectomicsNetworkCreator.h.
|
staticprotected |
Definition at line 236 of file mitkConnectomicsNetworkCreator.h.
|
staticprotected |
Definition at line 242 of file mitkConnectomicsNetworkCreator.h.
|
staticprotected |
Definition at line 241 of file mitkConnectomicsNetworkCreator.h.
|
staticprotected |
Definition at line 240 of file mitkConnectomicsNetworkCreator.h.
|
protected |
Definition at line 202 of file mitkConnectomicsNetworkCreator.h.
|
protected |
Definition at line 230 of file mitkConnectomicsNetworkCreator.h.
|
protected |
Definition at line 199 of file mitkConnectomicsNetworkCreator.h.
|
protected |
Definition at line 223 of file mitkConnectomicsNetworkCreator.h.
|
protected |
Definition at line 194 of file mitkConnectomicsNetworkCreator.h.
|
protected |
Definition at line 217 of file mitkConnectomicsNetworkCreator.h.
|
protected |
Definition at line 208 of file mitkConnectomicsNetworkCreator.h.
|
protected |
Definition at line 205 of file mitkConnectomicsNetworkCreator.h.
|
protected |
Definition at line 220 of file mitkConnectomicsNetworkCreator.h.
|
protected |
Definition at line 195 of file mitkConnectomicsNetworkCreator.h.
|
protected |
Definition at line 196 of file mitkConnectomicsNetworkCreator.h.
Referenced by ConnectomicsNetworkCreator().
|
protected |
Definition at line 214 of file mitkConnectomicsNetworkCreator.h.
|
protected |
Definition at line 226 of file mitkConnectomicsNetworkCreator.h.