diff --git a/Modules/DiffusionImaging/CMakeLists.txt b/Modules/DiffusionImaging/CMakeLists.txt index 3eda59963a..2a47d76af4 100644 --- a/Modules/DiffusionImaging/CMakeLists.txt +++ b/Modules/DiffusionImaging/CMakeLists.txt @@ -1,20 +1,20 @@ FIND_PACKAGE(ITK) IF(ITK_GDCM_DIR) INCLUDE(${ITK_GDCM_DIR}/GDCMConfig.cmake) IF(GDCM_MAJOR_VERSION EQUAL 2) ADD_DEFINITIONS(-DGDCM2) SET(ITK_USES_GDCM2 1) ENDIF(GDCM_MAJOR_VERSION EQUAL 2) ENDIF(ITK_GDCM_DIR) MITK_CREATE_MODULE( MitkDiffusionImaging SUBPROJECTS MITK-DTI - INCLUDE_DIRS Algorithms DicomImport IODataStructures/DiffusionWeightedImages IODataStructures/QBallImages IODataStructures/TensorImages IODataStructures Reconstruction Tractography Rendering ${CMAKE_CURRENT_BINARY_DIR} + INCLUDE_DIRS Algorithms DicomImport IODataStructures/DiffusionWeightedImages IODataStructures/QBallImages IODataStructures/TensorImages IODataStructures/FiberBundle IODataStructures/PlanarFigureComposite IODataStructures Reconstruction Tractography Rendering ${CMAKE_CURRENT_BINARY_DIR} DEPENDS MitkExt PACKAGE_DEPENDS Boost ) ADD_SUBDIRECTORY(Testing) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mitkDiffusionImagingConfigure.h.in ${CMAKE_CURRENT_BINARY_DIR}/mitkDiffusionImagingConfigure.h) diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundle/itkSlowPolyLineParametricPath.h b/Modules/DiffusionImaging/IODataStructures/FiberBundle/itkSlowPolyLineParametricPath.h new file mode 100644 index 0000000000..e4b0f53d37 --- /dev/null +++ b/Modules/DiffusionImaging/IODataStructures/FiberBundle/itkSlowPolyLineParametricPath.h @@ -0,0 +1,112 @@ +#ifndef _itkSlowPolyLineParametricPathPath_h +#define _itkSlowPolyLineParametricPathPath_h + +#include "itkPolyLineParametricPath.h" +#include "itkVectorContainer.h" +#include "itkContinuousIndex.h" +#include "itkIndex.h" +#include "itkOffset.h" +#include "itkVector.h" + +namespace itk +{ + + +/** \class SlowPolyLineParametricPath + * \brief Represent a path of line segments through ND Space + * + * This class is intended to represent parametric paths through an image, where + * the paths are composed of line segments. Each line segment traverses one + * unit of input. A classic application of this class is the representation of + * contours in 2D images, especially when the contours only need to be + * approximately correct. Another use of a path is to guide the movement of an + * iterator through an image. + * + * \sa EllipseParametricPath + * \sa FourierSeriesPath + * \sa OrthogonallyCorrectedParametricPath + * \sa ParametricPath + * \sa ChainCodePath + * \sa Path + * \sa ContinuousIndex + * \sa Index + * \sa Offset + * \sa Vector + * + * \ingroup PathObjects + */ +template +class ITK_EXPORT SlowPolyLineParametricPath : public +PolyLineParametricPath< VDimension > +{ +public: + /** Standard class typedefs. */ + typedef SlowPolyLineParametricPath Self; + typedef PolyLineParametricPath Superclass; + typedef SmartPointer Pointer; + typedef SmartPointer ConstPointer; + + /** Run-time type information (and related methods). */ + itkTypeMacro(SlowPolyLineParametricPath, PolyLineParametricPath); + + /** Input type */ + typedef typename Superclass::InputType InputType; + + /** Output type */ + typedef typename Superclass::OutputType OutputType; + + + /** Basic data-structure types used */ + typedef typename Superclass::ContinuousIndexType ContinuousIndexType; + typedef typename Superclass::IndexType IndexType; + typedef typename Superclass::OffsetType OffsetType; + typedef typename Superclass::PointType PointType; + typedef typename Superclass::VectorType VectorType; + typedef typename Superclass::VertexType VertexType; + typedef typename Superclass::VertexListType VertexListType; + typedef typename Superclass::VertexListPointer VertexListPointer; + + /** Increment the input variable passed by reference such that the ND index of + * the path moves to its next vertex-connected (8-connected in 2D) neighbor. + * Return the Index-space offset of the path from its prior input to its new + * input. If the path is unable to increment, input is not changed and an + * offset of Zero is returned. Children are not required to implement bounds + * checking. + * + * This is a fairly slow, iterative algorithm that numerically converges to + * the next index along the path, in a vertex-connected (8-connected in 2D) + * fashion. When possible, children of this class should overload this + * function with something more efficient. + * + * WARNING: This default implementation REQUIRES that the ND endpoint of + * the path be either unique or coincident only with the startpoint, since it + * uses the endpoint as a stopping condition. */ + virtual OffsetType IncrementInput(InputType & input) const; + + + ///** Evaluate the first derivative of the ND output with respect to the 1D + // * input. This is an exact, algebraic function. */ + //virtual VectorType EvaluateDerivative(const InputType & input) const; + + + /** New() method for dynamic construction */ + itkNewMacro( Self ); + + +protected: + SlowPolyLineParametricPath(); + ~SlowPolyLineParametricPath(){} + void PrintSelf(std::ostream& os, Indent indent) const; + +private: + SlowPolyLineParametricPath(const Self&); //purposely not implemented + void operator=(const Self&); //purposely not implemented +}; + +} // namespace itk + +#ifndef ITK_MANUAL_INSTANTIATION +#include "itkSlowPolyLineParametricPath.txx" +#endif + +#endif diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundle/itkSlowPolyLineParametricPath.txx b/Modules/DiffusionImaging/IODataStructures/FiberBundle/itkSlowPolyLineParametricPath.txx new file mode 100644 index 0000000000..e0852d1614 --- /dev/null +++ b/Modules/DiffusionImaging/IODataStructures/FiberBundle/itkSlowPolyLineParametricPath.txx @@ -0,0 +1,115 @@ +#ifndef _itkSlowPolyLineParametricPath_txx +#define _itkSlowPolyLineParametricPath_txx + +#include "itkSlowPolyLineParametricPath.h" +#include + + + +namespace itk +{ + +//template +//typename SlowPolyLineParametricPath::VectorType +//SlowPolyLineParametricPath +//::EvaluateDerivative(const InputType & input) const +//{ +//} + + + +/** + * Constructor + */ +template +SlowPolyLineParametricPath +::SlowPolyLineParametricPath() +{ + this->SetDefaultInputStepSize( 0.3 ); +} + + +template +typename SlowPolyLineParametricPath::OffsetType +SlowPolyLineParametricPath +::IncrementInput(InputType & input) const +{ + int iterationCount; + bool tooSmall; + bool tooBig; + InputType inputStepSize; + InputType finalInputValue; + OffsetType offset; + IndexType currentImageIndex; + IndexType nextImageIndex; + IndexType finalImageIndex; + + iterationCount = 0; + inputStepSize = this->GetDefaultInputStepSize(); + + // Are we already at (or past) the end of the input? + finalInputValue = this->EndOfInput(); + currentImageIndex = this->EvaluateToIndex( input ); + finalImageIndex = this->EvaluateToIndex( finalInputValue ); + offset = finalImageIndex - currentImageIndex; + if( ( offset == this->GetZeroOffset() && input != this->StartOfInput() ) || + ( input >=finalInputValue ) ) + { + return this->GetZeroOffset(); + } + + do + { + if( iterationCount++ > 10000 ) {itkExceptionMacro(<<"Too many iterations");} + + nextImageIndex = this->EvaluateToIndex( input + inputStepSize ); + offset = nextImageIndex - currentImageIndex; + + tooBig = false; + tooSmall = ( offset == this->GetZeroOffset() ); + if( tooSmall ) + { + // increase the input step size, but don't go past the end of the input + inputStepSize *= 2; + if( (input + inputStepSize) >= finalInputValue ){ + //inputStepSize = finalInputValue - input; + inputStepSize += this->GetDefaultInputStepSize(); + } + } + else + { + // Search for an offset dimension that is too big + for( unsigned int i=0; i= 2 || offset[i] <= -2 ); + } + + if( tooBig ){ + //inputStepSize /= 1.5; + inputStepSize -= (this->GetDefaultInputStepSize()/0.5); + } + } + } + while( tooSmall || tooBig ); + + input += inputStepSize; + return offset; +} + + +/** + * Standard "PrintSelf" method + */ +template +void +SlowPolyLineParametricPath +::PrintSelf( std::ostream& os, Indent indent) const +{ + Superclass::PrintSelf( os, indent ); +} + + + +} // end namespaceitk + +#endif diff --git a/Modules/DiffusionImaging/IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.cpp b/Modules/DiffusionImaging/IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.cpp new file mode 100644 index 0000000000..a59aaefbf0 --- /dev/null +++ b/Modules/DiffusionImaging/IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.cpp @@ -0,0 +1,132 @@ +/* + * mitkPlanarFigureComposite.cpp + * mitk-all + * + * Created by HAL9000 on 2/4/11. + * Copyright 2011 __MyCompanyName__. All rights reserved. + * + */ + +#include "mitkPlanarFigureComposite.h" + + +mitk::PlanarFigureComposite::PlanarFigureComposite() + +{ + m_PFVector = CompositionContainer::New(); + m_DNVector = DataNodeContainer::New(); + +} + +mitk::PlanarFigureComposite::~PlanarFigureComposite() +{ + +} + +void mitk::PlanarFigureComposite::addDataNode(mitk::DataNode::Pointer dnode) +{ + + m_DNVector->InsertElement(m_DNVector->Size(), dnode); + +} + + +void mitk::PlanarFigureComposite::addPlanarFigure(PlanarFigure::Pointer pf) +{ + + MITK_INFO << "addPlanarFigure: size before: " << this->getNumberOfChildren(); + m_PFVector->InsertElement(m_PFVector->Size(), pf); + MITK_INFO << "addPlanarFigure: size after: " << this->getNumberOfChildren(); + + + + +} + +void mitk::PlanarFigureComposite::replaceDataNodeAt(int idx, mitk::DataNode::Pointer dn) +{ + MITK_INFO << "replace: size before: " << this->getNumberOfChildren(); + m_DNVector->SetElement( idx, dn ); + MITK_INFO << "replace: size after: " << this->getNumberOfChildren(); + +} + +void mitk::PlanarFigureComposite::setOperationType(PFCompositionOperation pfcOp) +{ + this->m_compOperation = pfcOp; + MITK_INFO << "Composition set to: " << this->getOperationType(); + +} + + +mitk::PFCompositionOperation mitk::PlanarFigureComposite::getOperationType() +{ + return this->m_compOperation; + + +} + +void mitk::PlanarFigureComposite::setDisplayName(std::string displName) +{ + + m_name = displName; + +} + + +std::string mitk::PlanarFigureComposite::getDisplayName() +{ + return m_name; +} + + +int mitk::PlanarFigureComposite::getNumberOfChildren() +{ + return m_PFVector->Size(); + +} + +mitk::PlanarFigure::Pointer mitk::PlanarFigureComposite::getChildAt(int idx) +{ + + return m_PFVector->ElementAt(idx); +} + + +mitk::DataNode::Pointer mitk::PlanarFigureComposite::getDataNodeAt(int idx) +{ + + return m_DNVector->ElementAt(idx); + +} + + + + + + +//musthave implementations from superclass.... not sure if return true makes sense +bool mitk::PlanarFigureComposite::SetControlPoint( unsigned int index, const Point2D &point, bool createIfDoesNotExist ) +{ + return true; +} + +void mitk::PlanarFigureComposite::GeneratePolyLine() +{ + +} + +void mitk::PlanarFigureComposite::GenerateHelperPolyLine(double /*mmPerDisplayUnit*/, unsigned int /*displayHeight*/) +{ + // A circle does not require a helper object +} + +void mitk::PlanarFigureComposite::EvaluateFeaturesInternal() +{ + +} + +void mitk::PlanarFigureComposite::PrintSelf( std::ostream& os, itk::Indent indent) const +{ + +} diff --git a/Modules/DiffusionImaging/IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.h b/Modules/DiffusionImaging/IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.h new file mode 100644 index 0000000000..b545595fe4 --- /dev/null +++ b/Modules/DiffusionImaging/IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.h @@ -0,0 +1,110 @@ +/* + * mitkPlanarFigureComposite.h + * mitk-all + * + * Created by HAL9000 on 2/4/11. + * Copyright 2011 __MyCompanyName__. All rights reserved. + * + */ + +#ifndef _MITK_PLANARFIGURECOMPOSITE_H +#define _MITK_PLANARFIGURECOMPOSITE_H + +#include "mitkCommon.h" +#include "mitkBaseData.h" +#include "MitkDiffusionImagingMBIExports.h" +#include "mitkPlanarFigure.h" +#include "itkVectorContainer.h" +#include "mitkDataNode.h" + + +namespace mitk { + + enum PFCompositionOperation { + PFCOMPOSITION_AND_OPERATION, + PFCOMPOSITION_OR_OPERATION, + PFCOMPOSITION_NOT_OPERATION, + }; + + + + + class MitkDiffusionImagingMBI_EXPORT PlanarFigureComposite : public PlanarFigure + { + + typedef itk::VectorContainer CompositionContainer; + typedef itk::VectorContainer DataNodeContainer; + + + public: + mitkClassMacro(PlanarFigureComposite, PlanarFigure); + itkNewMacro( Self ); + + // ///MUST HAVE IMPLEMENTATION////// + bool SetControlPoint( unsigned int index, const Point2D &point, bool createIfDoesNotExist ); + unsigned int GetMinimumNumberOfControlPoints() const + { + return 0; + } + /** \brief Circle has 2 control points per definition. */ + unsigned int GetMaximumNumberOfControlPoints() const + { + return 0; + } + // ///////////////////////// + + + + int getNumberOfChildren(); + mitk::PlanarFigure::Pointer getChildAt(int); + void addPlanarFigure(PlanarFigure::Pointer); + + + mitk::DataNode::Pointer getDataNodeAt(int); + void addDataNode(mitk::DataNode::Pointer); + void replaceDataNodeAt(int, mitk::DataNode::Pointer); + + // set if this compsition is AND, OR, NOT + void setOperationType(PFCompositionOperation); + PFCompositionOperation getOperationType(); + + void setDisplayName(std::string); + std::string getDisplayName(); + + protected: + PlanarFigureComposite(); + virtual ~PlanarFigureComposite(); + + + + // ///MUST HAVE IMPLEMENTATION////// + /** \brief Generates the poly-line representation of the planar figure. */ + virtual void GeneratePolyLine(); + + /** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/ + virtual void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight); + + /** \brief Calculates feature quantities of the planar figure. */ + virtual void EvaluateFeaturesInternal(); + + virtual void PrintSelf( std::ostream &os, itk::Indent indent ) const; + // //////////////////// + + + + + private: + //this vector takes planarfigures and planarfigureComosite types + CompositionContainer::Pointer m_PFVector; + PFCompositionOperation m_compOperation; + + DataNodeContainer::Pointer m_DNVector; + std::string m_name; + + + + }; + +} + +#endif diff --git a/Modules/DiffusionImaging/IODataStructures/mitkDiffusionImagingObjectFactory.cpp b/Modules/DiffusionImaging/IODataStructures/mitkDiffusionImagingObjectFactory.cpp index f7a77c3aed..dc52290f31 100644 --- a/Modules/DiffusionImaging/IODataStructures/mitkDiffusionImagingObjectFactory.cpp +++ b/Modules/DiffusionImaging/IODataStructures/mitkDiffusionImagingObjectFactory.cpp @@ -1,237 +1,236 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-06-18 15:59:04 +0200 (Do, 18 Jun 2009) $ Version: $Revision: 16916 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "mitkDiffusionImagingObjectFactory.h" #include "mitkProperties.h" #include "mitkBaseRenderer.h" #include "mitkDataNode.h" #include "mitkNrrdDiffusionImageIOFactory.h" #include "mitkNrrdDiffusionImageWriterFactory.h" #include "mitkNrrdDiffusionImageWriter.h" #include "mitkDiffusionImage.h" #include "mitkNrrdQBallImageIOFactory.h" #include "mitkNrrdQBallImageWriterFactory.h" #include "mitkNrrdQBallImageWriter.h" #include "mitkNrrdTensorImageIOFactory.h" #include "mitkNrrdTensorImageWriterFactory.h" #include "mitkNrrdTensorImageWriter.h" #include "mitkCompositeMapper.h" #include "mitkDiffusionImageMapper.h" #include "mitkGPUVolumeMapper3D.h" #include "mitkFiberBundle.h" #include "mitkFiberBundleMapper3D.h" -#include "mitkFiberBundleMapper2D.h" #include "mitkFiberBundleIOFactory.h" #include "mitkFiberBundleWriterFactory.h" #include "mitkFiberBundleWriter.h" typedef short DiffusionPixelType; typedef mitk::DiffusionImage DiffusionImageShort; typedef std::multimap MultimapType; mitk::DiffusionImagingObjectFactory::DiffusionImagingObjectFactory(bool /*registerSelf*/) :CoreObjectFactoryBase() { static bool alreadyDone = false; if (!alreadyDone) { MITK_INFO << "DiffusionImagingObjectFactory c'tor" << std::endl; RegisterIOFactories(); mitk::NrrdDiffusionImageIOFactory::RegisterOneFactory(); mitk::NrrdQBallImageIOFactory::RegisterOneFactory(); mitk::NrrdTensorImageIOFactory::RegisterOneFactory(); mitk::FiberBundleIOFactory::RegisterOneFactory(); mitk::NrrdDiffusionImageWriterFactory::RegisterOneFactory(); mitk::NrrdQBallImageWriterFactory::RegisterOneFactory(); mitk::NrrdTensorImageWriterFactory::RegisterOneFactory(); mitk::FiberBundleWriterFactory::RegisterOneFactory(); m_FileWriters.push_back( NrrdDiffusionImageWriter::New().GetPointer() ); m_FileWriters.push_back( NrrdQBallImageWriter::New().GetPointer() ); m_FileWriters.push_back( NrrdTensorImageWriter::New().GetPointer() ); m_FileWriters.push_back( mitk::FiberBundleWriter::New().GetPointer() ); mitk::CoreObjectFactory::GetInstance()->RegisterExtraFactory(this); CreateFileExtensionsMap(); alreadyDone = true; } } mitk::Mapper::Pointer mitk::DiffusionImagingObjectFactory::CreateMapper(mitk::DataNode* node, MapperSlotId id) { mitk::Mapper::Pointer newMapper=NULL; if ( id == mitk::BaseRenderer::Standard2D ) { std::string classname("QBallImage"); if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::CompositeMapper::New(); newMapper->SetDataNode(node); node->SetMapper(3, ((CompositeMapper*)newMapper.GetPointer())->GetImageMapper()); } classname = "TensorImage"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::CompositeMapper::New(); newMapper->SetDataNode(node); node->SetMapper(3, ((CompositeMapper*)newMapper.GetPointer())->GetImageMapper()); } classname = "DiffusionImage"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::DiffusionImageMapper::New(); newMapper->SetDataNode(node); } } else if ( id == mitk::BaseRenderer::Standard3D ) { std::string classname("QBallImage"); if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::GPUVolumeMapper3D::New(); newMapper->SetDataNode(node); } classname = "TensorImage"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::GPUVolumeMapper3D::New(); newMapper->SetDataNode(node); } classname = "DiffusionImage"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::GPUVolumeMapper3D::New(); newMapper->SetDataNode(node); } classname = "FiberBundle"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::FiberBundleMapper3D::New(); newMapper->SetDataNode(node); } } return newMapper; } void mitk::DiffusionImagingObjectFactory::SetDefaultProperties(mitk::DataNode* node) { std::string classname = "QBallImage"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { mitk::CompositeMapper::SetDefaultProperties(node); mitk::GPUVolumeMapper3D::SetDefaultProperties(node); } classname = "TensorImage"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { mitk::CompositeMapper::SetDefaultProperties(node); mitk::GPUVolumeMapper3D::SetDefaultProperties(node); } classname = "DiffusionImage"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { mitk::DiffusionImageMapper::SetDefaultProperties(node); mitk::GPUVolumeMapper3D::SetDefaultProperties(node); } classname = "FiberBundle"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { mitk::FiberBundleMapper3D::SetDefaultProperties(node); } } const char* mitk::DiffusionImagingObjectFactory::GetFileExtensions() { std::string fileExtension; this->CreateFileExtensions(m_FileExtensionsMap, fileExtension); return fileExtension.c_str(); }; mitk::CoreObjectFactoryBase::MultimapType mitk::DiffusionImagingObjectFactory::GetFileExtensionsMap() { return m_FileExtensionsMap; } const char* mitk::DiffusionImagingObjectFactory::GetSaveFileExtensions() { std::string fileExtension; this->CreateFileExtensions(m_SaveFileExtensionsMap, fileExtension); return fileExtension.c_str(); }; mitk::CoreObjectFactoryBase::MultimapType mitk::DiffusionImagingObjectFactory::GetSaveFileExtensionsMap() { return m_SaveFileExtensionsMap; } void mitk::DiffusionImagingObjectFactory::CreateFileExtensionsMap() { m_FileExtensionsMap.insert(std::pair("*.dwi", "Diffusion Weighted Images")); m_FileExtensionsMap.insert(std::pair("*.hdwi", "Diffusion Weighted Images")); m_FileExtensionsMap.insert(std::pair("*.nii", "Diffusion Weighted Images for FSL")); m_FileExtensionsMap.insert(std::pair("*.fsl", "Diffusion Weighted Images for FSL")); m_FileExtensionsMap.insert(std::pair("*.fslgz", "Diffusion Weighted Images for FSL")); m_FileExtensionsMap.insert(std::pair("*.qbi", "Q-Ball Images")); m_FileExtensionsMap.insert(std::pair("*.hqbi", "Q-Ball Images")); m_FileExtensionsMap.insert(std::pair("*.dti", "Tensor Images")); m_FileExtensionsMap.insert(std::pair("*.hdti", "Tensor Images")); m_FileExtensionsMap.insert(std::pair("*.fib", "Fiber Bundle")); m_SaveFileExtensionsMap.insert(std::pair("*.dwi", "Diffusion Weighted Images")); m_SaveFileExtensionsMap.insert(std::pair("*.hdwi", "Diffusion Weighted Images")); m_SaveFileExtensionsMap.insert(std::pair("*.nii", "Diffusion Weighted Images for FSL")); m_SaveFileExtensionsMap.insert(std::pair("*.fsl", "Diffusion Weighted Images for FSL")); m_SaveFileExtensionsMap.insert(std::pair("*.fslgz", "Diffusion Weighted Images for FSL")); m_SaveFileExtensionsMap.insert(std::pair("*.qbi", "Q-Ball Images")); m_SaveFileExtensionsMap.insert(std::pair("*.hqbi", "Q-Ball Images")); m_SaveFileExtensionsMap.insert(std::pair("*.dti", "Tensor Images")); m_SaveFileExtensionsMap.insert(std::pair("*.hdti", "Tensor Images")); m_SaveFileExtensionsMap.insert(std::pair("*.fib", "Fiber Bundle")); } void mitk::DiffusionImagingObjectFactory::RegisterIOFactories() { } void RegisterDiffusionImagingObjectFactory() { static bool oneDiffusionImagingObjectFactoryRegistered = false; if ( ! oneDiffusionImagingObjectFactoryRegistered ) { MITK_INFO << "Registering DiffusionImagingObjectFactory..." << std::endl; mitk::CoreObjectFactory::GetInstance()->RegisterExtraFactory(mitk::DiffusionImagingObjectFactory::New()); oneDiffusionImagingObjectFactoryRegistered = true; } } diff --git a/Modules/DiffusionImaging/Rendering/mitkFiberBundleMapper3D.cpp b/Modules/DiffusionImaging/Rendering/mitkFiberBundleMapper3D.cpp new file mode 100644 index 0000000000..126e80b35c --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkFiberBundleMapper3D.cpp @@ -0,0 +1,1136 @@ +/*========================================================================= + + Program: Medical Imaging & Interaction Toolkit + Language: C++ + Date: $Date: 2009-05-12 19:56:03 +0200 (Di, 12 Mai 2009) $ + Version: $Revision: 17179 $ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + + +#include "mitkProperties.h" +#include "mitkFiberBundleMapper3D.h" + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "vtkVertex.h" + +#include +#include +#include +#include +#include + +//template +mitk::FiberBundleMapper3D::FiberBundleMapper3D() +: m_vtkFiberList(NULL), +m_VtkFiberDataMapperGL(NULL), +m_vtkTubeMapper(NULL) + +{ + //MITK_INFO << "FiberBundleMapper3D()"; + m_FiberAssembly = vtkPropAssembly::New(); + m_FiberActor = vtkOpenGLActor::New(); + m_TubeActor = vtkOpenGLActor::New(); + + + /* + vtkUnsignedCharArray *colorsT = vtkUnsignedCharArray::New(); + colorsT->SetName("Colors"); + colorsT->SetNumberOfComponents(4); + + unsigned char red1[4] = {255, 0, 0 , 10}; + colorsT->InsertNextTupleValue(red1); + + unsigned char red2[4] = {255,0, 0 , 255}; + colorsT->InsertNextTupleValue(red2); + + colorsT->SetValue(3, (unsigned char)(255)); + colorsT->SetValue(7, (unsigned char)(255)); + + + + + + + + //Create points for polyline1. + double origin[3] = {100.0, 400.0, 0.0}; + double p0[3] = {300.0, 400.0, 0.0}; + double p1[3] = {300.0, 200.0, 0.0}; + double p2[3] = {100.0, 300.0, 0.0}; + double p3[3] = {130.0, 250.0, 0.0}; + + //create points for polyline2 + //double p01[3] = {50.0, 50.0, 13.0}; + //double p11[3] = {200.0, 100.0, 13.0}; + + //insert points to vtkPointarray + vtkPoints *pnts = vtkPoints::New(); + pnts->InsertPoint(0,origin); + pnts->InsertPoint(1,p0); + pnts->InsertPoint(2,p1); + pnts->InsertPoint(3,p2); + //pnts->InsertPoint(4,p01); + //pnts->InsertPoint(5,p11); + pnts->InsertPoint(4,p3); + + //generate and define polyline1 + vtkPolyLine *polyLine = vtkPolyLine::New(); + polyLine->GetPointIds()->SetNumberOfIds(4); + polyLine->GetPointIds()->SetId(0,0); + polyLine->GetPointIds()->SetId(1,1); + polyLine->GetPointIds()->SetId(2,2); + polyLine->GetPointIds()->SetId(3,3); + + /*generate and define polyline2 + vtkPolyLine *polyLine2 = vtkPolyLine::New(); + polyLine2->GetPointIds()->SetNumberOfIds(2); + polyLine2->GetPointIds()->SetId(0,4); + polyLine2->GetPointIds()->SetId(1,5); + */ + + /* + vtkVertex *vtx = vtkVertex::New(); + vtx->GetPointIds()->SetNumberOfIds(1); + vtx->GetPointIds()->SetId(0,4); + + vtkCellArray *lines = vtkCellArray::New(); + lines->InsertNextCell(polyLine); + //lines->InsertNextCell(vtx); + //lines->InsertNextCell(polyLine2); + + + vtkCellArray *vertx = vtkCellArray::New(); + vertx->InsertNextCell(vtx); + + vtkPolyData *polyDataT = vtkPolyData::New(); + polyDataT->SetPoints(pnts); + polyDataT->SetLines(lines); + polyDataT->SetVerts(vertx); + + //color and opacity handling + vtkUnsignedCharArray *colorT = vtkUnsignedCharArray::New(); + colorT->SetName("Colors"); + + colorT->SetNumberOfComponents(4); //4 components cuz of RGBA + unsigned char rgba[4] = {255,0,0,255}; + unsigned char rgba2[4] = {0,255,0,255}; + + //if just 1 point in there + colorT->InsertNextTupleValue(rgba); + colorT->InsertNextTupleValue(rgba2); + colorT->InsertNextTupleValue(rgba); + colorT->InsertNextTupleValue(rgba2); + colorT->InsertNextTupleValue(rgba); + + /*for(int i=0; i<6; i++) + { + + + double vtkPntTmp[3]; + pnts->GetPoint(i, vtkPntTmp); + double vtkPntTmpNxt[3]; + pnts->GetPoint(i+1, vtkPntTmpNxt); + + vnl_vector_fixed< double, 3 > tmpPntvtk( vtkPntTmp[0], vtkPntTmp[1],vtkPntTmp[2]); + vnl_vector_fixed< double, 3 > nxttmpPntvtk(vtkPntTmpNxt[0], vtkPntTmpNxt[1], vtkPntTmpNxt[2]); + + vnl_vector_fixed< double, 3 > diff; + diff = tmpPntvtk - nxttmpPntvtk; + diff.normalize(); + + rgba[0] = (unsigned char) (255.0 * std::abs(diff[0])); + rgba[1] = (unsigned char) (255.0 * std::abs(diff[1])); + rgba[2] = (unsigned char) (255.0 * std::abs(diff[2])); + rgba[3] = (unsigned char) (255.0); + + + if(i==3) + { + colorT->InsertNextTupleValue(rgba); + colorT->InsertNextTupleValue(rgba); + }else if(i==4) + { + //do nothing + }else{ + colorT->InsertNextTupleValue(rgba); + } + + + + } + + /* + unsigned char red[4] = {255, 0, 0 , 20}; + unsigned char green[4] = {0, 255, 0 , 190}; + unsigned char blue[4] = {0, 0, 255, 255}; + unsigned char white[4] = {255, 255, 255, 255}; + + colorT->InsertNextTupleValue(red); //color for point0 + colorT->InsertNextTupleValue(green); //color for point1 + colorT->InsertNextTupleValue(blue); + colorT->InsertNextTupleValue(white); + colorT->InsertNextTupleValue(white); + colorT->InsertNextTupleValue(white); //color for point5 + + polyDataT->GetPointData()->AddArray(colorT); + + + vtkTubeFilter *tube = vtkTubeFilter::New(); + tube->SetInput(polyDataT); + tube->SetNumberOfSides(8); + tube->SetRadius(5); + + vtkSmartPointer mapper = + vtkSmartPointer::New(); + mapper->SetInput(polyDataT); + //mapper->SetInputConnection(tube->GetOutputPort()); + mapper->ScalarVisibilityOn(); + mapper->SetScalarModeToUsePointFieldData(); + //mapper->SetColorModeToMapScalars(); + mapper->SelectColorArray("Colors"); + + vtkSmartPointer actor = + vtkSmartPointer::New(); + actor->SetMapper(mapper); + actor->GetProperty()->SetOpacity(1.0); + //actor->GetProperty()->SetLineWidth(20); + actor->GetProperty()->SetPointSize(5.0); + + + vtkSmartPointer renderer = + vtkSmartPointer::New(); + renderer->AddActor(actor); + //renderer->SetBackground(.2, .3, .4); + + // Make an oblique view + renderer->GetActiveCamera()->Azimuth(30); + renderer->GetActiveCamera()->Elevation(30); + renderer->ResetCamera(); + + vtkSmartPointer renWin = + vtkSmartPointer::New(); + vtkSmartPointer + iren = vtkSmartPointer::New(); + + iren->SetRenderWindow(renWin); + renWin->AddRenderer(renderer); + //renWin->LineSmoothingOff(); + renWin->SetSize(500, 500); + renWin->Render(); + + vtkSmartPointer style = + vtkSmartPointer::New(); + iren->SetInteractorStyle(style); + + iren->Start(); + MITK_INFO << "swerwas"; + + /* + + + // Spiral tube + double vX, vY, vZ; + unsigned int nV = 256; // No. of vertices + unsigned int nCyc = 5; // No. of spiral cycles + double rT1 = 0.1, rT2 = 0.5;// Start/end tube radii + double rS = 2; // Spiral radius + double h = 10; // Height + unsigned int nTv = 8; // No. of surface elements for each tube vertex + + unsigned int i; + + // Create points and cells for the spiral + vtkSmartPointer points = vtkSmartPointer::New(); + for(i = 0; i < nV; i++) + { + // Spiral coordinates + vX = rS * cos(2 * 3 * nCyc * i / (nV - 1)); + vY = rS * sin(2 * 3 * nCyc * i / (nV - 1)); + vZ = h * i / nV; + points->InsertPoint(i, vX, vY, vZ); + } + + vtkSmartPointer lines = + vtkSmartPointer::New(); + lines->InsertNextCell(nV); + for (i = 0; i < nV; i++) + { + lines->InsertCellPoint(i); + } + + + vtkSmartPointer polyData = + vtkSmartPointer::New(); + polyData->SetPoints(points); + polyData->SetLines(lines); + + + // RBG array (could add Alpha channel too I guess...) + // Varying from blue to red + vtkSmartPointer colors = + vtkSmartPointer::New(); + colors->SetName("Colors"); + colors->SetNumberOfComponents(3); + colors->SetNumberOfTuples(nV); + for (i = 0; i < nV ;i++) + { + + unsigned char red[3] = {char(255 * i/ (nV - 1)),0,char(255 * (nV - 1 - i)/(nV - 1))}; + + colors->InsertNextTupleValue( red); + } + polyData->GetPointData()->AddArray(colors); + + + + vtkSmartPointer mapper = + vtkSmartPointer::New(); + mapper->SetInput(polyData); + mapper->ScalarVisibilityOn(); + mapper->SetScalarModeToUsePointFieldData(); + mapper->SelectColorArray("Colors"); + + vtkSmartPointer actor = + vtkSmartPointer::New(); + actor->SetMapper(mapper); + + vtkSmartPointer renderer = + vtkSmartPointer::New(); + renderer->AddActor(actor); + renderer->SetBackground(.2, .3, .4); + + // Make an oblique view + renderer->GetActiveCamera()->Azimuth(30); + renderer->GetActiveCamera()->Elevation(30); + renderer->ResetCamera(); + + vtkSmartPointer renWin = + vtkSmartPointer::New(); + vtkSmartPointer + iren = vtkSmartPointer::New(); + + iren->SetRenderWindow(renWin); + renWin->AddRenderer(renderer); + renWin->SetSize(500, 500); + renWin->Render(); + + vtkSmartPointer style = + vtkSmartPointer::New(); + iren->SetInteractorStyle(style); + + iren->Start(); + + + + + /* + + double origin[3] = {0.0, 0.0, 0.0}; + double p0[3] = {10.0, 0.0, 0.0}; + double p1[3] = {10.0, 10.0, 0.0}; + double p2[3] = {0.0, 10.0, 0.0}; + double p3[3] = {10.0, 10.0, 0.0}; + double p4[3] = {10.0, 20.0, 0.0}; + double p5[3] = {0.0, 20.0, 0.0}; + + //create a vtkPoints object and store the points in it + vtkSmartPointer points = + vtkSmartPointer::New(); + points->InsertNextPoint(origin); + points->InsertNextPoint(p0); + points->InsertNextPoint(p1); + points->InsertNextPoint(p2); + points->InsertNextPoint(p3); + points->InsertNextPoint(p4); + points->InsertNextPoint(p5); + + vtkSmartPointer polyLine = + vtkSmartPointer::New(); + polyLine->GetPointIds()->SetNumberOfIds(7); + for(unsigned int i = 0; i < 7; i++) + { + polyLine->GetPointIds()->SetId(i,i); + } + + double origin2[3] = {30.0, 0.0, 0.0}; + double p02[3] = {40.0, 0.0, 0.0}; + double p12[3] = {40.0, 20.0, 0.0}; + double p22[3] = {30.0, 20.0, 0.0}; + double p23[3] = {30.0, 0.0, 0.0}; + + + points->InsertNextPoint(origin2); + points->InsertNextPoint(p02); + points->InsertNextPoint(p12); + points->InsertNextPoint(p22); + points->InsertNextPoint(p23); + + vtkSmartPointer polyLine2 = + vtkSmartPointer::New(); + polyLine2->GetPointIds()->SetNumberOfIds(5); + for(unsigned int i = 0; i < 5; i++) + { + polyLine2->GetPointIds()->SetId(i,i+7); + } + + //Create a cell array to store the lines in and add the lines to it + vtkSmartPointer cells = + vtkSmartPointer::New(); + cells->InsertNextCell(polyLine); + cells->InsertNextCell(polyLine2); + + + //Create a polydata to store everything in + vtkSmartPointer polyData = + vtkSmartPointer::New(); + + //add the points to the dataset + polyData->SetPoints(points); + + //add the lines to the dataset + polyData->SetLines(cells); + //setup actor and mapper + vtkSmartPointer mapper = + vtkSmartPointer::New(); + mapper->SetInput(polyData); + + vtkSmartPointer actor = + vtkSmartPointer::New(); + actor->SetMapper(mapper); + + m_FiberAssembly->AddPart(actor); + */ + + + +} + +//template +mitk::FiberBundleMapper3D::~FiberBundleMapper3D() +{ + //MITK_INFO << "FiberBundleMapper3D(destructor)"; + m_FiberActor->Delete(); + m_FiberAssembly->Delete(); + //m_vtkFiberList->Delete(); + //m_VtkFiberDataMapperGL->Delete(); + //m_VtkFiberDataMapper->Delete(); + +} + + +const mitk::FiberBundle* mitk::FiberBundleMapper3D::GetInput() +{ + //MITK_INFO << "FiberBundleMapper3D GetInput()" ; + + return static_cast ( GetData() ); +} + +/* + This method is called once the mapper gets new input, + for UI rotation or changes in colorcoding this method is NOT called + */ +void mitk::FiberBundleMapper3D::GenerateData() +{ + /* ######## FIBER PREPARATION START ######### */ + //get fiberbundle + mitk::FiberBundle::Pointer PFiberBundle = dynamic_cast< mitk::FiberBundle* > (this->GetData()); + + //get groupFiberBundle, which is a datastructure containing single fibers + mitk::FiberBundle::FiberGroupType::Pointer groupFiberBundle = PFiberBundle->GetGroupFiberBundle(); + + //extractn single fibers + //in the groupFiberBundle all smartPointers to single fibers are stored in in a ChildrenList + mitk::FiberBundle::ChildrenListType * FiberList; + FiberList = groupFiberBundle->GetChildren(); + + /* ######## FIBER PREPARATION END ######### */ + + /* ######## VTK FIBER REPRESENTATION ######## */ + //create a vtkPoints object and store the all the brainFiber points in it + + vtkPoints* vtkSmoothPoints = vtkPoints::New(); //in smoothpoints the interpolated points representing a fiber are stored. + + //in vtkcells all polylines are stored, actually all id's of them are stored + vtkCellArray *vtkSmoothCells = vtkCellArray::New(); //cellcontainer for smoothed lines + + //in some cases a fiber includes just 1 point, so put it in here + vtkCellArray *vtkVrtxs = vtkCellArray::New(); + + //colors and alpha value for each single point, RGBA = 4 components + vtkUnsignedCharArray *colorsT = vtkUnsignedCharArray::New(); + colorsT->SetNumberOfComponents(4); + colorsT->SetName("ColorValues"); + + vtkDoubleArray *faColors = vtkDoubleArray::New(); + faColors->SetName("FaColors"); + + vtkDoubleArray *tubeRadius = vtkDoubleArray::New(); + tubeRadius->SetName("TubeRadius"); + + + // iterate through FiberList + for(mitk::FiberBundle::ChildrenListType::iterator itLst = FiberList->begin(); + itLst != FiberList->end(); + ++itLst) + { + //all points are stored in one vtkpoints list, soooooooo that the lines find their point id to start and end we need some kind of helper index who monitors the current ids for a polyline + //unsigned long pntIdxHelper = vtkpointsDTI->GetNumberOfPoints(); + + // lists output is SpatialObject, we know we have DTITubeSpacialObjects + // dynamic cast only likes pointers, no smartpointers, so each dsmartpointer has membermethod .GetPointer() + itk::SpatialObject<3>::Pointer tmp_fbr; + tmp_fbr = *itLst; + mitk::FiberBundle::DTITubeType::Pointer dtiTract = dynamic_cast< mitk::FiberBundle::DTITubeType * > (tmp_fbr.GetPointer()); + if (dtiTract.IsNull()) { + return; } + + //get list of points + int fibrNrPnts = dtiTract->GetNumberOfPoints(); + mitk::FiberBundle::DTITubeType::PointListType dtiPntList = dtiTract->GetPoints(); + + //MITK_INFO << "REAL AMOUNT OF FIBERS: " << fibrNrPnts; + + vtkPoints *vtkpointsDTI = vtkPoints::New(); + + if (fibrNrPnts <= 0) { //this should never occour! but who knows + MITK_INFO << "HyperERROR in fiberBundleMapper3D.cpp ...no point in fiberBundle!!! .. check ur trackingAlgorithm"; + continue; + } + + + ///////PROCESS ON FIBERS//////// + for (int i=0; i1 + PFiberBundle->GetGeometry()->IndexToWorld(indexPnt, worldPnt); + double worldFbrPnt[3] = {worldPnt[0], worldPnt[1], worldPnt[2]}; + vtkpointsDTI->InsertNextPoint(worldFbrPnt); + } + + //MITK_INFO << "REDUCED AMOUNT OF FIBERS: " << vtkpointsDTI->GetNumberOfPoints(); + + ////POINTS OF DTI ARE READY FOR FUTHER VTK PROCESSING//// + } + + + /////PROCESS POLYLINE SMOOTHING///// + vtkKochanekSpline* xSpline = vtkKochanekSpline::New(); + vtkKochanekSpline* ySpline = vtkKochanekSpline::New(); + vtkKochanekSpline* zSpline = vtkKochanekSpline::New(); + + vtkParametricSpline* spline = vtkParametricSpline::New(); + spline->SetXSpline(xSpline); + spline->SetYSpline(ySpline); + spline->SetZSpline(zSpline); + spline->SetPoints(vtkpointsDTI); + + + vtkParametricFunctionSource* functionSource = vtkParametricFunctionSource::New(); + functionSource->SetParametricFunction(spline); + functionSource->SetUResolution(200); + functionSource->SetVResolution(200); + functionSource->SetWResolution(200); + functionSource->Update(); + + + + vtkPolyData* outputFunction = functionSource->GetOutput(); + vtkPoints* tmpSmoothPnts = outputFunction->GetPoints(); //smoothPoints of current fiber + + vtkPolyLine* smoothLine = vtkPolyLine::New(); + smoothLine->GetPointIds()->SetNumberOfIds(tmpSmoothPnts->GetNumberOfPoints()); +// MITK_INFO << "SMOOTHED AMOUNT OF POINTS:" << tmpSmoothPnts->GetNumberOfPoints(); + + + /////CREATE SMOOTH POLYLINE OBJECT//// + /////MANAGE LINE AND CORRELATED POINTS///// + int pointHelperCnt = vtkSmoothPoints->GetNumberOfPoints(); //also put current points into global smooth pointcontainer + int nrSmPnts = tmpSmoothPnts->GetNumberOfPoints(); + tubeRadius->SetNumberOfTuples(nrSmPnts); + double tbradius = 1;//default value for radius + + for(int ism=0; ismGetPointIds()->SetId(ism, ism+pointHelperCnt); + vtkSmoothPoints->InsertNextPoint(tmpSmoothPnts->GetPoint(ism)); + + // MITK_INFO << "LinePntID: " << ism << " linked to: " << ism+pointHelperCnt << " val: " << tmpSmoothPnts->GetPoint(ism)[0] << " " << tmpSmoothPnts->GetPoint(ism)[1] << " " << tmpSmoothPnts->GetPoint(ism)[2]; + tubeRadius->SetTuple1(ism,tbradius); //tuple with 1 argument + + + //colorcoding orientation based + unsigned char rgba[4] = {0,0,0,0}; + if (ism < nrSmPnts-1 && ism>0) + { + + // MITK_INFO << "inbetween fiber, at position:" << ism; +// //nimm nur diff1 + vnl_vector_fixed< double, 3 > tmpPntvtk(tmpSmoothPnts->GetPoint(ism)[0], tmpSmoothPnts->GetPoint(ism)[1],tmpSmoothPnts->GetPoint(ism)[2]); + vnl_vector_fixed< double, 3 > nxttmpPntvtk(tmpSmoothPnts->GetPoint(ism+1)[0], tmpSmoothPnts->GetPoint(ism+1)[1], tmpSmoothPnts->GetPoint(ism+1)[2]); + vnl_vector_fixed< double, 3 > prevtmpPntvtk(tmpSmoothPnts->GetPoint(ism-1)[0], tmpSmoothPnts->GetPoint(ism-1)[1], tmpSmoothPnts->GetPoint(ism-1)[2]); + + vnl_vector_fixed< double, 3 > diff1; + diff1 = tmpPntvtk - nxttmpPntvtk; + diff1.normalize(); + + vnl_vector_fixed< double, 3 > diff2; + diff2 = tmpPntvtk - prevtmpPntvtk; + diff2.normalize(); + + vnl_vector_fixed< double, 3 > diff; + diff = (diff1 - diff2)/2.0; + + + rgba[0] = (unsigned char) (255.0 * std::abs(diff[0])); + rgba[1] = (unsigned char) (255.0 * std::abs(diff[1])); + rgba[2] = (unsigned char) (255.0 * std::abs(diff[2])); + rgba[3] = (unsigned char) (255.0); + + + + } else if(ism==0) { + //explicit handling of startpoint of line + + //nimm nur diff1 + vnl_vector_fixed< double, 3 > tmpPntvtk(tmpSmoothPnts->GetPoint(ism)[0], tmpSmoothPnts->GetPoint(ism)[1],tmpSmoothPnts->GetPoint(ism)[2]); + vnl_vector_fixed< double, 3 > nxttmpPntvtk(tmpSmoothPnts->GetPoint(ism+1)[0], tmpSmoothPnts->GetPoint(ism+1)[1], tmpSmoothPnts->GetPoint(ism+1)[2]); + + + vnl_vector_fixed< double, 3 > diff1; + diff1 = tmpPntvtk - nxttmpPntvtk; + diff1.normalize(); + + rgba[0] = (unsigned char) (255.0 * std::abs(diff1[0])); + rgba[1] = (unsigned char) (255.0 * std::abs(diff1[1])); + rgba[2] = (unsigned char) (255.0 * std::abs(diff1[2])); + rgba[3] = (unsigned char) (255.0); + +// MITK_INFO << "first point color: " << rgba[0] << " " << rgba[1] << " " << rgba[2]; + + + } else if(ism==nrSmPnts-1) { +// last point in fiber + + // nimm nur diff2 + vnl_vector_fixed< double, 3 > tmpPntvtk(tmpSmoothPnts->GetPoint(ism)[0], tmpSmoothPnts->GetPoint(ism)[1],tmpSmoothPnts->GetPoint(ism)[2]); + vnl_vector_fixed< double, 3 > prevtmpPntvtk(tmpSmoothPnts->GetPoint(ism-1)[0], tmpSmoothPnts->GetPoint(ism-1)[1], tmpSmoothPnts->GetPoint(ism-1)[2]); + + vnl_vector_fixed< double, 3 > diff2; + diff2 = tmpPntvtk - prevtmpPntvtk; + diff2.normalize(); + + rgba[0] = (unsigned char) (255.0 * std::abs(diff2[0])); + rgba[1] = (unsigned char) (255.0 * std::abs(diff2[1])); + rgba[2] = (unsigned char) (255.0 * std::abs(diff2[2])); + rgba[3] = (unsigned char) (255.0); +// +// MITK_INFO << "last point color: " << rgba[0] << " " << rgba[1] << " " << rgba[2]; + } //end colorcoding +// + colorsT->InsertNextTupleValue(rgba); + + }//end of smoothline + + ///////smooth Fiber ready//////// + vtkSmoothCells->InsertNextCell(smoothLine); + } + + //vtkpointsDTI->Delete();//points are not needed anymore TODO uncomment! + + + /* + + //get FA value ... for that FA has to be interpolated as well as DTItracktLine + float faVal = tmpFiberPntLst.GetField(mitk::FiberBundle::DTITubePointType::FA); + //use insertNextValue cuz FA Values are reperesented as a single number (1 Tuple containing 1 parameter) + faColors->InsertNextValue((double) faVal); + + */ + //vtkcells->InitTraversal(); + + // Put points and lines together in one polyData structure + vtkPolyData *polyData = vtkPolyData::New(); + polyData->SetPoints(vtkSmoothPoints); + polyData->SetLines(vtkSmoothCells); + + if (vtkVrtxs->GetSize() > 0) { + polyData->SetVerts(vtkVrtxs); + } + polyData->GetPointData()->AddArray(colorsT); + //polyData->GetPointData()->AddArray(faColors); + //polyData->GetPointData()->AddArray(tubeRadius); + + + vtkLookupTable *lut = vtkLookupTable::New(); + lut->Build(); + + + m_VtkFiberDataMapperGL = vtkOpenGLPolyDataMapper::New(); + m_VtkFiberDataMapperGL->SetInput(polyData); + m_VtkFiberDataMapperGL->ScalarVisibilityOn(); + + m_VtkFiberDataMapperGL->SetScalarModeToUsePointFieldData(); + //m_VtkFiberDataMapperGL->SelectColorArray("FaColors"); + m_VtkFiberDataMapperGL->SelectColorArray("ColorValues"); + m_VtkFiberDataMapperGL->SetLookupTable(lut); + + m_vtkTubeMapper = vtkOpenGLPolyDataMapper::New(); + + //m_FiberActor = vtkOpenGLActor::New(); + m_FiberActor->SetMapper(m_VtkFiberDataMapperGL); + m_FiberActor->GetProperty()->SetOpacity(1.0); + m_FiberActor->GetProperty()->SetPointSize(4.0f); + // m_FiberActor->GetProperty()->SetColor(255.0, 0.0, 0.0); + + + + m_FiberAssembly->AddPart(m_FiberActor); + + //setting color and opacity in the fiberActor itself is not recommended + //here cuz color and opacity of dataNode will be considered in GetData(baserenderer*) anyway + this->GetDataNode()->SetColor(255.0,0,0); + this->GetDataNode()->SetOpacity(1.0); + + +} + + + + +//template +void mitk::FiberBundleMapper3D::GenerateData( mitk::BaseRenderer *renderer ) +{ + + + //MITK_INFO << "FiberBundleMapper3D GenerateData(BaseRenderer)" ; + + // nodeCC = 1 ... ROI colorcoding + // 2 ... orientation colorcoding + // 3 ... FA colorcoding + + + int nodeCC; + bool isCCd = this->GetDataNode()->GetPropertyValue("ColorCoding", nodeCC); + if ( isCCd && nodeCC == 1 ) { + + + //get color and opacity from DataNode + int tmpline; + + bool isLineProp = this->GetDataNode()->GetPropertyValue("LineWidth",tmpline); + + bool isPointRep; + bool successPointProp = this->GetDataNode()->GetPropertyValue("RepPoints", isPointRep); + float pointSize; + bool successPointSize = this->GetDataNode()->GetPropertyValue("pointSize", pointSize); + + if (isLineProp) { + m_FiberActor->GetProperty()->SetLineWidth(tmpline); + } + + if(isPointRep) { + m_FiberActor->GetProperty()->SetRepresentationToPoints(); + m_FiberActor->GetProperty()->SetPointSize(pointSize); + } + + } else if (isCCd && nodeCC == 2) { + float tmpopa; + this->GetDataNode()->GetOpacity(tmpopa, NULL); + m_FiberActor->GetProperty()->SetOpacity((double) tmpopa); + + } else if (isCCd && nodeCC == 3) { + + float temprgb[3]; + this->GetDataNode()->GetColor( temprgb, NULL ); + double trgb[3] = { (double) temprgb[0], (double) temprgb[1], (double) temprgb[2] }; + m_FiberActor->GetProperty()->SetColor(trgb); + + if(m_VtkFiberDataMapperGL->GetScalarVisibility()) //can be 0 or 1, for scalarVis On or Off + { + m_VtkFiberDataMapperGL->ScalarVisibilityOff(); + } + + + + } else if (isCCd && nodeCC == 4) { + + if(!m_VtkFiberDataMapperGL->GetScalarVisibility()) //can be 0 or 1, for scalarVis On or Off + { + m_VtkFiberDataMapperGL->ScalarVisibilityOn(); + } + m_VtkFiberDataMapperGL->SelectColorArray("ColorValues"); + + } else if (isCCd && nodeCC == 5){ + + if(!m_VtkFiberDataMapperGL->GetScalarVisibility()) //if visibility is off, switch it on + { + m_VtkFiberDataMapperGL->ScalarVisibilityOn(); + } + m_VtkFiberDataMapperGL->SelectColorArray("FaColors"); + + } else if (isCCd && nodeCC == 6){ + //orientationbased colorcoding + FA as opacity + //get FA out of polydata, which is saved in faColor vtkDoubleArray + + vtkPolyData *tmpPolyData = m_VtkFiberDataMapperGL->GetInput(); + vtkPointData *tmpPointData = tmpPolyData->GetPointData(); + + + + int hasAr = tmpPointData->HasArray("FaColors"); + if(!hasAr) + return; + + vtkDoubleArray *tmpFAarray = (vtkDoubleArray*)(tmpPointData->GetArray("FaColors")) ; + + /*for(int i=0; iGetNumberOfTuples(); i++) + { + + double *tmpTuple; + tmpFAarray->GetTuple(i, tmpTuple); + + for(int j=0; jGetNumberOfComponents(); j++) + { + MITK_INFO << "FA Value: at index " << i << ": " << tmpTuple[j]; + } + + + } + */ + + //since we have our FA values, lets replace the alpha values in colorT + //we know each 4th entry is a A value of RGBA + int hasArCV = tmpPointData->HasArray("ColorValues"); + if(!hasArCV) + return; + + vtkUnsignedCharArray *colorsTtmp = dynamic_cast (tmpPointData->GetArray("ColorValues")); + + for(int i=0; iGetNumberOfTuples(); i++) + { + + //double *tmpTupleCV = colorsTtmp->GetTuple4(i); + double tmpTupleFA = tmpFAarray->GetTuple1(i); + tmpTupleFA = tmpTupleFA * 255.0; + + colorsTtmp->SetComponent(i,3, tmpTupleFA ); + + // MITK_INFO << "----" << i; + //MITK_INFO << tmpTupleCV[0]; + //MITK_INFO << tmpTupleCV[1]; + //MITK_INFO << tmpTupleCV[2]; + //MITK_INFO << tmpTupleCV[3]; + //double *test = m_VtkFiberDataMapperGL->GetInput()->GetPointData()->GetArray("ColorValues")->GetTuple4(i); + //MITK_INFO << test[0]; + //MITK_INFO << test[1]; + //MITK_INFO << test[2]; + //MITK_INFO << test[3]; + + + } + + m_VtkFiberDataMapperGL->SelectColorArray(""); + m_VtkFiberDataMapperGL->SelectColorArray("ColorValues"); + + + } else if (isCCd && nodeCC == 7){ + + vtkPolyData *tmpPolyData = m_VtkFiberDataMapperGL->GetInput(); + vtkPointData *tmpPointData = tmpPolyData->GetPointData(); + int hasArCV = tmpPointData->HasArray("ColorValues"); + if(!hasArCV) + return; + + vtkUnsignedCharArray *colorsTtmp = dynamic_cast (tmpPointData->GetArray("ColorValues")); + + for(int i=0; iGetNumberOfTuples(); i++) + { + + double tmpTupleFA = 255.0; + colorsTtmp->SetComponent(i,3, tmpTupleFA ); + } + m_VtkFiberDataMapperGL->SelectColorArray(""); + m_VtkFiberDataMapperGL->SelectColorArray("ColorValues"); + + + } else if (isCCd && nodeCC == 8) { + /* something is still missing to activate smoothing or make it work.... */ + if (!renderer->GetRenderWindow()->GetLineSmoothing()) { + renderer->GetRenderWindow()->SetLineSmoothing(1); + renderer->GetRenderWindow()->Modified(); + } + if (!renderer->GetRenderWindow()->GetPointSmoothing()) { + renderer->GetRenderWindow()->SetPointSmoothing(1); + renderer->GetRenderWindow()->Modified(); + } + if (!renderer->GetRenderWindow()->GetPolygonSmoothing()) { + renderer->GetRenderWindow()->SetPolygonSmoothing(1); + renderer->GetRenderWindow()->Modified(); + } + + + } else if (isCCd && nodeCC == 9) { + if (renderer->GetRenderWindow()->GetLineSmoothing()) { + renderer->GetRenderWindow()->SetLineSmoothing(0); + renderer->GetRenderWindow()->Modified(); + } + if (renderer->GetRenderWindow()->GetPointSmoothing()) { + renderer->GetRenderWindow()->SetPointSmoothing(0); + renderer->GetRenderWindow()->Modified(); + } + if (renderer->GetRenderWindow()->GetPolygonSmoothing()) { + renderer->GetRenderWindow()->SetPolygonSmoothing(0); + renderer->GetRenderWindow()->Modified(); + } + + } else if (isCCd && nodeCC == 10) { + // manipulate X Coordinates of selected FiberBundle + int tmpXmove; + + bool isXmove = this->GetDataNode()->GetPropertyValue("Xmove",tmpXmove); + + if (!isXmove) + return; + + vtkPolyData *tmpPolyData = m_VtkFiberDataMapperGL->GetInput(); + vtkPoints* tmpVtkPnts = tmpPolyData->GetPoints(); + double PtmpPntVal[3]; + + for (int i=0; iGetNumberOfPoints(); ++i ) + { + tmpVtkPnts->GetPoint(i,PtmpPntVal); + + PtmpPntVal[0] = PtmpPntVal[0] + (double) tmpXmove; + tmpVtkPnts->SetPoint(i, PtmpPntVal); + + tmpPolyData->Modified(); + + } + + } else if (isCCd && nodeCC == 11) { + // manipulate Y Coordinates of selected FiberBundle + int tmpYmove; + + bool isYmove = this->GetDataNode()->GetPropertyValue("Ymove",tmpYmove); + + if (!isYmove) + return; + + vtkPolyData *tmpPolyData = m_VtkFiberDataMapperGL->GetInput(); + vtkPoints* tmpVtkPnts = tmpPolyData->GetPoints(); + double PtmpPntVal[3]; + + for (int i=0; iGetNumberOfPoints(); ++i ) + { + tmpVtkPnts->GetPoint(i,PtmpPntVal); + + PtmpPntVal[1] = PtmpPntVal[1] + (double) tmpYmove; + tmpVtkPnts->SetPoint(i, PtmpPntVal); + + tmpPolyData->Modified(); + + } + + } else if (isCCd && nodeCC == 12) { + // manipulate Z Coordinates of selected FiberBundle + int tmpZmove; + + bool isZmove = this->GetDataNode()->GetPropertyValue("Zmove",tmpZmove); + if (!isZmove) + return; + + vtkPolyData *tmpPolyData = m_VtkFiberDataMapperGL->GetInput(); + vtkPoints* tmpVtkPnts = tmpPolyData->GetPoints(); + double PtmpPntVal[3]; + + for (int i=0; iGetNumberOfPoints(); ++i ) + { + tmpVtkPnts->GetPoint(i,PtmpPntVal); + + PtmpPntVal[2] = PtmpPntVal[2] + (double) tmpZmove; + //PtmpPntVal[2] = PtmpPntVal[2] + 1; + tmpVtkPnts->SetPoint(i, PtmpPntVal); + + tmpPolyData->Modified(); + + } + + } else if (isCCd && nodeCC == 13) { + int tmpTubeSides; + bool isTubeSides = this->GetDataNode()->GetPropertyValue("TubeSides",tmpTubeSides); + + float tmpRadius; + bool isRadius = this->GetDataNode()->GetPropertyValue("TubeRadius",tmpRadius); + + if (!isTubeSides) + return; + + vtkPolyData *tmpPolyData = m_VtkFiberDataMapperGL->GetInput(); + + + m_tubes = vtkTubeFilter::New(); + m_tubes->SetInput(tmpPolyData); + m_tubes->SidesShareVerticesOn(); + m_tubes->SetRadius((double)(tmpRadius)); + m_tubes->SetNumberOfSides(tmpTubeSides); + m_tubes->Modified(); + // m_tubes->Update(); + + + m_vtkTubeMapper->SetInputConnection(m_tubes->GetOutputPort()); + m_vtkTubeMapper->ScalarVisibilityOn(); + m_vtkTubeMapper->SetScalarModeToUsePointFieldData(); + m_vtkTubeMapper->SelectColorArray(""); + m_vtkTubeMapper->SelectColorArray("ColorValues"); + + + + m_TubeActor->SetMapper(m_vtkTubeMapper); + m_TubeActor->GetProperty()->SetOpacity(1); + m_TubeActor->GetProperty()->BackfaceCullingOn(); + + m_FiberAssembly->AddPart(m_TubeActor); + m_FiberAssembly->Modified(); + + } else if (isCCd && nodeCC == 14) { + + float temprgb[3]; + this->GetDataNode()->GetColor( temprgb, NULL ); + double trgb[3] = { (double) temprgb[0], (double) temprgb[1], (double) temprgb[2] }; + m_TubeActor->GetProperty()->SetColor(trgb); + + if(m_vtkTubeMapper->GetScalarVisibility()) //can be 0 or 1, for scalarVis On or Off + { + m_vtkTubeMapper->ScalarVisibilityOff(); + } + + } else if (isCCd && nodeCC == 15) { + m_TubeActor->GetProperty()->SetOpacity(0); + m_FiberAssembly->RemovePart(m_TubeActor); + m_FiberAssembly->Modified(); + + }else if (isCCd && nodeCC == 16) { + float tmpTubeOpacity; + bool isTubeOpacity = this->GetDataNode()->GetPropertyValue("TubeOpacity",tmpTubeOpacity); + + m_TubeActor->GetProperty()->SetOpacity((double) tmpTubeOpacity); + m_TubeActor->Modified(); + + } else if (isCCd && nodeCC == 17) { + m_FiberActor->GetProperty()->SetOpacity(0); + m_FiberAssembly->RemovePart(m_FiberActor); + m_FiberAssembly->Modified(); + + }else if (isCCd && nodeCC == 18) { + m_FiberActor->GetProperty()->SetOpacity(0); + m_FiberAssembly->AddPart(m_FiberActor); + m_FiberAssembly->Modified(); + + } + + + + //MITK_INFO << m_VtkFiberDataMapperGL->GetArrayName(); + + + /* int displayIndex(0); + this->GetDataNode()->GetIntProperty( "DisplayChannel", displayIndex, renderer ); + InputImageType *input = const_cast< InputImageType* >( + this->GetInput() + ); + mitk::DiffusionImage *input2 = dynamic_cast< mitk::DiffusionImage* >( + input + ); + input2->SetDisplayIndexForRendering(displayIndex); + Superclass::GenerateData(renderer); + */ +} + +//template +void mitk::FiberBundleMapper3D::SetDefaultProperties(mitk::DataNode* node, mitk::BaseRenderer* renderer, bool overwrite) +{ + //MITK_INFO << "FiberBundleMapper3D SetDefault Properties(...)"; + node->AddProperty( "DisplayChannel", mitk::IntProperty::New( true ), renderer, overwrite ); + node->AddProperty( "LineWidth", mitk::IntProperty::New( true ), renderer, overwrite ); + node->AddProperty( "ColorCoding", mitk::IntProperty::New( 0 ), renderer, overwrite); + node->AddProperty( "VertexOpacity_1", mitk::BoolProperty::New( false ), renderer, overwrite); + node->AddProperty( "Set_FA_VertexAlpha", mitk::BoolProperty::New( false ), renderer, overwrite); + node->AddProperty( "pointSize", mitk::FloatProperty::New(0.5), renderer, overwrite); + node->AddProperty( "setShading", mitk::IntProperty::New(1), renderer, overwrite); + node->AddProperty( "Xmove", mitk::IntProperty::New( 0 ), renderer, overwrite); + node->AddProperty( "Ymove", mitk::IntProperty::New( 0 ), renderer, overwrite); + node->AddProperty( "Zmove", mitk::IntProperty::New( 0 ), renderer, overwrite); + node->AddProperty( "RepPoints", mitk::BoolProperty::New( false ), renderer, overwrite); + node->AddProperty( "TubeSides", mitk::IntProperty::New( 8 ), renderer, overwrite); + node->AddProperty( "TubeRadius", mitk::FloatProperty::New( 0.15 ), renderer, overwrite); + node->AddProperty( "TubeOpacity", mitk::FloatProperty::New( 1.0 ), renderer, overwrite); + + + Superclass::SetDefaultProperties(node, renderer, overwrite); + + + +} + +vtkProp* mitk::FiberBundleMapper3D::GetVtkProp(mitk::BaseRenderer *renderer) +{ + + //MITK_INFO << "FiberBundleMapper3D GetVtkProp(renderer)"; + return m_FiberAssembly; + +} + +void mitk::FiberBundleMapper3D::ApplyProperties(mitk::BaseRenderer* renderer) +{ + // MITK_INFO << "FiberBundleMapper3D ApplyProperties(renderer)"; +} + +void mitk::FiberBundleMapper3D::UpdateVtkObjects() +{ + // MITK_INFO << "FiberBundleMapper3D UpdateVtkObjects()"; + + +} + +void mitk::FiberBundleMapper3D::SetVtkMapperImmediateModeRendering(vtkMapper *) +{ + + + +} + + + diff --git a/Modules/DiffusionImaging/Rendering/mitkFiberBundleMapper3D.h b/Modules/DiffusionImaging/Rendering/mitkFiberBundleMapper3D.h new file mode 100644 index 0000000000..ea9cb42ca5 --- /dev/null +++ b/Modules/DiffusionImaging/Rendering/mitkFiberBundleMapper3D.h @@ -0,0 +1,103 @@ +/*========================================================================= + +Program: Medical Imaging & Interaction Toolkit +Language: C++ +Date: $Date: 2009-05-12 19:56:03 +0200 (Di, 12 Mai 2009) $ +Version: $Revision: 17179 $ + +Copyright (c) German Cancer Research Center, Division of Medical and +Biological Informatics. All rights reserved. +See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + + +#ifndef FiberBundleMapper3D_H_HEADER_INCLUDED +#define FiberBundleMapper3D_H_HEADER_INCLUDED + +//#include "mitkCommon.h" +//#include "mitkBaseRenderer.h" + +#include "mitkFiberBundle.h" +#include +#include "mitkVtkMapper3D.h" +#include "MitkDiffusionImagingMBIExports.h" +#include "mitkBaseData.h" +#include "vtkAppendPolyData.h" +#include "vtkOpenGLPolyDataMapper.h" +#include "vtkOpenGLActor.h" +#include "vtkPropAssembly.h" +#include "vtkProperty.h" +#include "vtkUnsignedCharArray.h" +#include "vtkTubeFilter.h" + + +namespace mitk { + + //##Documentation + //## @brief Mapper for FiberBundles + //## @ingroup Mapper +// template + class MitkDiffusionImagingMBI_EXPORT FiberBundleMapper3D : public VtkMapper3D + { + public: + + mitkClassMacro(FiberBundleMapper3D, VtkMapper3D); + itkNewMacro(Self); + + + const mitk::FiberBundle* GetInput(); + + virtual vtkProp *GetVtkProp(mitk::BaseRenderer *renderer); //looks like depricated.. 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 GenerateData(mitk::BaseRenderer* renderer); + virtual void GenerateData(); + + + protected: + + FiberBundleMapper3D(); + virtual ~FiberBundleMapper3D(); + + void UpdateVtkObjects(); + + + vtkAppendPolyData *m_vtkFiberList; + //vtkSmartPointer m_vtkFiberList; + + vtkOpenGLPolyDataMapper *m_VtkFiberDataMapperGL; + //vtkPainterPolyDataMapper *m_VtkFiberDataMapperGL; + //vtkSmartPointer m_VtkFiberDataMapperGL; + + //vtkOpenGLPolyDataMapper *m_VtkFiberDataMapper; + //vtkSmartPointer m_VtkFiberDataMapper; + + vtkOpenGLActor *m_FiberActor; + //vtkSmartPointer m_FiberActor; + + vtkTubeFilter *m_tubes; + vtkOpenGLActor *m_TubeActor; + vtkOpenGLPolyDataMapper *m_vtkTubeMapper; + + + vtkPropAssembly *m_FiberAssembly; + + + + }; + +} // namespace mitk + + + + +#endif /* FiberBundleMapper3D_H_HEADER_INCLUDED */ + diff --git a/Modules/DiffusionImaging/files.cmake b/Modules/DiffusionImaging/files.cmake index 2ba60f5d43..1396a5862d 100644 --- a/Modules/DiffusionImaging/files.cmake +++ b/Modules/DiffusionImaging/files.cmake @@ -1,85 +1,89 @@ SET(CPP_FILES # Algorithms Algorithms/itkDiffusionQballGeneralizedFaImageFilter.h Algorithms/itkDiffusionQballPrepareVisualizationImageFilter.h Algorithms/itkTensorDerivedMeasurementsFilter.h Algorithms/itkBrainMaskExtractionImageFilter.h Algorithms/itkB0ImageExtractionImageFilter.h Algorithms/itkTensorImageToDiffusionImageFilter.h Algorithms/itkTensorToL2NormImageFilter.h # 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 # 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 # 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 # DataStructures -> FiberBundle - DataStructures/FiberBundle/mitkFiberBundle.cpp - DataStructures/FiberBundle/mitkFiberBundleWriter.cpp - DataStructures/FiberBundle/mitkFiberBundleReader.cpp - DataStructures/FiberBundle/mitkFiberBundleIOFactory.cpp - DataStructures/FiberBundle/mitkFiberBundleWriterFactory.cpp - DataStructures/FiberBundle/mitkFiberBundleSerializer.cpp + IODataStructures/FiberBundle/mitkFiberBundle.cpp + IODataStructures/FiberBundle/mitkFiberBundleWriter.cpp + IODataStructures/FiberBundle/mitkFiberBundleReader.cpp + IODataStructures/FiberBundle/mitkFiberBundleIOFactory.cpp + IODataStructures/FiberBundle/mitkFiberBundleWriterFactory.cpp + IODataStructures/FiberBundle/mitkFiberBundleSerializer.cpp + + # DataStructures -> PlanarFigureComposite + IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.cpp # Rendering Rendering/vtkMaskedProgrammableGlyphFilter.cpp Rendering/mitkCompositeMapper.cpp Rendering/mitkVectorImageVtkGlyphMapper3D.cpp Rendering/vtkOdfSource.cxx Rendering/vtkThickPlane.cxx Rendering/mitkOdfNormalizationMethodProperty.cpp Rendering/mitkOdfScaleByProperty.cpp Rendering/mitkFiberBundleMapper3D.cpp ) SET(H_FILES Rendering/mitkDiffusionImageMapper.h Reconstruction/itkDiffusionQballReconstructionImageFilter.h Reconstruction/mitkTeemDiffusionTensor3DReconstructionImageFilter.h Reconstruction/itkAnalyticalDiffusionQballReconstructionImageFilter.h Reconstruction/itkPointShell.h Reconstruction/itkOrientationDistributionFunction.h - IODataStructures/DiffusionWeightedImages/mitkDiffusionImage.h + IODataStructures/DiffusionWeightedImages/mitkDiffusionImage.h + IODataStructures/FiberBundle/itkSlowPolyLineParametricPath.h Rendering/mitkOdfVtkMapper2D.h ) SET( TOOL_FILES ) IF(WIN32) ENDIF(WIN32) #MITK_MULTIPLEX_PICTYPE( Algorithms/mitkImageRegistrationMethod-TYPE.cpp )