diff --git a/Modules/DiffusionImaging/CMakeLists.txt b/Modules/DiffusionImaging/CMakeLists.txt index 457c3d97f7..a9eabf6a88 100644 --- a/Modules/DiffusionImaging/CMakeLists.txt +++ b/Modules/DiffusionImaging/CMakeLists.txt @@ -1,28 +1,12 @@ -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 SignalModels IODataStructures Reconstruction Tractography Tractography/GibbsTracking Rendering Algorithms DicomImport Interactions IODataStructures/DiffusionWeightedImages IODataStructures/QBallImages IODataStructures/TensorImages IODataStructures/FiberBundle IODataStructures/FiberBundleX IODataStructures/PlanarFigureComposite IODataStructures/TbssImages Algorithms/Connectomics IODataStructures/ConnectomicsNetwork ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS MitkExt SceneSerializationBase QmitkExt MitkGraphAlgorithms - PACKAGE_DEPENDS Boost +set( diffusion_module_dirs + DiffusionCore + FiberTracking + Connectomics + Quantification ) -MITK_USE_MODULE(MitkDiffusionImaging) -if(MitkDiffusionImaging_IS_ENABLED) - file(DOWNLOAD http://mitk.org/download/data/FibertrackingLUT.tar.gz ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/FibertrackingLUT.tar.gz TIMEOUT 10) - execute_process(COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} tar xzf FibertrackingLUT.tar.gz) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Rendering/mitkShaderFiberClipping.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mitkShaderFiberClipping.xml) - MITK_INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mitkShaderFiberClipping.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/FiberTrackingLUTBaryCoords.bin ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/FiberTrackingLUTIndices.bin) -endif() - -add_subdirectory(Testing) - -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mitkDiffusionImagingConfigure.h.in ${CMAKE_CURRENT_BINARY_DIR}/mitkDiffusionImagingConfigure.h) +foreach(diffusion_module_dir ${diffusion_module_dirs}) + add_subdirectory(${diffusion_module_dir}) +endforeach() +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mitkDiffusionImagingConfigure.h.in ${CMAKE_CURRENT_BINARY_DIR}/DiffusionCore/mitkDiffusionImagingConfigure.h) diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/itkConnectomicsNetworkToConnectivityMatrixImageFilter.cpp b/Modules/DiffusionImaging/Connectomics/Algorithms/itkConnectomicsNetworkToConnectivityMatrixImageFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/Connectomics/itkConnectomicsNetworkToConnectivityMatrixImageFilter.cpp rename to Modules/DiffusionImaging/Connectomics/Algorithms/itkConnectomicsNetworkToConnectivityMatrixImageFilter.cpp diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/itkConnectomicsNetworkToConnectivityMatrixImageFilter.h b/Modules/DiffusionImaging/Connectomics/Algorithms/itkConnectomicsNetworkToConnectivityMatrixImageFilter.h similarity index 92% rename from Modules/DiffusionImaging/Algorithms/Connectomics/itkConnectomicsNetworkToConnectivityMatrixImageFilter.h rename to Modules/DiffusionImaging/Connectomics/Algorithms/itkConnectomicsNetworkToConnectivityMatrixImageFilter.h index 23fe4ccf90..63be78c456 100644 --- a/Modules/DiffusionImaging/Algorithms/Connectomics/itkConnectomicsNetworkToConnectivityMatrixImageFilter.h +++ b/Modules/DiffusionImaging/Connectomics/Algorithms/itkConnectomicsNetworkToConnectivityMatrixImageFilter.h @@ -1,82 +1,82 @@ /*=================================================================== 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 ITK_ConnectomicsNetworkToConnectivityMatrixImageFilter_H #define ITK_ConnectomicsNetworkToConnectivityMatrixImageFilter_H // ITK includes #include #include // MITK includes #include "mitkConnectomicsNetwork.h" -#include "MitkDiffusionImagingExports.h" +#include "ConnectomicsExports.h" namespace itk { - class MitkDiffusionImaging_EXPORT ConnectomicsNetworkToConnectivityMatrixImageFilter : public ImageSource< itk::Image< unsigned short, 2 > > + class Connectomics_EXPORT ConnectomicsNetworkToConnectivityMatrixImageFilter : public ImageSource< itk::Image< unsigned short, 2 > > { public: typedef ConnectomicsNetworkToConnectivityMatrixImageFilter Self; typedef ProcessObject Superclass; typedef SmartPointer< Self > Pointer; typedef SmartPointer< const Self > ConstPointer; typedef itk::Image< unsigned short, 2 > OutputImageType; typedef OutputImageType::PixelType OutPixelType; typedef mitk::ConnectomicsNetwork InputType; itkNewMacro(Self) itkTypeMacro( ConnectomicsNetworkToConnectivityMatrixImageFilter, ImageSource ) /** Get/Set m_BinaryConnectivity **/ itkSetMacro( BinaryConnectivity, bool) itkGetMacro( BinaryConnectivity, bool) /** Get/Set m_RescaleConnectivity **/ itkSetMacro( RescaleConnectivity, bool) itkGetMacro( RescaleConnectivity, bool) itkSetMacro( InputNetwork, InputType::Pointer) void GenerateData(); protected: ConnectomicsNetworkToConnectivityMatrixImageFilter(); virtual ~ConnectomicsNetworkToConnectivityMatrixImageFilter(); /** Controls whether the connectivity matrix is binary */ bool m_BinaryConnectivity; /** Controls whether the connectivity matrix entries are rescaled to lie between 0 and 255*/ bool m_RescaleConnectivity; InputType::Pointer m_InputNetwork; }; } //#ifndef ITK_MANUAL_INSTANTIATION //#include "itkConnectomicsNetworkToConnectivityMatrixImageFilter.cpp" //#endif #endif /* ITK_ConnectomicsNetworkToConnectivityMatrixImageFilter_H */ diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsBetweennessHistogram.cpp b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsBetweennessHistogram.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsBetweennessHistogram.cpp rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsBetweennessHistogram.cpp diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsBetweennessHistogram.h b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsBetweennessHistogram.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsBetweennessHistogram.h rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsBetweennessHistogram.h diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsDegreeHistogram.cpp b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsDegreeHistogram.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsDegreeHistogram.cpp rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsDegreeHistogram.cpp diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsDegreeHistogram.h b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsDegreeHistogram.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsDegreeHistogram.h rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsDegreeHistogram.h diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsHistogramBase.cpp b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsHistogramBase.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsHistogramBase.cpp rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsHistogramBase.cpp diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsHistogramBase.h b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsHistogramBase.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsHistogramBase.h rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsHistogramBase.h diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsHistogramCache.cpp b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsHistogramCache.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsHistogramCache.cpp rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsHistogramCache.cpp diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsHistogramCache.h b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsHistogramCache.h similarity index 94% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsHistogramCache.h rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsHistogramCache.h index b3cfa16cd6..81e50780f1 100644 --- a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsHistogramCache.h +++ b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsHistogramCache.h @@ -1,113 +1,113 @@ /*=================================================================== 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 MITKCONNECTOMICSHISTOGRAMCACHE_H #define MITKCONNECTOMICSHISTOGRAMCACHE_H #include "mitkSimpleHistogram.h" #include "mitkConnectomicsNetwork.h" #include #include #include -#include "MitkDiffusionImagingExports.h" +#include "ConnectomicsExports.h" namespace mitk { /** * @brief Provides a method to cache network histograms */ class ConnectomicsHistogramsContainer { public: void ComputeFromBaseData(BaseData* baseData) { m_BetweennessHistogram.ComputeFromBaseData(baseData); m_DegreeHistogram.ComputeFromBaseData(baseData); m_ShortestPathHistogram.ComputeFromBaseData(baseData); } ConnectomicsBetweennessHistogram* GetBetweennessHistogram( ) { return &m_BetweennessHistogram; } ConnectomicsDegreeHistogram* GetDegreeHistogram( ) { return &m_DegreeHistogram; } ConnectomicsShortestPathHistogram* GetShortestPathHistogram( ) { return &m_ShortestPathHistogram; } ConnectomicsBetweennessHistogram m_BetweennessHistogram; ConnectomicsDegreeHistogram m_DegreeHistogram; ConnectomicsShortestPathHistogram m_ShortestPathHistogram; }; - class MitkDiffusionImaging_EXPORT ConnectomicsHistogramCache : public SimpleHistogramCache + class Connectomics_EXPORT ConnectomicsHistogramCache : public SimpleHistogramCache { public: ConnectomicsHistogramCache(); ~ConnectomicsHistogramCache(); ConnectomicsHistogramsContainer *operator[]( ConnectomicsNetwork::Pointer sp_NetworkData); protected: // purposely not implemented SimpleHistogram *operator[](BaseData::Pointer sp_BaseData); }; class ConnectomicsHistogramsCacheElement : public ConnectomicsHistogramCache::Element { public: void ComputeFromBaseData(BaseData* baseData) { m_Container.ComputeFromBaseData(baseData); } ConnectomicsHistogramsContainer* GetHistograms() { return &m_Container; } ConnectomicsHistogramsContainer m_Container; private: ConnectomicsHistogramBase* GetHistogram() { return NULL; } }; } #endif // MITKCONNECTOMICSHISTOGRAMCACHE_H diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsNetworkCreator.cpp b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsNetworkCreator.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsNetworkCreator.cpp rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsNetworkCreator.cpp diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsNetworkCreator.h b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsNetworkCreator.h similarity index 98% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsNetworkCreator.h rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsNetworkCreator.h index 04f4f909e3..b58cf2c41f 100644 --- a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsNetworkCreator.h +++ b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsNetworkCreator.h @@ -1,200 +1,200 @@ /*=================================================================== 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 mitkConnectomicsNetworkCreator_h #define mitkConnectomicsNetworkCreator_h #include #include #include #include "mitkCommon.h" #include "mitkImage.h" #include "mitkFiberBundleX.h" #include "mitkConnectomicsNetwork.h" -#include "MitkDiffusionImagingExports.h" +#include "ConnectomicsExports.h" namespace mitk { /** * \brief 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. */ - class MitkDiffusionImaging_EXPORT ConnectomicsNetworkCreator : public itk::Object + class Connectomics_EXPORT ConnectomicsNetworkCreator : public itk::Object { public: /** Enum for different ways to create the mapping from fibers to network */ enum MappingStrategy { EndElementPosition, PrecomputeAndDistance, JustEndPointVerticesNoLabel, EndElementPositionAvoidingWhiteMatter }; /** Standard class typedefs. */ /** Method for creation through the object factory. */ mitkClassMacro(ConnectomicsNetworkCreator, itk::Object); itkNewMacro(Self); /** Types for the standardized Tract **/ typedef itk::Point PointType; typedef itk::VectorContainer TractType; typedef itk::VectorContainer< unsigned int, TractType::Pointer > TractContainerType; //init via smartpointer /** Types for Network **/ typedef mitk::ConnectomicsNetwork::VertexDescriptorType VertexType; typedef mitk::ConnectomicsNetwork::EdgeDescriptorType EdgeType; typedef mitk::ConnectomicsNetwork::NetworkNode NetworkNode; typedef std::pair< VertexType, VertexType > ConnectionType; /** Types for labels **/ typedef int ImageLabelType; typedef std::pair< ImageLabelType, ImageLabelType > ImageLabelPairType; /** Given a fiber bundle and a parcellation are set, this will create a network from both */ void CreateNetworkFromFibersAndSegmentation(); void SetFiberBundle(mitk::FiberBundleX::Pointer fiberBundle); void SetSegmentation(mitk::Image::Pointer segmentation); mitk::ConnectomicsNetwork::Pointer GetNetwork(); protected: //////////////////// Functions /////////////////////// ConnectomicsNetworkCreator(); ConnectomicsNetworkCreator( mitk::Image::Pointer segmentation, mitk::FiberBundleX::Pointer fiberBundle ); ~ConnectomicsNetworkCreator(); /** Add a connection to the network */ void AddConnectionToNetwork(ConnectionType newConnection); /** Determine if a label is already identified with a vertex, otherwise create a new one */ VertexType ReturnAssociatedVertexForLabel( ImageLabelType label ); /** Return the vertexes associated with a pair of labels */ ConnectionType ReturnAssociatedVertexPairForLabelPair( ImageLabelPairType labelpair ); /** Return the pair of labels which identify the areas connected by a single fiber */ ImageLabelPairType ReturnLabelForFiberTract( TractType::Pointer singleTract, MappingStrategy strategy ); /** Assign the additional information which should be part of the vertex */ void SupplyVertexWithInformation( ImageLabelType& label, VertexType& vertex ); /** Create a string from the label */ std::string LabelToString( ImageLabelType& label ); /** Check whether the label in question belongs to white matter according to the freesurfer table */ bool IsNonWhiteMatterLabel( int labelInQuestion ); /** Check whether the label in question belongs to background according to the freesurfer table */ bool IsBackgroundLabel( int labelInQuestion ); /** 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 */ void LinearExtensionUntilGreyMatter( std::vector & indexVectorOfPointsToUse, TractType::Pointer singleTract, int & label, mitk::Index3D & mitkIndex ); /** Retract fiber until the first brain matter label is hit The bool parameter controls whether the front or the end is retracted */ void RetractionUntilBrainMatter( bool retractFront, TractType::Pointer singleTract, int & label, mitk::Index3D & mitkIndex ); /** Convert point to itk point */ itk::Point GetItkPoint(double point[3]); ///////// Mapping strategies ////////// /** 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.*/ ImageLabelPairType EndElementPositionLabel( TractType::Pointer singleTract ); /** 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. */ ImageLabelPairType PrecomputeVertexLocationsBySegmentation( TractType::Pointer singleTract ); /** Use the position of the end and starting element only to map to labels Just take first and last position, no labelling, nothing */ ImageLabelPairType JustEndPointVerticesNoLabelTest( TractType::Pointer singleTract ); /** 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. */ ImageLabelPairType EndElementPositionLabelAvoidingWhiteMatter( TractType::Pointer singleTract ); ///////// Conversions ////////// /** Convert fiber index to segmentation index coordinates */ void FiberToSegmentationCoords( mitk::Point3D& fiberCoord, mitk::Point3D& segCoord ); /** Convert segmentation index to fiber index coordinates */ void SegmentationToFiberCoords( mitk::Point3D& segCoord, mitk::Point3D& fiberCoord ); /////////////////////// Variables //////////////////////// mitk::FiberBundleX::Pointer m_FiberBundle; mitk::Image::Pointer m_Segmentation; // the graph itself mitk::ConnectomicsNetwork::Pointer m_ConNetwork; // the id counter int idCounter; // the map mapping labels to vertices std::map< ImageLabelType, VertexType > m_LabelToVertexMap; // mapping labels to additional information std::map< ImageLabelType, NetworkNode > m_LabelToNodePropertyMap; // toggles whether edges between a node and itself can exist bool allowLoops; //////////////////////// IDs //////////////////////////// // These IDs are the freesurfer ids used in parcellation static const int freesurfer_Left_Cerebral_White_Matter = 2; static const int freesurfer_Left_Cerebellum_White_Matter = 7; static const int freesurfer_Left_Cerebellum_Cortex = 8; static const int freesurfer_Brain_Stem = 16; static const int freesurfer_Right_Cerebral_White_Matter = 41; static const int freesurfer_Right_Cerebellum_White_Matter = 46; static const int freesurfer_Right_Cerebellum_Cortex = 47; }; }// end namespace mitk #endif // _mitkConnectomicsNetworkCreator_H_INCLUDED diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsShortestPathHistogram.cpp b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsShortestPathHistogram.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsShortestPathHistogram.cpp rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsShortestPathHistogram.cpp diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsShortestPathHistogram.h b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsShortestPathHistogram.h similarity index 94% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsShortestPathHistogram.h rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsShortestPathHistogram.h index d454915c64..5f4d92dfdc 100644 --- a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsShortestPathHistogram.h +++ b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsShortestPathHistogram.h @@ -1,86 +1,86 @@ /*=================================================================== 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_ConnectomicsShortestPathHistogram_H #define _MITK_ConnectomicsShortestPathHistogram_H #include -#include "MitkDiffusionImagingExports.h" +#include "ConnectomicsExports.h" namespace mitk { /** * \brief A class to calculate and store the shortest path between each pair of nodes */ - class MitkDiffusionImaging_EXPORT ConnectomicsShortestPathHistogram : public mitk::ConnectomicsHistogramBase + class Connectomics_EXPORT ConnectomicsShortestPathHistogram : public mitk::ConnectomicsHistogramBase { public: /** Enum for different ways to calculate shortest paths */ enum ShortestPathCalculationMode { UnweightedUndirectedMode, WeightedUndirectedMode }; ConnectomicsShortestPathHistogram(); virtual ~ConnectomicsShortestPathHistogram(); /** Set the calucaltion mode */ void SetShortestPathCalculationMode( const ShortestPathCalculationMode & ); /** Get the calculation mode */ ShortestPathCalculationMode GetShortestPathCalculationMode(); /** Get efficiency */ double GetEfficiency(); protected: /* Typedefs */ typedef mitk::ConnectomicsNetwork::NetworkType NetworkType; typedef boost::graph_traits< NetworkType >::vertex_descriptor DescriptorType; typedef boost::graph_traits< NetworkType >::vertex_iterator IteratorType; /** @brief Creates a new histogram from the network source. */ virtual void ComputeFromConnectomicsNetwork( ConnectomicsNetwork* source ); /** Calculate shortest paths ignoring the weight of the edges */ void CalculateUnweightedUndirectedShortestPaths( NetworkType* boostGraph ); /** Calculate shortest paths taking into consideration the weight of the edges */ void CalculateWeightedUndirectedShortestPaths( NetworkType* boostGraph ); /** Converts the distance map to a histogram */ void ConvertDistanceMapToHistogram(); /** Stores which mode has been selected for shortest path calculation */ ShortestPathCalculationMode m_Mode; /** Stores the shortest paths between the nodes */ std::vector< std::vector< int > > m_DistanceMatrix; /** Stores, whether the graph has disconnected components */ bool m_EverythingConnected; }; } #endif /* _MITK_ConnectomicsShortestPathHistogram_H */ diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingCostFunctionBase.cpp b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingCostFunctionBase.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingCostFunctionBase.cpp rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingCostFunctionBase.cpp diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingCostFunctionBase.h b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingCostFunctionBase.h similarity index 90% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingCostFunctionBase.h rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingCostFunctionBase.h index d5b8683df5..dbff7527f8 100644 --- a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingCostFunctionBase.h +++ b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingCostFunctionBase.h @@ -1,54 +1,54 @@ /*=================================================================== 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 mitkConnectomicsSimulatedAnnealingCostFunctionBase_h #define mitkConnectomicsSimulatedAnnealingCostFunctionBase_h #include #include #include #include "mitkCommon.h" -#include "MitkDiffusionImagingExports.h" +#include "ConnectomicsExports.h" namespace mitk { /** * \brief A generic base class for cost functions for use in simulated annealing */ - class MitkDiffusionImaging_EXPORT ConnectomicsSimulatedAnnealingCostFunctionBase : public itk::Object + class Connectomics_EXPORT ConnectomicsSimulatedAnnealingCostFunctionBase : public itk::Object { public: /** Standard class typedefs. */ /** Method for creation through the object factory. */ mitkClassMacro(ConnectomicsSimulatedAnnealingCostFunctionBase, itk::Object); itkNewMacro(Self); protected: //////////////////// Functions /////////////////////// ConnectomicsSimulatedAnnealingCostFunctionBase(); ~ConnectomicsSimulatedAnnealingCostFunctionBase(); }; }// end namespace mitk #endif // mitkConnectomicsSimulatedAnnealingCostFunctionBase_h diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingCostFunctionModularity.cpp b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingCostFunctionModularity.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingCostFunctionModularity.cpp rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingCostFunctionModularity.cpp diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingCostFunctionModularity.h b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingCostFunctionModularity.h similarity index 93% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingCostFunctionModularity.h rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingCostFunctionModularity.h index 22e687f911..e96866c377 100644 --- a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingCostFunctionModularity.h +++ b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingCostFunctionModularity.h @@ -1,62 +1,62 @@ /*=================================================================== 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 mitkConnectomicsSimulatedAnnealingCostFunctionModularity_h #define mitkConnectomicsSimulatedAnnealingCostFunctionModularity_h #include "mitkConnectomicsSimulatedAnnealingCostFunctionBase.h" #include "mitkConnectomicsNetwork.h" namespace mitk { /** * \brief A cost function using the modularity of the network */ - class MitkDiffusionImaging_EXPORT ConnectomicsSimulatedAnnealingCostFunctionModularity : public mitk::ConnectomicsSimulatedAnnealingCostFunctionBase + class Connectomics_EXPORT ConnectomicsSimulatedAnnealingCostFunctionModularity : public mitk::ConnectomicsSimulatedAnnealingCostFunctionBase { public: typedef mitk::ConnectomicsNetwork::VertexDescriptorType VertexDescriptorType; typedef std::map< VertexDescriptorType, int > ToModuleMapType; typedef std::map< VertexDescriptorType, VertexDescriptorType > VertexToVertexMapType; /** Standard class typedefs. */ /** Method for creation through the object factory. */ mitkClassMacro(ConnectomicsSimulatedAnnealingCostFunctionModularity, itk::Object); itkNewMacro(Self); // Evaluate the network according to the set cost function double Evaluate( mitk::ConnectomicsNetwork::Pointer network, ToModuleMapType *vertexToModuleMap ) const; // Will calculate and return the modularity of the network double CalculateModularity( mitk::ConnectomicsNetwork::Pointer network, ToModuleMapType *vertexToModuleMap ) const; protected: // returns the number of modules int getNumberOfModules( ToModuleMapType *vertexToModuleMap ) const; //////////////////// Functions /////////////////////// ConnectomicsSimulatedAnnealingCostFunctionModularity(); ~ConnectomicsSimulatedAnnealingCostFunctionModularity(); }; }// end namespace mitk #endif // mitkConnectomicsSimulatedAnnealingCostFunctionModularity_h diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingManager.cpp b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingManager.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingManager.cpp rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingManager.cpp diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingManager.h b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingManager.h similarity index 93% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingManager.h rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingManager.h index 871de52327..029c5d793b 100644 --- a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingManager.h +++ b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingManager.h @@ -1,67 +1,67 @@ /*=================================================================== 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 mitkConnectomicsSimulatedAnnealingManager_h #define mitkConnectomicsSimulatedAnnealingManager_h #include #include #include #include "mitkCommon.h" -#include "MitkDiffusionImagingExports.h" +#include "ConnectomicsExports.h" #include "mitkConnectomicsSimulatedAnnealingPermutationBase.h" namespace mitk { /** * \brief A class allow generic simulated annealing by using classes derived from ConnectomicsSimulatedAnnealingPermutationBase */ - class MitkDiffusionImaging_EXPORT ConnectomicsSimulatedAnnealingManager : public itk::Object + class Connectomics_EXPORT ConnectomicsSimulatedAnnealingManager : public itk::Object { public: /** Standard class typedefs. */ /** Method for creation through the object factory. */ mitkClassMacro(ConnectomicsSimulatedAnnealingManager, itk::Object); itkNewMacro(Self); // Decide whether to accept the change or not bool AcceptChange( double costBefore, double costAfter, double temperature ); // Run the permutations at different temperatures, where t_n = t_n-1 / stepSize void RunSimulatedAnnealing( double temperature, double stepSize ); // Set the permutation to be used void SetPermutation( mitk::ConnectomicsSimulatedAnnealingPermutationBase::Pointer permutation ); protected: //////////////////// Functions /////////////////////// ConnectomicsSimulatedAnnealingManager(); ~ConnectomicsSimulatedAnnealingManager(); /////////////////////// Variables //////////////////////// // The permutation assigned to the simulated annealing manager mitk::ConnectomicsSimulatedAnnealingPermutationBase::Pointer m_Permutation; }; }// end namespace mitk #endif // mitkConnectomicsSimulatedAnnealingManager_h diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingPermutationBase.cpp b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingPermutationBase.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingPermutationBase.cpp rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingPermutationBase.cpp diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingPermutationBase.h b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingPermutationBase.h similarity index 93% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingPermutationBase.h rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingPermutationBase.h index 5c23ba5ac2..ca2efacb41 100644 --- a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingPermutationBase.h +++ b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingPermutationBase.h @@ -1,74 +1,74 @@ /*=================================================================== 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 mitkConnectomicsSimulatedAnnealingPermutationBase_h #define mitkConnectomicsSimulatedAnnealingPermutationBase_h #include #include #include #include "mitkCommon.h" -#include "MitkDiffusionImagingExports.h" +#include "ConnectomicsExports.h" #include "mitkConnectomicsSimulatedAnnealingCostFunctionBase.h" namespace mitk { /** * \brief Base class of a permutation to be used in simulated annealing */ - class MitkDiffusionImaging_EXPORT ConnectomicsSimulatedAnnealingPermutationBase : public itk::Object + class Connectomics_EXPORT ConnectomicsSimulatedAnnealingPermutationBase : public itk::Object { public: /** Standard class typedefs. */ /** Method for creation through the object factory. */ mitkClassMacro(ConnectomicsSimulatedAnnealingPermutationBase, itk::Object); itkNewMacro(Self); // Set the cost function void SetCostFunction( mitk::ConnectomicsSimulatedAnnealingCostFunctionBase::Pointer costFunction ); // Returns true if a cost function is assigned bool HasCostFunction( ); // Initialize the permutation virtual void Initialize(){}; // Do a permutation for a specific temperature virtual void Permutate( double temperature ){}; // Do clean up necessary after a permutation virtual void CleanUp(){}; protected: //////////////////// Functions /////////////////////// ConnectomicsSimulatedAnnealingPermutationBase(); ~ConnectomicsSimulatedAnnealingPermutationBase(); /////////////////////// Variables //////////////////////// // The cost function assigned to the permutation mitk::ConnectomicsSimulatedAnnealingCostFunctionBase::Pointer m_CostFunction; }; }// end namespace mitk #endif // mitkConnectomicsSimulatedAnnealingPermutationBase_h diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingPermutationModularity.cpp b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingPermutationModularity.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingPermutationModularity.cpp rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingPermutationModularity.cpp diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingPermutationModularity.h b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingPermutationModularity.h similarity index 97% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingPermutationModularity.h rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingPermutationModularity.h index 6cffea41e7..2f96a0eb29 100644 --- a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSimulatedAnnealingPermutationModularity.h +++ b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSimulatedAnnealingPermutationModularity.h @@ -1,139 +1,139 @@ /*=================================================================== 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 mitkConnectomicsSimulatedAnnealingPermutationModularity_h #define mitkConnectomicsSimulatedAnnealingPermutationModularity_h #include "mitkConnectomicsSimulatedAnnealingPermutationBase.h" #include "mitkConnectomicsNetwork.h" namespace mitk { /** * \brief A class providing permutations for the calculation of modularity using simulated annealing */ - class MitkDiffusionImaging_EXPORT ConnectomicsSimulatedAnnealingPermutationModularity : public mitk::ConnectomicsSimulatedAnnealingPermutationBase + class Connectomics_EXPORT ConnectomicsSimulatedAnnealingPermutationModularity : public mitk::ConnectomicsSimulatedAnnealingPermutationBase { public: typedef mitk::ConnectomicsNetwork::VertexDescriptorType VertexDescriptorType; typedef std::map< VertexDescriptorType, int > ToModuleMapType; typedef std::map< VertexDescriptorType, VertexDescriptorType > VertexToVertexMapType; /** Standard class typedefs. */ /** Method for creation through the object factory. */ mitkClassMacro(ConnectomicsSimulatedAnnealingPermutationModularity, itk::Object); itkNewMacro(Self); // Initialize the permutation virtual void Initialize(); // Do a permutation for a specific temperature virtual void Permutate( double temperature ); // Do clean up necessary after a permutation virtual void CleanUp(); // set the network permutation is to be run upon void SetNetwork( mitk::ConnectomicsNetwork::Pointer theNetwork ); // Get the number of modules the graph has ( highest number - 1 ) int getNumberOfModules( ToModuleMapType *vertexToModuleMap ) const; // Get the number of vertices belonging to a given module int getNumberOfVerticesInModule( ToModuleMapType *vertexToModuleMap, int module ) const; // Set the mapping void SetMapping( ToModuleMapType mapping ); // Get the mapping ToModuleMapType GetMapping(); // Set depth void SetDepth( int depth ); // Set stepSize void SetStepSize( double size ); protected: //////////////////// Functions /////////////////////// ConnectomicsSimulatedAnnealingPermutationModularity(); ~ConnectomicsSimulatedAnnealingPermutationModularity(); // This function moves one single node from a module to another void permutateMappingSingleNodeShift( ToModuleMapType *vertexToModuleMap, mitk::ConnectomicsNetwork::Pointer network ); // This function splits and joins modules void permutateMappingModuleChange( ToModuleMapType *vertexToModuleMap, double currentTemperature, mitk::ConnectomicsNetwork::Pointer network ); // join the two given modules to a single one void joinTwoModules( ToModuleMapType *vertexToModuleMap, int moduleA, int moduleB ); // split the given module recursively up to a certain level // first randomly assigns nodes and then starts another simulated annealing // on the sub network, as long as depthOfModuleChange > 0 void splitModule( ToModuleMapType *vertexToModuleMap, double currentTemperature, mitk::ConnectomicsNetwork::Pointer network, int moduleToSplit ); // Extract the subgraph of a network containing all nodes // of a given module and the egdes between them void extractModuleSubgraph( ToModuleMapType *vertexToModuleMap, mitk::ConnectomicsNetwork::Pointer network, int moduleToSplit, mitk::ConnectomicsNetwork::Pointer subNetwork, VertexToVertexMapType* graphToSubgraphVertexMap, VertexToVertexMapType* subgraphToGraphVertexMap ); // Remove empty modules by moving all nodes of the highest module to the given module void removeModule( ToModuleMapType *vertexToModuleMap, int module ); // Randomly assign nodes to modules, this makes sure each module contains at least one node // as long as numberOfIntendedModules < number of nodes void randomlyAssignNodesToModules(ToModuleMapType *vertexToModuleMap, int numberOfIntendedModules ); // Evaluate mapping using a modularity cost function double Evaluate( ToModuleMapType* mapping ) const; // Whether to accept the permutation bool AcceptChange( double costBefore, double costAfter, double temperature ) const; // the current best solution ToModuleMapType m_BestSolution; // the network mitk::ConnectomicsNetwork::Pointer m_Network; // How many levels of recursive calls can be gone down int m_Depth; // The step size for recursive configuring of simulated annealing manager double m_StepSize; }; }// end namespace mitk #endif // mitkConnectomicsSimulatedAnnealingPermutationModularity_h diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSyntheticNetworkGenerator.cpp b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSyntheticNetworkGenerator.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSyntheticNetworkGenerator.cpp rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSyntheticNetworkGenerator.cpp diff --git a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSyntheticNetworkGenerator.h b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSyntheticNetworkGenerator.h similarity index 95% rename from Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSyntheticNetworkGenerator.h rename to Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSyntheticNetworkGenerator.h index 734b8abff6..d703241d5b 100644 --- a/Modules/DiffusionImaging/Algorithms/Connectomics/mitkConnectomicsSyntheticNetworkGenerator.h +++ b/Modules/DiffusionImaging/Connectomics/Algorithms/mitkConnectomicsSyntheticNetworkGenerator.h @@ -1,87 +1,87 @@ /*=================================================================== 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 mitkConnectomicsSyntheticNetworkGenerator_h #define mitkConnectomicsSyntheticNetworkGenerator_h #include #include #include #include "mitkCommon.h" #include "mitkImage.h" #include "mitkConnectomicsNetwork.h" -#include "MitkDiffusionImagingExports.h" +#include "ConnectomicsExports.h" namespace mitk { /** * \brief A class to generate synthetic networks */ - class MitkDiffusionImaging_EXPORT ConnectomicsSyntheticNetworkGenerator : public itk::Object + class Connectomics_EXPORT ConnectomicsSyntheticNetworkGenerator : public itk::Object { public: /** Standard class typedefs. */ /** Method for creation through the object factory. */ mitkClassMacro(ConnectomicsSyntheticNetworkGenerator, itk::Object); itkNewMacro(Self); /** Create Synthetic Networks */ mitk::ConnectomicsNetwork::Pointer CreateSyntheticNetwork(int networkTypeId, int paramterOne, double parameterTwo); /** Return whether the last attempted network generation was a success*/ bool WasGenerationSuccessfull(); protected: //////////////////// Functions /////////////////////// ConnectomicsSyntheticNetworkGenerator(); ~ConnectomicsSyntheticNetworkGenerator(); /** Generate a default geometry for synthetic images */ mitk::Geometry3D::Pointer GenerateDefaultGeometry(); /** Generate a synthetic cube (regular lattice) network */ void GenerateSyntheticCubeNetwork( mitk::ConnectomicsNetwork::Pointer network, int cubeExtent, double distance ); /** Generate a highly heterogenic network * * This is achieved by generating a center vertex and vertices on * a sphere surface, which are all only connected to the center * vertex. */ void GenerateSyntheticCenterToSurfaceNetwork( mitk::ConnectomicsNetwork::Pointer network, int numberOfPoints, double radius ); /** Generate a random network without specific characteristics * * This is achieved by generating vertices and then deciding whether to * specific vertices are connected by comparing a random number to the threshold */ void GenerateSyntheticRandomNetwork( mitk::ConnectomicsNetwork::Pointer network, int numberOfPoints, double threshold ); /////////////////////// Variables //////////////////////// /** Store whether the network generated last was generated properly */ bool m_LastGenerationWasSuccess; }; }// end namespace mitk #endif // _mitkConnectomicsSyntheticNetworkGenerator_H_INCLUDED diff --git a/Modules/DiffusionImaging/Connectomics/CMakeLists.txt b/Modules/DiffusionImaging/Connectomics/CMakeLists.txt new file mode 100644 index 0000000000..cbc6a47819 --- /dev/null +++ b/Modules/DiffusionImaging/Connectomics/CMakeLists.txt @@ -0,0 +1,6 @@ +MITK_CREATE_MODULE( Connectomics + INCLUDE_DIRS Algorithms IODataStructures Rendering ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS DiffusionCore FiberTracking +) + +add_subdirectory(Testing) \ No newline at end of file diff --git a/Modules/DiffusionImaging/Documentation/doxygen/ConnectomicsRenderingProperties.dox b/Modules/DiffusionImaging/Connectomics/Documentation/doxygen/ConnectomicsRenderingProperties.dox similarity index 100% rename from Modules/DiffusionImaging/Documentation/doxygen/ConnectomicsRenderingProperties.dox rename to Modules/DiffusionImaging/Connectomics/Documentation/doxygen/ConnectomicsRenderingProperties.dox diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsConstantsManager.cpp b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsConstantsManager.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsConstantsManager.cpp rename to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsConstantsManager.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsConstantsManager.h b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsConstantsManager.h similarity index 96% rename from Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsConstantsManager.h rename to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsConstantsManager.h index 1715bc966e..bd571457b0 100644 --- a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsConstantsManager.h +++ b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsConstantsManager.h @@ -1,86 +1,86 @@ /*=================================================================== 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_ConnectomicsConstantsManager_H #define _MITK_ConnectomicsConstantsManager_H -#include "MitkDiffusionImagingExports.h" +#include "ConnectomicsExports.h" namespace mitk { /** \brief The XML consts for reading and writing */ - class MitkDiffusionImaging_EXPORT ConnectomicsConstantsManager + class Connectomics_EXPORT ConnectomicsConstantsManager { public: //============== String and other constants =================== //==== Error messages ==== static const char* CONNECTOMICS_ERROR_TRIED_TO_ACCESS_INVALID_HISTOGRAM; static const char* CONNECTOMICS_ERROR_PASSED_NEGATIVE_INDEX_TO_HISTOGRAM; static const char* CONNECTOMICS_ERROR_OUTSIDE_INTEGER_RANGE; static const char* CONNECTOMICS_ERROR_BEYOND_SCOPE; static const char* CONNECTOMICS_ERROR_INVALID_MAPPING; static const char* CONNECTOMICS_ERROR_INVALID_DIMENSION_NEED_3; //==== Warnings ==== static const char* CONNECTOMICS_WARNING_ZERO_DISTANCE_NODES; static const char* CONNECTOMICS_WARNING_UNIMPLEMENTED_FEATURE; static const char* CONNECTOMICS_WARNING_MORE_POINTS_THAN_PRESENT; static const char* CONNECTOMICS_WARNING_ESTIMATING_LESS_THAN_2; static const char* CONNECTOMICS_WARNING_ESTIMATING_BEYOND_END; static const char* CONNECTOMICS_WARNING_ESTIMATING_BEYOND_START; static const char* CONNECTOMICS_WARNING_DID_NOT_FIND_WHITE; static const char* CONNECTOMICS_WARNING_NOT_EXTEND_TO_WHITE; //==== Information ==== static const char* CONNECTOMICS_WARNING_INFO_NETWORK_CREATED; static const char* CONNECTOMICS_WARNING_NETWORK_NOT_VALID; static const char* CONNECTOMICS_WARNING_NETWORK_DISCONNECTED; static const char* CONNECTOMICS_WARNING_CAN_NOT_COMPUTE_EFFICIENCY; //==== GUI ==== static const char* CONNECTOMICS_GUI_DASH; static const char* CONNECTOMICS_GUI_CONNECTOMICS; static const char* CONNECTOMICS_GUI_CONNECTOMICS_CREATION; static const char* CONNECTOMICS_GUI_SELECTION_WARNING; static const char* CONNECTOMICS_GUI_ONLY_PARCELLATION_SELECTION_WARNING; static const char* CONNECTOMICS_GUI_PERFORMING_IMAGE_PROCESSING_FOR_IMAGE; //==== Properties ==== static const char* CONNECTOMICS_PROPERTY_DEFAULT_RGBA_NAME; static const char* CONNECTOMICS_PROPERTY_NAME; static const char* CONNECTOMICS_PROPERTY_VOLUMERENDERING; static const char* CONNECTOMICS_PROPERTY_DEFAULT_CNF_NAME; private: ConnectomicsConstantsManager(); ~ConnectomicsConstantsManager(); }; } //namespace MITK // include cpp //#include #endif /* _MITK_ConnectomicsConstantsManager_H */ diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetwork.cpp b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetwork.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetwork.cpp rename to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetwork.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetwork.h b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetwork.h similarity index 98% rename from Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetwork.h rename to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetwork.h index 0c919e1db8..e2a3d49623 100644 --- a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetwork.h +++ b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetwork.h @@ -1,227 +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 "ConnectomicsExports.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 + class Connectomics_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() 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( ) 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/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkDefinitions.cpp b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkDefinitions.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkDefinitions.cpp rename to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkDefinitions.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkDefinitions.h b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkDefinitions.h similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkDefinitions.h rename to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkDefinitions.h diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkIOFactory.cpp b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkIOFactory.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkIOFactory.cpp rename to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkIOFactory.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkIOFactory.h b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkIOFactory.h similarity index 94% rename from Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkIOFactory.h rename to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkIOFactory.h index bf9e73afec..7234182061 100644 --- a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkIOFactory.h +++ b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkIOFactory.h @@ -1,73 +1,73 @@ /*=================================================================== 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_NETWORK_IO_FACTORY_H_HEADER__ #define __MITK_CONNECTOMICS_NETWORK_IO_FACTORY_H_HEADER__ #ifdef _MSC_VER #pragma warning ( disable : 4786 ) #endif #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" -#include "MitkDiffusionImagingExports.h" +#include "ConnectomicsExports.h" namespace mitk { /** * \brief Create instances of ConnectomicsNetwork objects using an object factory. * * \ingroup IO */ -class MitkDiffusionImaging_EXPORT ConnectomicsNetworkIOFactory : public itk::ObjectFactoryBase +class Connectomics_EXPORT ConnectomicsNetworkIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ typedef ConnectomicsNetworkIOFactory Self; typedef itk::ObjectFactoryBase Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); static ConnectomicsNetworkIOFactory* FactoryNew() { return new ConnectomicsNetworkIOFactory;} /** Run-time type information (and related methods). */ itkTypeMacro(ConnectomicsNetworkIOFactory, ObjectFactoryBase); /** Register one factory of this type */ static void RegisterOneFactory(void) { ConnectomicsNetworkIOFactory::Pointer ConnectomicsNetworkIOFactory = ConnectomicsNetworkIOFactory::New(); ObjectFactoryBase::RegisterFactory(ConnectomicsNetworkIOFactory); } protected: ConnectomicsNetworkIOFactory(); ~ConnectomicsNetworkIOFactory(); private: ConnectomicsNetworkIOFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif // __MITK_CONNECTOMICS_NETWORK_IO_FACTORY_H_HEADER__ diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkReader.cpp b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkReader.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkReader.cpp rename to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkReader.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkReader.h b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkReader.h similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkReader.h rename to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkReader.h diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkSerializer.cpp b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkSerializer.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkSerializer.cpp rename to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkSerializer.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkSerializer.h b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkSerializer.h similarity index 88% rename from Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkSerializer.h rename to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkSerializer.h index b985af7ee0..dba021a6f6 100644 --- a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkSerializer.h +++ b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkSerializer.h @@ -1,39 +1,39 @@ /*=================================================================== 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 mitkConnectomicsNetworkSerializer_h_included #define mitkConnectomicsNetworkSerializer_h_included -#include "MitkDiffusionImagingExports.h" +#include "ConnectomicsExports.h" #include "mitkBaseDataSerializer.h" namespace mitk { /** \brief Serializes mitk::ConnectomicsNetwork for mitk::SceneIO */ -class MitkDiffusionImaging_EXPORT ConnectomicsNetworkSerializer : public BaseDataSerializer +class Connectomics_EXPORT ConnectomicsNetworkSerializer : public BaseDataSerializer { public: mitkClassMacro( ConnectomicsNetworkSerializer, BaseDataSerializer ); itkNewMacro(Self); virtual std::string Serialize(); protected: ConnectomicsNetworkSerializer(); virtual ~ConnectomicsNetworkSerializer(); }; } // namespace #endif diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkWriter.cpp b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkWriter.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkWriter.cpp rename to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkWriter.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkWriter.h b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkWriter.h similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkWriter.h rename to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkWriter.h diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkWriterFactory.cpp b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkWriterFactory.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkWriterFactory.cpp rename to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkWriterFactory.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkWriterFactory.h b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkWriterFactory.h similarity index 92% rename from Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkWriterFactory.h rename to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkWriterFactory.h index 37d56ce0c3..25935a7dd0 100644 --- a/Modules/DiffusionImaging/IODataStructures/ConnectomicsNetwork/mitkConnectomicsNetworkWriterFactory.h +++ b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsNetworkWriterFactory.h @@ -1,67 +1,67 @@ /*=================================================================== 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 ConnectomicsNetwork_WRITERFACTORY_H_HEADER_INCLUDED #define ConnectomicsNetwork_WRITERFACTORY_H_HEADER_INCLUDED #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" -#include "MitkDiffusionImagingExports.h" +#include "ConnectomicsExports.h" namespace mitk { -class MitkDiffusionImaging_EXPORT ConnectomicsNetworkWriterFactory : public itk::ObjectFactoryBase +class Connectomics_EXPORT ConnectomicsNetworkWriterFactory : public itk::ObjectFactoryBase { public: mitkClassMacro( mitk::ConnectomicsNetworkWriterFactory, itk::ObjectFactoryBase ) /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); /** Register one factory of this type */ static void RegisterOneFactory(void) { static bool IsRegistered = false; if ( !IsRegistered ) { ConnectomicsNetworkWriterFactory::Pointer cnfWriterFactory = ConnectomicsNetworkWriterFactory::New(); ObjectFactoryBase::RegisterFactory( cnfWriterFactory ); IsRegistered = true; } } protected: ConnectomicsNetworkWriterFactory(); ~ConnectomicsNetworkWriterFactory(); private: ConnectomicsNetworkWriterFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif // ConnectomicsNetwork_WRITERFACTORY_H_HEADER_INCLUDED diff --git a/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsObjectFactory.cpp b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsObjectFactory.cpp new file mode 100644 index 0000000000..f74c38c264 --- /dev/null +++ b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsObjectFactory.cpp @@ -0,0 +1,121 @@ +/*=================================================================== + +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 "mitkConnectomicsObjectFactory.h" + +#include "mitkConnectomicsNetwork.h" +#include "mitkConnectomicsNetworkIOFactory.h" +#include "mitkConnectomicsNetworkWriter.h" +#include "mitkConnectomicsNetworkWriterFactory.h" +#include "mitkConnectomicsNetworkMapper3D.h" + +mitk::ConnectomicsObjectFactory::ConnectomicsObjectFactory(bool /*registerSelf*/) + : CoreObjectFactoryBase() +{ + static bool alreadyDone = false; + if (!alreadyDone) + { + MITK_DEBUG << "ConnectomicsObjectFactory c'tor" << std::endl; + RegisterIOFactories(); + + mitk::ConnectomicsNetworkIOFactory::RegisterOneFactory(); + + mitk::ConnectomicsNetworkWriterFactory::RegisterOneFactory(); + + m_FileWriters.push_back( mitk::ConnectomicsNetworkWriter::New().GetPointer() ); + + mitk::CoreObjectFactory::GetInstance()->RegisterExtraFactory(this); + CreateFileExtensionsMap(); + + alreadyDone = true; + } + +} + +mitk::Mapper::Pointer mitk::ConnectomicsObjectFactory::CreateMapper(mitk::DataNode* node, MapperSlotId id) +{ + mitk::Mapper::Pointer newMapper=NULL; + + if ( id == mitk::BaseRenderer::Standard3D ) + { + std::string classname("ConnectomicsNetwork"); + if (node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) + { + newMapper = mitk::ConnectomicsNetworkMapper3D::New(); + newMapper->SetDataNode(node); + } + + } + + return newMapper; +} + +void mitk::ConnectomicsObjectFactory::SetDefaultProperties(mitk::DataNode* node) +{ + std::string classname("ConnectomicsNetwork"); + if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) + { + mitk::ConnectomicsNetworkMapper3D::SetDefaultProperties(node); + } +} + +const char* mitk::ConnectomicsObjectFactory::GetFileExtensions() +{ + std::string fileExtension; + this->CreateFileExtensions(m_FileExtensionsMap, fileExtension); + return fileExtension.c_str(); +}; + +mitk::CoreObjectFactoryBase::MultimapType mitk::ConnectomicsObjectFactory::GetFileExtensionsMap() +{ + return m_FileExtensionsMap; +} + +const char* mitk::ConnectomicsObjectFactory::GetSaveFileExtensions() +{ + std::string fileExtension; + this->CreateFileExtensions(m_SaveFileExtensionsMap, fileExtension); + return fileExtension.c_str(); +}; + +mitk::CoreObjectFactoryBase::MultimapType mitk::ConnectomicsObjectFactory::GetSaveFileExtensionsMap() +{ + return m_SaveFileExtensionsMap; +} + +void mitk::ConnectomicsObjectFactory::CreateFileExtensionsMap() +{ + m_FileExtensionsMap.insert(std::pair("*.cnf", "Connectomics Network File")); + + m_SaveFileExtensionsMap.insert(std::pair("*.cnf", "Connectomics Network File")); +} + +void mitk::ConnectomicsObjectFactory::RegisterIOFactories() +{ +} + +void RegisterConnectomicsObjectFactory() +{ + static bool oneConnectomicsObjectFactoryRegistered = false; + if ( ! oneConnectomicsObjectFactoryRegistered ) { + MITK_DEBUG << "Registering ConnectomicsObjectFactory..." << std::endl; + mitk::CoreObjectFactory::GetInstance()->RegisterExtraFactory(mitk::ConnectomicsObjectFactory::New()); + + oneConnectomicsObjectFactoryRegistered = true; + } +} + diff --git a/Modules/DiffusionImaging/IODataStructures/mitkDiffusionImagingObjectFactory.h b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsObjectFactory.h similarity index 73% copy from Modules/DiffusionImaging/IODataStructures/mitkDiffusionImagingObjectFactory.h copy to Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsObjectFactory.h index ec6379c488..4b513aceea 100644 --- a/Modules/DiffusionImaging/IODataStructures/mitkDiffusionImagingObjectFactory.h +++ b/Modules/DiffusionImaging/Connectomics/IODataStructures/mitkConnectomicsObjectFactory.h @@ -1,55 +1,55 @@ /*=================================================================== 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 DiffusionImagingObjectFactory_H_INCLUDED -#define DiffusionImagingObjectFactory_H_INCLUDED + +#ifndef MITKCONNECTOMICSOBJECTFACTORY_H +#define MITKCONNECTOMICSOBJECTFACTORY_H #include "mitkCoreObjectFactory.h" -#include "MitkDiffusionImagingExports.h" +#include "ConnectomicsExports.h" namespace mitk { -class MitkDiffusionImaging_EXPORT DiffusionImagingObjectFactory : public CoreObjectFactoryBase +class Connectomics_EXPORT ConnectomicsObjectFactory : public CoreObjectFactoryBase { public: - mitkClassMacro(DiffusionImagingObjectFactory,CoreObjectFactoryBase); - itkNewMacro(DiffusionImagingObjectFactory); + mitkClassMacro(ConnectomicsObjectFactory,CoreObjectFactoryBase); + itkNewMacro(ConnectomicsObjectFactory); virtual Mapper::Pointer CreateMapper(mitk::DataNode* node, MapperSlotId slotId); virtual void SetDefaultProperties(mitk::DataNode* node); virtual const char* GetFileExtensions(); virtual mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap(); virtual const char* GetSaveFileExtensions(); virtual mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap(); void RegisterIOFactories(); protected: - DiffusionImagingObjectFactory(bool registerSelf = true); + ConnectomicsObjectFactory(bool registerSelf = true); private: void CreateFileExtensionsMap(); std::string m_ExternalFileExtensions; std::string m_InternalFileExtensions; std::string m_SaveFileExtensions; MultimapType m_FileExtensionsMap; MultimapType m_SaveFileExtensionsMap; }; } // global declaration for simple call by // applications -void MitkDiffusionImaging_EXPORT RegisterDiffusionImagingObjectFactory(); +void Connectomics_EXPORT RegisterConnectomicsObjectFactory(); #endif - diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsNetworkMapper3D.cpp b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsNetworkMapper3D.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsNetworkMapper3D.cpp rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsNetworkMapper3D.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsNetworkMapper3D.h b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsNetworkMapper3D.h similarity index 96% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsNetworkMapper3D.h rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsNetworkMapper3D.h index bdd93dd0c9..b596449f0f 100644 --- a/Modules/DiffusionImaging/Rendering/mitkConnectomicsNetworkMapper3D.h +++ b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsNetworkMapper3D.h @@ -1,136 +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" +#include "ConnectomicsExports.h" namespace mitk { /** * \brief Mapper for Networks * \ingroup Mapper */ - class MitkDiffusionImaging_EXPORT ConnectomicsNetworkMapper3D : public VtkMapper3D + class Connectomics_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/Connectomics/Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.cpp rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.h b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.h similarity index 94% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.h rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.h index 46faf6c0f8..3c42273335 100644 --- a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.h +++ b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingEdgeColorParameterProperty.h @@ -1,94 +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" +#include "ConnectomicsExports.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 +class Connectomics_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/Connectomics/Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.cpp rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.h b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.h similarity index 94% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.h rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.h index 479986d5f7..a00bd10bdf 100644 --- a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.h +++ b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingEdgeFilteringProperty.h @@ -1,94 +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" +#include "ConnectomicsExports.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 +class Connectomics_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/Connectomics/Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.cpp rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.h b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.h similarity index 94% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.h rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.h index 0c24abcd20..312995a41c 100644 --- a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.h +++ b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingEdgeRadiusParameterProperty.h @@ -1,94 +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" +#include "ConnectomicsExports.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 +class Connectomics_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/Connectomics/Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.cpp rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.h b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.h similarity index 94% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.h rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.h index 3a0d7bef6e..e9c655432e 100644 --- a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.h +++ b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingEdgeThresholdParameterProperty.h @@ -1,94 +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" +#include "ConnectomicsExports.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 +class Connectomics_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/Connectomics/Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.cpp rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.h b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.h similarity index 94% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.h rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.h index 8fb31f7eb8..e9456096d5 100644 --- a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.h +++ b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingNodeColorParameterProperty.h @@ -1,94 +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" +#include "ConnectomicsExports.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 +class Connectomics_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/Connectomics/Rendering/mitkConnectomicsRenderingNodeFilteringProperty.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeFilteringProperty.cpp rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingNodeFilteringProperty.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeFilteringProperty.h b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingNodeFilteringProperty.h similarity index 94% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeFilteringProperty.h rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingNodeFilteringProperty.h index b0855549c1..2dde5b3541 100644 --- a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeFilteringProperty.h +++ b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingNodeFilteringProperty.h @@ -1,94 +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" +#include "ConnectomicsExports.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 +class Connectomics_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/Connectomics/Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.cpp rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.h b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.h similarity index 94% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.h rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.h index 820c2abd7d..7c25565c62 100644 --- a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.h +++ b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingNodeRadiusParameterProperty.h @@ -1,94 +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" +#include "ConnectomicsExports.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 +class Connectomics_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/Connectomics/Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.cpp rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.h b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.h similarity index 94% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.h rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.h index 22bef2a13f..14b7040a50 100644 --- a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.h +++ b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingNodeThresholdParameterProperty.h @@ -1,94 +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" +#include "ConnectomicsExports.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 +class Connectomics_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/Connectomics/Rendering/mitkConnectomicsRenderingProperties.h similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingProperties.h rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingProperties.h diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingSchemeProperty.cpp b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingSchemeProperty.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingSchemeProperty.cpp rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingSchemeProperty.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingSchemeProperty.h b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingSchemeProperty.h similarity index 94% rename from Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingSchemeProperty.h rename to Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingSchemeProperty.h index 8a51bd540c..62ab888c2c 100644 --- a/Modules/DiffusionImaging/Rendering/mitkConnectomicsRenderingSchemeProperty.h +++ b/Modules/DiffusionImaging/Connectomics/Rendering/mitkConnectomicsRenderingSchemeProperty.h @@ -1,94 +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" +#include "ConnectomicsExports.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 +class Connectomics_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/Connectomics/Testing/CMakeLists.txt b/Modules/DiffusionImaging/Connectomics/Testing/CMakeLists.txt new file mode 100644 index 0000000000..153cd81e2e --- /dev/null +++ b/Modules/DiffusionImaging/Connectomics/Testing/CMakeLists.txt @@ -0,0 +1 @@ +MITK_CREATE_MODULE_TESTS() diff --git a/Modules/DiffusionImaging/Connectomics/Testing/files.cmake b/Modules/DiffusionImaging/Connectomics/Testing/files.cmake new file mode 100644 index 0000000000..356e8e5424 --- /dev/null +++ b/Modules/DiffusionImaging/Connectomics/Testing/files.cmake @@ -0,0 +1,3 @@ +set(MODULE_TESTS + mitkConnectomicsNetworkTest.cpp +) diff --git a/Modules/DiffusionImaging/Testing/mitkConnectomicsNetworkTest.cpp b/Modules/DiffusionImaging/Connectomics/Testing/mitkConnectomicsNetworkTest.cpp similarity index 100% rename from Modules/DiffusionImaging/Testing/mitkConnectomicsNetworkTest.cpp rename to Modules/DiffusionImaging/Connectomics/Testing/mitkConnectomicsNetworkTest.cpp diff --git a/Modules/DiffusionImaging/Connectomics/files.cmake b/Modules/DiffusionImaging/Connectomics/files.cmake new file mode 100644 index 0000000000..b4e38aee12 --- /dev/null +++ b/Modules/DiffusionImaging/Connectomics/files.cmake @@ -0,0 +1,88 @@ +set(CPP_FILES + + # DataStructures Connectomics + IODataStructures/mitkConnectomicsNetwork.cpp + IODataStructures/mitkConnectomicsNetworkReader.cpp + IODataStructures/mitkConnectomicsNetworkIOFactory.cpp + IODataStructures/mitkConnectomicsNetworkSerializer.cpp + IODataStructures/mitkConnectomicsNetworkWriter.cpp + IODataStructures/mitkConnectomicsNetworkWriterFactory.cpp + IODataStructures/mitkConnectomicsNetworkDefinitions.cpp + IODataStructures/mitkConnectomicsConstantsManager.cpp + + # DataStructures + IODataStructures/mitkConnectomicsObjectFactory.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 + + # Algorithms Connectomics + Algorithms/mitkConnectomicsNetworkCreator.cpp + Algorithms/mitkConnectomicsHistogramBase.cpp + Algorithms/mitkConnectomicsDegreeHistogram.cpp + Algorithms/mitkConnectomicsShortestPathHistogram.cpp + Algorithms/mitkConnectomicsBetweennessHistogram.cpp + Algorithms/mitkConnectomicsHistogramCache.cpp + Algorithms/mitkConnectomicsSyntheticNetworkGenerator.cpp + Algorithms/mitkConnectomicsSimulatedAnnealingPermutationBase.cpp + Algorithms/mitkConnectomicsSimulatedAnnealingPermutationModularity.cpp + Algorithms/mitkConnectomicsSimulatedAnnealingManager.cpp + Algorithms/mitkConnectomicsSimulatedAnnealingCostFunctionBase.cpp + Algorithms/mitkConnectomicsSimulatedAnnealingCostFunctionModularity.cpp + Algorithms/itkConnectomicsNetworkToConnectivityMatrixImageFilter.cpp + +) + +set(H_FILES + # 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 + + + # Datastructures Connectomics + IODataStructures/mitkConnectomicsNetwork.h + IODataStructures/mitkConnectomicsNetworkReader.h + IODataStructures/mitkConnectomicsNetworkIOFactory.h + IODataStructures/mitkConnectomicsNetworkSerializer.h + IODataStructures/mitkConnectomicsNetworkWriter.h + IODataStructures/mitkConnectomicsNetworkWriterFactory.h + IODataStructures/mitkConnectomicsNetworkDefinitions.h + IODataStructures/mitkConnectomicsConstantsManager.h + + # Algorithms Connectomics + Algorithms/mitkConnectomicsNetworkCreator.h + Algorithms/mitkConnectomicsHistogramBase.h + Algorithms/mitkConnectomicsDegreeHistogram.h + Algorithms/mitkConnectomicsShortestPathHistogram.h + Algorithms/mitkConnectomicsBetweennessHistogram.h + Algorithms/mitkConnectomicsHistogramCache.h + Algorithms/mitkConnectomicsSyntheticNetworkGenerator.h + Algorithms/mitkConnectomicsSimulatedAnnealingPermutationBase.h + Algorithms/mitkConnectomicsSimulatedAnnealingPermutationModularity.h + Algorithms/mitkConnectomicsSimulatedAnnealingManager.h + Algorithms/mitkConnectomicsSimulatedAnnealingCostFunctionBase.h + Algorithms/mitkConnectomicsSimulatedAnnealingCostFunctionModularity.h + Algorithms/itkConnectomicsNetworkToConnectivityMatrixImageFilter.h + + +) + + diff --git a/Modules/DiffusionImaging/Reconstruction/itkAnalyticalDiffusionQballReconstructionImageFilter.cpp b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkAnalyticalDiffusionQballReconstructionImageFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/itkAnalyticalDiffusionQballReconstructionImageFilter.cpp rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkAnalyticalDiffusionQballReconstructionImageFilter.cpp diff --git a/Modules/DiffusionImaging/Reconstruction/itkAnalyticalDiffusionQballReconstructionImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkAnalyticalDiffusionQballReconstructionImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/itkAnalyticalDiffusionQballReconstructionImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkAnalyticalDiffusionQballReconstructionImageFilter.h diff --git a/Modules/DiffusionImaging/Reconstruction/itkDiffusionIntravoxelIncoherentMotionReconstructionImageFilter.cpp b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkDiffusionIntravoxelIncoherentMotionReconstructionImageFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/itkDiffusionIntravoxelIncoherentMotionReconstructionImageFilter.cpp rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkDiffusionIntravoxelIncoherentMotionReconstructionImageFilter.cpp diff --git a/Modules/DiffusionImaging/Reconstruction/itkDiffusionIntravoxelIncoherentMotionReconstructionImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkDiffusionIntravoxelIncoherentMotionReconstructionImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/itkDiffusionIntravoxelIncoherentMotionReconstructionImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkDiffusionIntravoxelIncoherentMotionReconstructionImageFilter.h diff --git a/Modules/DiffusionImaging/Reconstruction/itkDiffusionMultiShellQballReconstructionImageFilter.cpp b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkDiffusionMultiShellQballReconstructionImageFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/itkDiffusionMultiShellQballReconstructionImageFilter.cpp rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkDiffusionMultiShellQballReconstructionImageFilter.cpp diff --git a/Modules/DiffusionImaging/Reconstruction/itkDiffusionMultiShellQballReconstructionImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkDiffusionMultiShellQballReconstructionImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/itkDiffusionMultiShellQballReconstructionImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkDiffusionMultiShellQballReconstructionImageFilter.h diff --git a/Modules/DiffusionImaging/Reconstruction/itkDiffusionQballReconstructionImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkDiffusionQballReconstructionImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/itkDiffusionQballReconstructionImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkDiffusionQballReconstructionImageFilter.h diff --git a/Modules/DiffusionImaging/Reconstruction/itkDiffusionQballReconstructionImageFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkDiffusionQballReconstructionImageFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/itkDiffusionQballReconstructionImageFilter.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkDiffusionQballReconstructionImageFilter.txx diff --git a/Modules/DiffusionImaging/Reconstruction/itkOrientationDistributionFunction.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkOrientationDistributionFunction.h similarity index 96% rename from Modules/DiffusionImaging/Reconstruction/itkOrientationDistributionFunction.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkOrientationDistributionFunction.h index fda51cdea6..57f0df2155 100644 --- a/Modules/DiffusionImaging/Reconstruction/itkOrientationDistributionFunction.h +++ b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkOrientationDistributionFunction.h @@ -1,241 +1,241 @@ /*=================================================================== 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 __itkOrientationDistributionFunction_h #define __itkOrientationDistributionFunction_h -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #include "itkIndent.h" #include "itkFixedArray.h" #include "itkMatrix.h" #include "itkSymmetricEigenAnalysis.h" #include "itkSimpleFastMutexLock.h" #include "itkDiffusionTensor3D.h" #include "vtkPolyData.h" #include "vtkPoints.h" #include "vtkCellArray.h" #include "vtkDelaunay2D.h" #include "vtkCleanPolyData.h" #include "vtkAppendPolyData.h" #include "vtkPlane.h" namespace itk { /** \class OrientationDistributionFunction * \brief Represents an ODF for Q-Ball imaging. * * Reference: David S. Tuch, Q-ball imaging, * Magnetic Resonance in Medicine Volume 52 Issue 6, Pages 1358 - 1372 * * \author Klaus Fritzsche, MBI * */ template < typename TComponent, unsigned int NOdfDirections > class OrientationDistributionFunction: public FixedArray { public: enum InterpolationMethods { ODF_NEAREST_NEIGHBOR_INTERP, ODF_TRILINEAR_BARYCENTRIC_INTERP, ODF_SPHERICAL_GAUSSIAN_BASIS_FUNCTIONS }; /** Standard class typedefs. */ typedef OrientationDistributionFunction Self; typedef FixedArray Superclass; /** Dimension of the vector space. */ itkStaticConstMacro(InternalDimension, unsigned int, NOdfDirections); /** Convenience typedefs. */ typedef FixedArray BaseArray; /** Define the component type. */ typedef TComponent ComponentType; typedef typename Superclass::ValueType ValueType; typedef typename NumericTraits::RealType AccumulateValueType; typedef typename NumericTraits::RealType RealValueType; typedef Matrix MatrixType; typedef vnl_matrix_fixed DirectionsType; /** Default constructor has nothing to do. */ OrientationDistributionFunction() {this->Fill(0);} OrientationDistributionFunction (const ComponentType& r) { this->Fill(r); } typedef ComponentType ComponentArrayType[ itkGetStaticConstMacro(InternalDimension) ]; /** Pass-through constructor for the Array base class. */ OrientationDistributionFunction(const Self& r): BaseArray(r) {} OrientationDistributionFunction(const ComponentArrayType r): BaseArray(r) {} /** Pass-through assignment operator for the Array base class. */ Self& operator= (const Self& r); Self& operator= (const ComponentType& r); Self& operator= (const ComponentArrayType r); /** Aritmetic operations between pixels. Return a new OrientationDistributionFunction. */ Self operator+(const Self &vec) const; Self operator-(const Self &vec) const; const Self & operator+=(const Self &vec); const Self & operator-=(const Self &vec); /** Arithmetic operations between ODFs and scalars */ Self operator*(const RealValueType & scalar ) const; Self operator/(const RealValueType & scalar ) const; const Self & operator*=(const RealValueType & scalar ); const Self & operator/=(const RealValueType & scalar ); /** Return the number of components. */ static DirectionsType* GetDirections() { return itkGetStaticConstMacro(m_Directions); } /** Return the number of components. */ static unsigned int GetNumberOfComponents() { return itkGetStaticConstMacro(InternalDimension); } /** Return the value for the Nth component. */ ComponentType GetNthComponent(int c) const { return this->operator[](c); } /** Return the value for the Nth component. */ ComponentType GetInterpolatedComponent( vnl_vector_fixed dir, InterpolationMethods method ) const; /** Set the Nth component to v. */ void SetNthComponent(int c, const ComponentType& v) { this->operator[](c) = v; } /** Matrix notation, in const and non-const forms. */ ValueType & operator()( unsigned int row, unsigned int col ); const ValueType & operator()( unsigned int row, unsigned int col ) const; /** Set the distribution to isotropic.*/ void SetIsotropic(); void InitFromTensor(itk::DiffusionTensor3D tensor); /** Pre-Multiply by a Matrix as ResultingTensor = Matrix * ThisTensor. */ Self PreMultiply( const MatrixType & m ) const; /** Post-Multiply by a Matrix as ResultingTensor = ThisTensor * Matrix. */ Self PostMultiply( const MatrixType & m ) const; void Normalize(); Self MinMaxNormalize() const; Self MaxNormalize() const; void L2Normalize(); int GetPrincipleDiffusionDirection() const; int GetNthDiffusionDirection(int n, vnl_vector_fixed rndVec) const; TComponent GetGeneralizedFractionalAnisotropy() const; TComponent GetGeneralizedGFA(int k, int p) const; TComponent GetNormalizedEntropy() const; TComponent GetNematicOrderParameter() const; TComponent GetStdDevByMaxValue() const; ComponentType GetMaxValue() const; ComponentType GetMinValue() const; ComponentType GetMeanValue() const; TComponent GetPrincipleCurvature(double alphaMinDegree, double alphaMaxDegree, int invert) const; static std::vector GetNeighbors(int idx); static vtkPolyData* GetBaseMesh(){ComputeBaseMesh(); return m_BaseMesh;} static void ComputeBaseMesh(); static double GetMaxChordLength(); static vnl_vector_fixed GetDirection(int i); private: static vtkPolyData* m_BaseMesh; static double m_MaxChordLength; static DirectionsType* m_Directions; static std::vector< std::vector* >* m_NeighborIdxs; static std::vector< std::vector* >* m_AngularRangeIdxs; static std::vector* m_HalfSphereIdxs; static itk::SimpleFastMutexLock m_MutexBaseMesh; static itk::SimpleFastMutexLock m_MutexHalfSphereIdxs; static itk::SimpleFastMutexLock m_MutexNeighbors; static itk::SimpleFastMutexLock m_MutexAngularRange; }; /** This extra typedef is necessary for preventing an Internal Compiler Error in * Microsoft Visual C++ 6.0. This typedef is not needed for any other compiler. */ typedef std::ostream OutputStreamType; typedef std::istream InputStreamType; template< typename TComponent, unsigned int NOdfDirections > -MitkDiffusionImaging_EXPORT OutputStreamType& operator<<(OutputStreamType& os, +DiffusionCore_EXPORT OutputStreamType& operator<<(OutputStreamType& os, const OrientationDistributionFunction & c); template< typename TComponent, unsigned int NOdfDirections > -MitkDiffusionImaging_EXPORT InputStreamType& operator>>(InputStreamType& is, +DiffusionCore_EXPORT InputStreamType& operator>>(InputStreamType& is, OrientationDistributionFunction & c); } // end namespace itk // Define instantiation macro for this template. #define ITK_TEMPLATE_OrientationDistributionFunction(_, EXPORT, x, y) namespace itk { \ - _(2(class MitkDiffusionImaging_EXPORT EXPORT OrientationDistributionFunction< ITK_TEMPLATE_2 x >)) \ + _(2(class DiffusionCore_EXPORT EXPORT OrientationDistributionFunction< ITK_TEMPLATE_2 x >)) \ namespace Templates { typedef OrientationDistributionFunction< ITK_TEMPLATE_2 x > \ OrientationDistributionFunction##y; } \ } #if ITK_TEMPLATE_EXPLICIT # include "Templates/itkOrientationDistributionFunction+-.h" #endif #if ITK_TEMPLATE_TXX # include "itkOrientationDistributionFunction.txx" #endif #endif //__itkOrientationDistributionFunction_h diff --git a/Modules/DiffusionImaging/Reconstruction/itkOrientationDistributionFunction.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkOrientationDistributionFunction.txx similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/itkOrientationDistributionFunction.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkOrientationDistributionFunction.txx diff --git a/Modules/DiffusionImaging/Reconstruction/itkPointShell.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkPointShell.h similarity index 96% rename from Modules/DiffusionImaging/Reconstruction/itkPointShell.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkPointShell.h index 49aeb653ff..fe5a1db949 100644 --- a/Modules/DiffusionImaging/Reconstruction/itkPointShell.h +++ b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkPointShell.h @@ -1,47 +1,47 @@ /*=================================================================== 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 __itkPointShell_h__ #define __itkPointShell_h__ #include "mitkQBallImage.h" -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" namespace itk { // generate by n-fold subdivisions of an icosahedron template class PointShell { public: static TMatrixType *DistributePointShell(); }; template class ThreeLayerPointShell { public: static TMatrixTypeshell1 *DistributePointShell1(); static TMatrixTypeshell2 *DistributePointShell2(); static TMatrixTypeshell3 *DistributePointShell3(); }; } #include "itkPointShell.txx" #endif //__itkPointShell_h__ diff --git a/Modules/DiffusionImaging/Reconstruction/itkPointShell.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkPointShell.txx similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/itkPointShell.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/itkPointShell.txx diff --git a/Modules/DiffusionImaging/Reconstruction/mitkTeemDiffusionTensor3DReconstructionImageFilter.cpp b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/mitkTeemDiffusionTensor3DReconstructionImageFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/mitkTeemDiffusionTensor3DReconstructionImageFilter.cpp rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/mitkTeemDiffusionTensor3DReconstructionImageFilter.cpp diff --git a/Modules/DiffusionImaging/Reconstruction/mitkTeemDiffusionTensor3DReconstructionImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/mitkTeemDiffusionTensor3DReconstructionImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/mitkTeemDiffusionTensor3DReconstructionImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/Reconstruction/mitkTeemDiffusionTensor3DReconstructionImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkB0ImageExtractionImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkB0ImageExtractionImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkB0ImageExtractionImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkB0ImageExtractionImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkB0ImageExtractionImageFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkB0ImageExtractionImageFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkB0ImageExtractionImageFilter.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkB0ImageExtractionImageFilter.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkB0ImageExtractionToSeparateImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkB0ImageExtractionToSeparateImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkB0ImageExtractionToSeparateImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkB0ImageExtractionToSeparateImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkB0ImageExtractionToSeparateImageFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkB0ImageExtractionToSeparateImageFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkB0ImageExtractionToSeparateImageFilter.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkB0ImageExtractionToSeparateImageFilter.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkBrainMaskExtractionImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkBrainMaskExtractionImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkBrainMaskExtractionImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkBrainMaskExtractionImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkBrainMaskExtractionImageFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkBrainMaskExtractionImageFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkBrainMaskExtractionImageFilter.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkBrainMaskExtractionImageFilter.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkCartesianToPolarVectorImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkCartesianToPolarVectorImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkCartesianToPolarVectorImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkCartesianToPolarVectorImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkDiffusionQballGeneralizedFaImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDiffusionQballGeneralizedFaImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkDiffusionQballGeneralizedFaImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDiffusionQballGeneralizedFaImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkDiffusionQballGeneralizedFaImageFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDiffusionQballGeneralizedFaImageFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkDiffusionQballGeneralizedFaImageFilter.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDiffusionQballGeneralizedFaImageFilter.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkDiffusionQballPrepareVisualizationImageFilter.cpp b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDiffusionQballPrepareVisualizationImageFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkDiffusionQballPrepareVisualizationImageFilter.cpp rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDiffusionQballPrepareVisualizationImageFilter.cpp diff --git a/Modules/DiffusionImaging/Algorithms/itkDiffusionQballPrepareVisualizationImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDiffusionQballPrepareVisualizationImageFilter.h similarity index 97% rename from Modules/DiffusionImaging/Algorithms/itkDiffusionQballPrepareVisualizationImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDiffusionQballPrepareVisualizationImageFilter.h index a7a7b8d8e1..b36e255987 100644 --- a/Modules/DiffusionImaging/Algorithms/itkDiffusionQballPrepareVisualizationImageFilter.h +++ b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDiffusionQballPrepareVisualizationImageFilter.h @@ -1,141 +1,141 @@ /*=================================================================== 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. ===================================================================*/ /*=================================================================== This file is based heavily on a corresponding ITK filter. ===================================================================*/ #ifndef __itkDiffusionQballPrepareVisualizationImageFilter_h_ #define __itkDiffusionQballPrepareVisualizationImageFilter_h_ -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #include "itkImageToImageFilter.h" //#include "vnl/vnl_matrix.h" #include "vnl/vnl_vector_fixed.h" #include "vnl/vnl_matrix.h" #include "vnl/algo/vnl_svd.h" #include "itkVectorContainer.h" #include "itkVectorImage.h" #include "itkDiffusionQballGeneralizedFaImageFilter.h" namespace itk{ /** \class DiffusionQballPrepareVisualizationImageFilter */ template< class TOdfPixelType, int NrOdfDirections> -class MitkDiffusionImaging_EXPORT DiffusionQballPrepareVisualizationImageFilter : +class DiffusionCore_EXPORT DiffusionQballPrepareVisualizationImageFilter : public ImageToImageFilter< Image< Vector< TOdfPixelType, NrOdfDirections >, 3 >, Image< Vector< TOdfPixelType, NrOdfDirections >, 3 > > { public: enum NormalizationMethods { PV_NONE, PV_MAX, PV_MIN_MAX, PV_GLOBAL_MAX, PV_MIN_MAX_INVERT }; typedef DiffusionQballPrepareVisualizationImageFilter Self; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; typedef ImageToImageFilter< Image< Vector< TOdfPixelType, NrOdfDirections >, 3 >, Image< Vector< TOdfPixelType, NrOdfDirections >, 3 > > Superclass; typedef DiffusionQballGeneralizedFaImageFilter GfaFilterType; typedef typename GfaFilterType::OutputImageType GfaImageType; typedef typename GfaFilterType::GfaComputationMethod GfaComputationMethod; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Runtime information support. */ itkTypeMacro(DiffusionQballPrepareVisualizationImageFilter, ImageToImageFilter); typedef TOdfPixelType OdfComponentType; typedef typename Superclass::InputImageType InputImageType; typedef typename Superclass::OutputImageType OutputImageType; typedef typename Superclass::OutputImageRegionType OutputImageRegionType; itkStaticConstMacro(NOdfDirections,int,NrOdfDirections); itkSetMacro( Threshold, OdfComponentType ); itkGetMacro( Threshold, OdfComponentType ); itkSetMacro( NormalizationMethod, NormalizationMethods ); itkGetMacro( NormalizationMethod, NormalizationMethods ); itkSetMacro( ScaleByGfaType, GfaComputationMethod ); itkGetMacro( ScaleByGfaType, GfaComputationMethod ); itkSetMacro( DoScaleGfa, bool ); itkGetMacro( DoScaleGfa, bool ); itkSetMacro( GfaParam1, double ); itkGetMacro( GfaParam1, double ); itkSetMacro( GfaParam2, double ); itkGetMacro( GfaParam2, double ); protected: DiffusionQballPrepareVisualizationImageFilter(); ~DiffusionQballPrepareVisualizationImageFilter() {}; void PrintSelf(std::ostream& os, Indent indent) const; void BeforeThreadedGenerateData(); void ThreadedGenerateData( const OutputImageRegionType &outputRegionForThread, int); private: /** Threshold on the reference image data */ OdfComponentType m_Threshold; NormalizationMethods m_NormalizationMethod; OdfComponentType m_GlobalInputMaximum; GfaComputationMethod m_ScaleByGfaType; bool m_DoScaleGfa; typename GfaImageType::Pointer m_GfaImage; double m_GfaParam1; double m_GfaParam2; }; } #ifndef ITK_MANUAL_INSTANTIATION #include "itkDiffusionQballPrepareVisualizationImageFilter.cpp" #endif #endif //__itkDiffusionQballPrepareVisualizationImageFilter_h_ diff --git a/Modules/DiffusionImaging/Algorithms/itkDiffusionTensorPrincipalDirectionImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDiffusionTensorPrincipalDirectionImageFilter.h similarity index 98% rename from Modules/DiffusionImaging/Algorithms/itkDiffusionTensorPrincipalDirectionImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDiffusionTensorPrincipalDirectionImageFilter.h index bf43a37ff2..14ffcc9abf 100644 --- a/Modules/DiffusionImaging/Algorithms/itkDiffusionTensorPrincipalDirectionImageFilter.h +++ b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDiffusionTensorPrincipalDirectionImageFilter.h @@ -1,102 +1,102 @@ /*=================================================================== /*=================================================================== 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. ===================================================================*/ /*=================================================================== This file is based heavily on a corresponding ITK filter. ===================================================================*/ #ifndef __itkDiffusionTensorPrincipalDirectionImageFilter_h_ #define __itkDiffusionTensorPrincipalDirectionImageFilter_h_ -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #include #include #include #include #include #include #include #include namespace itk{ /** \brief Extracts principal eigenvectors of the input tensors */ template< class TTensorPixelType, class TPDPixelType=float> class DiffusionTensorPrincipalDirectionImageFilter : public ImageToImageFilter< Image< DiffusionTensor3D, 3 >, Image< Vector< TPDPixelType, 3 >, 3 > > { public: typedef DiffusionTensorPrincipalDirectionImageFilter Self; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; typedef ImageToImageFilter< Image< DiffusionTensor3D, 3 >, Image< Vector< TPDPixelType, 3 >, 3 > > Superclass; /** Method for creation through the object factory. */ itkNewMacro(Self) /** Runtime information support. */ itkTypeMacro(DiffusionTensorPrincipalDirectionImageFilter, ImageToImageFilter) typedef TTensorPixelType TensorComponentType; typedef TPDPixelType DirectionPixelType; typedef typename Superclass::InputImageType InputImageType; typedef typename Superclass::OutputImageType OutputImageType; typedef typename Superclass::OutputImageRegionType OutputImageRegionType; typedef itk::Image ItkUcharImgType; typedef vnl_vector_fixed< double, 3 > DirectionType; void SetImage( const InputImageType *image ); // input itkSetMacro( MaskImage, ItkUcharImgType::Pointer) itkSetMacro( NormalizeVectors, bool) // output itkGetMacro( OutputFiberBundle, mitk::FiberBundleX::Pointer) itkGetMacro( NumDirectionsImage, ItkUcharImgType::Pointer) protected: DiffusionTensorPrincipalDirectionImageFilter(); ~DiffusionTensorPrincipalDirectionImageFilter() {} void PrintSelf(std::ostream& os, Indent indent) const; void BeforeThreadedGenerateData(); void ThreadedGenerateData( const OutputImageRegionType &outputRegionForThread, int ); void AfterThreadedGenerateData(); private: bool m_NormalizeVectors; ///< Normalizes the output vector to length 1 mitk::FiberBundleX::Pointer m_OutputFiberBundle; ///< Vector field representation of the output vectors ItkUcharImgType::Pointer m_NumDirectionsImage; ///< Image containing the number of fiber directions per voxel ItkUcharImgType::Pointer m_MaskImage; ///< Extraction is only performed inside of the binary mask float m_MaxEigenvalue; }; } #ifndef ITK_MANUAL_INSTANTIATION #include "itkDiffusionTensorPrincipalDirectionImageFilter.txx" #endif #endif //__itkDiffusionTensorPrincipalDirectionImageFilter_h_ diff --git a/Modules/DiffusionImaging/Algorithms/itkDiffusionTensorPrincipalDirectionImageFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDiffusionTensorPrincipalDirectionImageFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkDiffusionTensorPrincipalDirectionImageFilter.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDiffusionTensorPrincipalDirectionImageFilter.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkDistanceMapFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDistanceMapFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkDistanceMapFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDistanceMapFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkDistanceMapFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDistanceMapFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkDistanceMapFilter.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDistanceMapFilter.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkDwiPhantomGenerationFilter.cpp b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDwiPhantomGenerationFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkDwiPhantomGenerationFilter.cpp rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDwiPhantomGenerationFilter.cpp diff --git a/Modules/DiffusionImaging/Algorithms/itkDwiPhantomGenerationFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDwiPhantomGenerationFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkDwiPhantomGenerationFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkDwiPhantomGenerationFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkExtractChannelFromRgbaImageFilter.cpp b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkExtractChannelFromRgbaImageFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkExtractChannelFromRgbaImageFilter.cpp rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkExtractChannelFromRgbaImageFilter.cpp diff --git a/Modules/DiffusionImaging/Algorithms/itkExtractChannelFromRgbaImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkExtractChannelFromRgbaImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkExtractChannelFromRgbaImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkExtractChannelFromRgbaImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkFiniteDiffOdfMaximaExtractionFilter.cpp b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkFiniteDiffOdfMaximaExtractionFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkFiniteDiffOdfMaximaExtractionFilter.cpp rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkFiniteDiffOdfMaximaExtractionFilter.cpp diff --git a/Modules/DiffusionImaging/Algorithms/itkFiniteDiffOdfMaximaExtractionFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkFiniteDiffOdfMaximaExtractionFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkFiniteDiffOdfMaximaExtractionFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkFiniteDiffOdfMaximaExtractionFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkFslPeakImageConverter.cpp b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkFslPeakImageConverter.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkFslPeakImageConverter.cpp rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkFslPeakImageConverter.cpp diff --git a/Modules/DiffusionImaging/Algorithms/itkFslPeakImageConverter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkFslPeakImageConverter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkFslPeakImageConverter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkFslPeakImageConverter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkFslShCoefficientImageConverter.cpp b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkFslShCoefficientImageConverter.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkFslShCoefficientImageConverter.cpp rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkFslShCoefficientImageConverter.cpp diff --git a/Modules/DiffusionImaging/Algorithms/itkFslShCoefficientImageConverter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkFslShCoefficientImageConverter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkFslShCoefficientImageConverter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkFslShCoefficientImageConverter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkGaussianInterpolateImageFunction.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkGaussianInterpolateImageFunction.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkGaussianInterpolateImageFunction.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkGaussianInterpolateImageFunction.h diff --git a/Modules/DiffusionImaging/Algorithms/itkGaussianInterpolateImageFunction.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkGaussianInterpolateImageFunction.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkGaussianInterpolateImageFunction.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkGaussianInterpolateImageFunction.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkMergeDiffusionImagesFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkMergeDiffusionImagesFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkMergeDiffusionImagesFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkMergeDiffusionImagesFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkMergeDiffusionImagesFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkMergeDiffusionImagesFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkMergeDiffusionImagesFilter.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkMergeDiffusionImagesFilter.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkMrtrixPeakImageConverter.cpp b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkMrtrixPeakImageConverter.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkMrtrixPeakImageConverter.cpp rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkMrtrixPeakImageConverter.cpp diff --git a/Modules/DiffusionImaging/Algorithms/itkMrtrixPeakImageConverter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkMrtrixPeakImageConverter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkMrtrixPeakImageConverter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkMrtrixPeakImageConverter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkOdfMaximaExtractionFilter.cpp b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkOdfMaximaExtractionFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkOdfMaximaExtractionFilter.cpp rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkOdfMaximaExtractionFilter.cpp diff --git a/Modules/DiffusionImaging/Algorithms/itkOdfMaximaExtractionFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkOdfMaximaExtractionFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkOdfMaximaExtractionFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkOdfMaximaExtractionFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkPolarToCartesianVectorImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkPolarToCartesianVectorImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkPolarToCartesianVectorImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkPolarToCartesianVectorImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkProjectionFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkProjectionFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkProjectionFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkProjectionFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkProjectionFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkProjectionFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkProjectionFilter.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkProjectionFilter.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkQBallToRgbImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkQBallToRgbImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkQBallToRgbImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkQBallToRgbImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkResampleDwiImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkResampleDwiImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkResampleDwiImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkResampleDwiImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkResampleDwiImageFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkResampleDwiImageFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkResampleDwiImageFilter.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkResampleDwiImageFilter.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkResidualImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkResidualImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkResidualImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkResidualImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkResidualImageFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkResidualImageFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkResidualImageFilter.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkResidualImageFilter.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkTensorDerivedMeasurementsFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorDerivedMeasurementsFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTensorDerivedMeasurementsFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorDerivedMeasurementsFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkTensorDerivedMeasurementsFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorDerivedMeasurementsFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTensorDerivedMeasurementsFilter.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorDerivedMeasurementsFilter.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkTensorImageToDiffusionImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorImageToDiffusionImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTensorImageToDiffusionImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorImageToDiffusionImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkTensorImageToDiffusionImageFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorImageToDiffusionImageFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTensorImageToDiffusionImageFilter.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorImageToDiffusionImageFilter.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkTensorImageToQBallImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorImageToQBallImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTensorImageToQBallImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorImageToQBallImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkTensorImageToQBallImageFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorImageToQBallImageFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTensorImageToQBallImageFilter.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorImageToQBallImageFilter.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkTensorReconstructionWithEigenvalueCorrectionFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorReconstructionWithEigenvalueCorrectionFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTensorReconstructionWithEigenvalueCorrectionFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorReconstructionWithEigenvalueCorrectionFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkTensorReconstructionWithEigenvalueCorrectionFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorReconstructionWithEigenvalueCorrectionFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTensorReconstructionWithEigenvalueCorrectionFilter.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorReconstructionWithEigenvalueCorrectionFilter.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkTensorToL2NormImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorToL2NormImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTensorToL2NormImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorToL2NormImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkTensorToL2NormImageFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorToL2NormImageFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTensorToL2NormImageFilter.txx rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorToL2NormImageFilter.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkTensorToRgbImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorToRgbImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTensorToRgbImageFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/itkTensorToRgbImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/mitkPartialVolumeAnalysisClusteringCalculator.cpp b/Modules/DiffusionImaging/DiffusionCore/Algorithms/mitkPartialVolumeAnalysisClusteringCalculator.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/mitkPartialVolumeAnalysisClusteringCalculator.cpp rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/mitkPartialVolumeAnalysisClusteringCalculator.cpp diff --git a/Modules/DiffusionImaging/Algorithms/mitkPartialVolumeAnalysisClusteringCalculator.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/mitkPartialVolumeAnalysisClusteringCalculator.h similarity index 98% rename from Modules/DiffusionImaging/Algorithms/mitkPartialVolumeAnalysisClusteringCalculator.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/mitkPartialVolumeAnalysisClusteringCalculator.h index e6ff01fba9..841a808819 100644 --- a/Modules/DiffusionImaging/Algorithms/mitkPartialVolumeAnalysisClusteringCalculator.h +++ b/Modules/DiffusionImaging/DiffusionCore/Algorithms/mitkPartialVolumeAnalysisClusteringCalculator.h @@ -1,511 +1,511 @@ /*=================================================================== 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_PartialVolumeAnalysisClusteringCalculator_H #define _MITK_PartialVolumeAnalysisClusteringCalculator_H -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #include "mitkCommon.h" #include "mitkImage.h" #include #include #include #include #include namespace mitk { - class MitkDiffusionImaging_EXPORT PartialVolumeAnalysisClusteringCalculator : public itk::Object + class DiffusionCore_EXPORT PartialVolumeAnalysisClusteringCalculator : public itk::Object { public: typedef vnl_vector VecType; typedef mitk::Image::HistogramType MitkHistType; class HistType { public: HistType() { } HistType(const HistType& p) { this->xVals = p.xVals; this->hVals = p.hVals; } ~HistType() { } HistType operator= (const HistType& p) { if (this != &p) // protect against invalid self-assignment { this->xVals = p.xVals; this->hVals = p.hVals; } return *this; } void InitByMitkHistogram(const MitkHistType* histogram) { xVals.set_size(histogram->GetSize()[0]); hVals.set_size(histogram->GetSize()[0]); double sum = histogram->GetTotalFrequency(); MitkHistType::ConstIterator endIt = histogram->End(); MitkHistType::ConstIterator it; bool firstNonEmptyBinFound = false; it = histogram->Begin(); //++it; int i=0; while (it != endIt) { if(it.GetFrequency() || firstNonEmptyBinFound) { firstNonEmptyBinFound = true; xVals(i) = it.GetMeasurementVector().GetElement(0); hVals(i) = it.GetFrequency()/sum; } ++i; ++it; } } void SetXVals(VecType x) {xVals = x;} void SetHVals(VecType h) {hVals = h;} void SetXVals(std::vector x) { int s = x.size(); xVals.set_size(s); for(int i=0; i h) { int s = h.size(); hVals.set_size(s); for(int i=0; i* GetXVals() { int s = xVals.size(); std::vector* retval = new std::vector(s); for(int i=0; i* GetHVals() { int s = hVals.size(); std::vector* retval = new std::vector(s); for(int i=0; ivals.clear(); // this->mixedVals.clear(); // int s = p.vals.size(); // for(int i=0; ivals.push_back(v); // } // s = p.mixedVals.size(); // for(int i=0; imixedVals.push_back(v); // } // this->combiVals = p.combiVals; // } // return *this; // } void Initialize (const ClusterResultType *p) { if (this != p) // protect against invalid self-assignment { this->vals.clear(); this->mixedVals.clear(); int s = p->vals.size(); for(int i=0; ivals[i]; this->vals.push_back(v); } s = p->mixedVals.size(); for(int i=0; imixedVals[i]; this->mixedVals.push_back(v); } this->combiVals = p->combiVals; } } std::vector GetFiberVals() { if(vals.size()==2 && vals[1].data_block()) { int s = vals[1].size(); std::vector retval(s); for(int i=0; i(0); } } std::vector GetNonFiberVals() { if(vals.size()==2 && vals[0].data_block()) { int s = vals[0].size(); std::vector retval(s); for(int i=0; i(0); } } std::vector GetMixedVals() { if(mixedVals.size()==1 && mixedVals[0].data_block()) { int s = mixedVals[0].size(); std::vector retval(s); for(int i=0; i(0); } } std::vector GetCombiVals() { if(combiVals.data_block()) { int s = combiVals.size(); std::vector retval(s); for(int i=0; i(0); } } // void Print(VecType vec, int nr=10) // { // int sz = vec.size(); // int incr = (int)((1.0*sz)/(1.0*nr)); // for(int i=0; i vals; std::vector mixedVals; VecType combiVals; }; class ParamsType { public: ParamsType() { } ~ParamsType() { } void Initialize(const ParamsType *p) { if (this != p) // protect against invalid self-assignment { means[0] = p->means[0]; means[1] = p->means[1]; sigmas[0] = p->sigmas[0]; sigmas[1] = p->sigmas[1]; ps[0] = p->ps[0]; ps[1] = p->ps[1]; } } // void Print() // { // MITK_DEBUG << "PARAMS" << std::endl; // MITK_DEBUG << "Class 1: " << means[0] << " +- " << sqrt(sigmas[0]) << " (p=" << ps[0] << ")" << std::endl; // MITK_DEBUG << "Class 2: " << means[1] << " +- " << sqrt(sigmas[1]) << " (p=" << ps[1] << ")" << std::endl; // MITK_DEBUG << "Partial V: p=" << 1.0-ps[0]-ps[1] << std::endl; // } double means[2]; double sigmas[2]; double ps[2]; }; struct HelperStructClusteringResults { MitkHistType *interestingHist; MitkHistType *totalHist; double p_interesting; }; struct HelperStructRGBChannels { mitk::Image::Pointer r; mitk::Image::Pointer g; mitk::Image::Pointer b; ~HelperStructRGBChannels() { r = 0; g = 0; b = 0; } }; struct HelperStructPerformRGBClusteringRetval { HelperStructRGBChannels *rgbChannels; mitk::Image::Pointer rgb; ParamsType *params; ClusterResultType *result; HistType *hist; HelperStructPerformRGBClusteringRetval() : rgbChannels(0), params(0), result(0), hist(0) { } ~HelperStructPerformRGBClusteringRetval() { rgb = 0; delete rgbChannels; } }; struct HelperStructPerformClusteringRetval { mitk::Image::Pointer clusteredImage; mitk::Image::Pointer displayImage; ParamsType *params; ClusterResultType *result; HistType *hist; HelperStructPerformClusteringRetval() : clusteredImage(0), displayImage(0), params(0), result(0), hist(0) { } ~HelperStructPerformClusteringRetval() { clusteredImage = 0; displayImage = 0; } }; mitkClassMacro( PartialVolumeAnalysisClusteringCalculator, itk::Object ) itkNewMacro( PartialVolumeAnalysisClusteringCalculator ) ParamsType *InitialGuess(HistType h) const; ParamsType *Cluster(const HistType h, ParamsType* initialGuess) const; ClusterResultType CalculateCurves(ParamsType params, VecType xVals) const; void Normalize(ParamsType params, ClusterResultType* curves) const; HelperStructPerformClusteringRetval* PerformClustering(mitk::Image::ConstPointer image, const MitkHistType *histogram, int classIdent, HelperStructPerformClusteringRetval* precResult = 0) const; HelperStructPerformRGBClusteringRetval* PerformRGBClustering(mitk::Image::ConstPointer image, const MitkHistType *histogram) const; HelperStructPerformClusteringRetval* PerformQuantiles(mitk::Image::ConstPointer image, const MitkHistType *histogram, double p1, double p2) const; HelperStructPerformRGBClusteringRetval* PerformRGBQuantiles(mitk::Image::ConstPointer image, const MitkHistType *histogram, double p1, double p2 ) const; double* PerformQuantification(mitk::Image::ConstPointer image, mitk::Image::Pointer clusteredImage, mitk::Image::Pointer mask = 0) const; mitk::Image::Pointer CaculateAngularErrorImage( mitk::Image::Pointer comp1, mitk::Image::Pointer comp2, mitk::Image::Pointer probImg) const; template < unsigned int VImageDimension > void InternalGenerateRGB( HelperStructRGBChannels *rgb, mitk::Image::Pointer retval ) const; template < typename TPixel, unsigned int VImageDimension > void InternalGenerateProbabilityImage( const itk::Image< TPixel, VImageDimension > *image, const HelperStructClusteringResults clusterResults, mitk::Image::Pointer outImage1, mitk::Image::Pointer outImage2 ) const; template < typename TPixel, unsigned int VImageDimension > void InternalQuantify( const itk::Image< TPixel, VImageDimension > *image, mitk::Image::Pointer clusteredImage, double* retval, mitk::Image::Pointer mask ) const; template < typename TPixel, unsigned int VImageDimension > void InternalGenerateQuantileImage( const itk::Image< TPixel, VImageDimension > *image, double* q, mitk::Image::Pointer outImage1, mitk::Image::Pointer outImage2 ) const; ParamsType* Cluster(const HistType h) const {return Cluster(h, InitialGuess(h));} void SetMaxIt(unsigned int it) { m_MaxIt = it; } unsigned int GetMaxIt() { return m_MaxIt; } void SetStepsNumIntegration(unsigned int n) { m_StepsNumIntegration = n; } unsigned int GetStepsNumIntegration() { return m_StepsNumIntegration; } protected: PartialVolumeAnalysisClusteringCalculator(); virtual ~PartialVolumeAnalysisClusteringCalculator(); unsigned int m_MaxIt; unsigned int m_StepsNumIntegration; }; } #endif // #define _MITK_PartialVolumeAnalysisClusteringCalculator_H diff --git a/Modules/DiffusionImaging/Algorithms/mitkPartialVolumeAnalysisHistogramCalculator.cpp b/Modules/DiffusionImaging/DiffusionCore/Algorithms/mitkPartialVolumeAnalysisHistogramCalculator.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/mitkPartialVolumeAnalysisHistogramCalculator.cpp rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/mitkPartialVolumeAnalysisHistogramCalculator.cpp diff --git a/Modules/DiffusionImaging/Algorithms/mitkPartialVolumeAnalysisHistogramCalculator.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/mitkPartialVolumeAnalysisHistogramCalculator.h similarity index 98% rename from Modules/DiffusionImaging/Algorithms/mitkPartialVolumeAnalysisHistogramCalculator.h rename to Modules/DiffusionImaging/DiffusionCore/Algorithms/mitkPartialVolumeAnalysisHistogramCalculator.h index 8d1a8ecc40..5aa87677e8 100644 --- a/Modules/DiffusionImaging/Algorithms/mitkPartialVolumeAnalysisHistogramCalculator.h +++ b/Modules/DiffusionImaging/DiffusionCore/Algorithms/mitkPartialVolumeAnalysisHistogramCalculator.h @@ -1,383 +1,383 @@ /*=================================================================== 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_PartialVolumeAnalysisHistogramCalculator_H #define _MITK_PartialVolumeAnalysisHistogramCalculator_H -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #include #include #include #include "mitkImage.h" #include "mitkImageTimeSelector.h" #include "mitkPlanarFigure.h" namespace mitk { /** * \brief Class for calculating statistics and histogram for an (optionally * masked) image. * * Images can be masked by either a (binary) image (of the same dimensions as * the original image) or by a closed mitk::PlanarFigure, e.g. a circle or * polygon. When masking with a planar figure, the slice corresponding to the * plane containing the figure is extracted and then clipped with contour * defined by the figure. Planar figures need to be aligned along the main axes * of the image (axial, sagittal, coronal). Planar figures on arbitrary * rotated planes are not supported. * * For each operating mode (no masking, masking by image, masking by planar * figure), the calculated statistics and histogram are cached so that, when * switching back and forth between operation modes without modifying mask or * image, the information doesn't need to be recalculated. * * Note: currently time-resolved and multi-channel pictures are not properly * supported. */ - class MitkDiffusionImaging_EXPORT PartialVolumeAnalysisHistogramCalculator : public itk::Object + class DiffusionCore_EXPORT PartialVolumeAnalysisHistogramCalculator : public itk::Object { public: enum { MASKING_MODE_NONE = 0, MASKING_MODE_IMAGE, MASKING_MODE_PLANARFIGURE }; typedef mitk::Image::HistogramType HistogramType; typedef mitk::Image::HistogramType::ConstIterator HistogramConstIteratorType; struct Statistics { unsigned int N; double Min; double Max; double Mean; double Median; double Variance; double Sigma; double RMS; void Reset() { N = 0; Min = 0.0; Max = 0.0; Mean = 0.0; Median = 0.0; Variance = 0.0; Sigma = 0.0; RMS = 0.0; } }; typedef Statistics StatisticsType; typedef itk::TimeStamp TimeStampType; typedef bool BoolType; typedef itk::Image< unsigned char, 3 > MaskImage3DType; typedef itk::Image< unsigned char, 2 > MaskImage2DType; typedef itk::Image< float, 2 > InternalImage2DType; mitkClassMacro( PartialVolumeAnalysisHistogramCalculator, itk::Object ) itkNewMacro( PartialVolumeAnalysisHistogramCalculator ) /** \brief Set image from which to compute statistics. */ void SetImage( const mitk::Image *image ); /** \brief Set binary image for masking. */ void SetImageMask( const mitk::Image *imageMask ); /** \brief Set planar figure for masking. */ void SetPlanarFigure( const mitk::PlanarFigure *planarFigure ); /** \brief Set image for which the same resampling will be applied. and available via GetAdditionalResampledImage() */ void AddAdditionalResamplingImage( const mitk::Image *image ); /** \brief Set/Get operation mode for masking */ void SetMaskingMode( unsigned int mode ); /** \brief Set/Get operation mode for masking */ itkGetMacro( MaskingMode, unsigned int ); /** \brief Set/Get operation mode for masking */ void SetMaskingModeToNone(); /** \brief Set/Get operation mode for masking */ void SetMaskingModeToImage(); /** \brief Set/Get operation mode for masking */ void SetMaskingModeToPlanarFigure(); /** \brief Set histogram number of bins. */ void SetNumberOfBins( unsigned int number ) { if(m_NumberOfBins != number) { m_NumberOfBins = number; SetModified(); } } /** \brief Get histogram number of bins. */ unsigned int GetNumberOfBins( ) { return m_NumberOfBins; } /** \brief Set upsampling factor. */ void SetUpsamplingFactor( float number ) { if(m_UpsamplingFactor != number) { m_UpsamplingFactor = number; SetModified(); } } /** \brief Get upsampling factor. */ float GetUpsamplingFactor( ) { return m_UpsamplingFactor; } /** \brief Set gaussian sigma. */ void SetGaussianSigma( float number ) { if(m_GaussianSigma != number) { m_GaussianSigma = number; SetModified(); } } /** \brief Get thickness of planar figure. */ unsigned int GetPlanarFigureThickness( ) { return m_PlanarFigureThickness; } /** \brief Set thickness of planar figure. */ void SetPlanarFigureThickness( unsigned int number ) { if(m_PlanarFigureThickness != number) { m_PlanarFigureThickness = number; SetModified(); } } /** \brief Get histogram number of bins. */ float GetGaussianSigma( ) { return m_GaussianSigma; } void SetModified(); /** \brief Compute statistics (together with histogram) for the current * masking mode. * * Computation is not executed if statistics is already up to date. In this * case, false is returned; otherwise, true.*/ virtual bool ComputeStatistics( ); /** \brief Retrieve the histogram depending on the current masking mode. */ const HistogramType *GetHistogram( ) const; /** \brief Retrieve statistics depending on the current masking mode. */ const Statistics &GetStatistics( ) const; const Image::Pointer GetInternalImage() { return m_InternalImage; } const Image::Pointer GetInternalAdditionalResampledImage(unsigned int i) { if(i < m_InternalAdditionalResamplingImages.size()) { return m_InternalAdditionalResamplingImages[i]; } else { return NULL; } } void SetForceUpdate(bool b) { m_ForceUpdate = b; } protected: PartialVolumeAnalysisHistogramCalculator(); virtual ~PartialVolumeAnalysisHistogramCalculator(); /** \brief Depending on the masking mode, the image and mask from which to * calculate statistics is extracted from the original input image and mask * data. * * For example, a when using a PlanarFigure as mask, the 2D image slice * corresponding to the PlanarFigure will be extracted from the original * image. If masking is disabled, the original image is simply passed * through. */ void ExtractImageAndMask( ); /** \brief If the passed vector matches any of the three principal axes * of the passed geometry, the ínteger value corresponding to the axis * is set and true is returned. */ bool GetPrincipalAxis( const Geometry3D *geometry, Vector3D vector, unsigned int &axis ); template < typename TPixel, unsigned int VImageDimension > void InternalCalculateStatisticsUnmasked( const itk::Image< TPixel, VImageDimension > *image, Statistics &statistics, typename HistogramType::ConstPointer *histogram ); template < typename TPixel, unsigned int VImageDimension > void InternalCalculateStatisticsMasked( const itk::Image< TPixel, VImageDimension > *image, itk::Image< unsigned char, VImageDimension > *maskImage, Statistics &statistics, typename HistogramType::ConstPointer *histogram ); template < typename TPixel, unsigned int VImageDimension > void InternalCalculateMaskFromPlanarFigure( itk::Image< TPixel, VImageDimension > *image, unsigned int axis ); template < typename TPixel, unsigned int VImageDimension > void InternalReorientImagePlane( const itk::Image< TPixel, VImageDimension > *image, mitk::Geometry3D* imggeo, mitk::Geometry3D* planegeo3D, int additionalIndex ); template < typename TPixel, unsigned int VImageDimension > void InternalResampleImageFromMask( const itk::Image< TPixel, VImageDimension > *image, int additionalIndex ); void InternalResampleImage( const MaskImage3DType *image/*, mitk::Geometry3D* imggeo*/ ); template < typename TPixel, unsigned int VImageDimension > void InternalCropAdditionalImage( itk::Image< TPixel, VImageDimension > *image, int additionalIndex ); void InternalMaskImage( mitk::Image *image ); /** Connection from ITK to VTK */ template void ConnectPipelines(ITK_Exporter exporter, VTK_Importer* importer) { importer->SetUpdateInformationCallback(exporter->GetUpdateInformationCallback()); importer->SetPipelineModifiedCallback(exporter->GetPipelineModifiedCallback()); importer->SetWholeExtentCallback(exporter->GetWholeExtentCallback()); importer->SetSpacingCallback(exporter->GetSpacingCallback()); importer->SetOriginCallback(exporter->GetOriginCallback()); importer->SetScalarTypeCallback(exporter->GetScalarTypeCallback()); importer->SetNumberOfComponentsCallback(exporter->GetNumberOfComponentsCallback()); importer->SetPropagateUpdateExtentCallback(exporter->GetPropagateUpdateExtentCallback()); importer->SetUpdateDataCallback(exporter->GetUpdateDataCallback()); importer->SetDataExtentCallback(exporter->GetDataExtentCallback()); importer->SetBufferPointerCallback(exporter->GetBufferPointerCallback()); importer->SetCallbackUserData(exporter->GetCallbackUserData()); } /** Connection from VTK to ITK */ template void ConnectPipelines(VTK_Exporter* exporter, ITK_Importer importer) { importer->SetUpdateInformationCallback(exporter->GetUpdateInformationCallback()); importer->SetPipelineModifiedCallback(exporter->GetPipelineModifiedCallback()); importer->SetWholeExtentCallback(exporter->GetWholeExtentCallback()); importer->SetSpacingCallback(exporter->GetSpacingCallback()); importer->SetOriginCallback(exporter->GetOriginCallback()); importer->SetScalarTypeCallback(exporter->GetScalarTypeCallback()); importer->SetNumberOfComponentsCallback(exporter->GetNumberOfComponentsCallback()); importer->SetPropagateUpdateExtentCallback(exporter->GetPropagateUpdateExtentCallback()); importer->SetUpdateDataCallback(exporter->GetUpdateDataCallback()); importer->SetDataExtentCallback(exporter->GetDataExtentCallback()); importer->SetBufferPointerCallback(exporter->GetBufferPointerCallback()); importer->SetCallbackUserData(exporter->GetCallbackUserData()); } void UnmaskedStatisticsProgressUpdate(); void MaskedStatisticsProgressUpdate(); mitk::Image::ConstPointer m_Image; mitk::Image::ConstPointer m_ImageMask; mitk::PlanarFigure::ConstPointer m_PlanarFigure; HistogramType::ConstPointer m_ImageHistogram; HistogramType::ConstPointer m_MaskedImageHistogram; HistogramType::ConstPointer m_PlanarFigureHistogram; HistogramType::Pointer m_EmptyHistogram; StatisticsType m_ImageStatistics; StatisticsType m_MaskedImageStatistics; StatisticsType m_PlanarFigureStatistics; Statistics m_EmptyStatistics; unsigned int m_MaskingMode; bool m_MaskingModeChanged; mitk::Image::Pointer m_InternalImage; MaskImage3DType::Pointer m_InternalImageMask3D; MaskImage2DType::Pointer m_InternalImageMask2D; itk::ImageRegion<3> m_InternalMask3D; std::vector m_AdditionalResamplingImages; std::vector m_InternalAdditionalResamplingImages; TimeStampType m_ImageStatisticsTimeStamp; TimeStampType m_MaskedImageStatisticsTimeStamp; TimeStampType m_PlanarFigureStatisticsTimeStamp; BoolType m_ImageStatisticsCalculationTriggerBool; BoolType m_MaskedImageStatisticsCalculationTriggerBool; BoolType m_PlanarFigureStatisticsCalculationTriggerBool; unsigned int m_NumberOfBins; float m_UpsamplingFactor; float m_GaussianSigma; itk::ImageRegion<3> m_CropRegion; bool m_ForceUpdate; unsigned int m_PlanarFigureThickness; }; } #endif // #define _MITK_PartialVolumeAnalysisHistogramCalculator_H diff --git a/Modules/DiffusionImaging/DiffusionCore/CMakeLists.txt b/Modules/DiffusionImaging/DiffusionCore/CMakeLists.txt new file mode 100644 index 0000000000..c2a1616048 --- /dev/null +++ b/Modules/DiffusionImaging/DiffusionCore/CMakeLists.txt @@ -0,0 +1,17 @@ +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( DiffusionCore + SUBPROJECTS MITK-DTI + INCLUDE_DIRS Algorithms Algorithms/Reconstruction DicomImport IODataStructures/DiffusionWeightedImages IODataStructures/QBallImages IODataStructures/TensorImages IODataStructures Rendering ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS MitkExt SceneSerializationBase QmitkExt + PACKAGE_DEPENDS Boost +) + +add_subdirectory(Testing) \ No newline at end of file diff --git a/Modules/DiffusionImaging/DicomImport/mitkDicomDiffusionImageHeaderReader.cpp b/Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkDicomDiffusionImageHeaderReader.cpp similarity index 100% rename from Modules/DiffusionImaging/DicomImport/mitkDicomDiffusionImageHeaderReader.cpp rename to Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkDicomDiffusionImageHeaderReader.cpp diff --git a/Modules/DiffusionImaging/DicomImport/mitkDicomDiffusionImageHeaderReader.h b/Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkDicomDiffusionImageHeaderReader.h similarity index 95% rename from Modules/DiffusionImaging/DicomImport/mitkDicomDiffusionImageHeaderReader.h rename to Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkDicomDiffusionImageHeaderReader.h index ffb5b5f040..0b35b2c9ae 100644 --- a/Modules/DiffusionImaging/DicomImport/mitkDicomDiffusionImageHeaderReader.h +++ b/Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkDicomDiffusionImageHeaderReader.h @@ -1,114 +1,114 @@ /*=================================================================== 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 __mitkDicomDiffusionImageHeaderReader_h__ #define __mitkDicomDiffusionImageHeaderReader_h__ -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #include #include "itkImageSeriesReader.h" #include "itkImageFileReader.h" #include "itkOrientedImage.h" #include "itkGDCMImageIO.h" #include "mitkDiffusionImageHeaderInformation.h" namespace mitk { /** @brief Reads the header information from a DICOM series and stores it into an output object of type DiffusionImageHeaderInformation */ - class MitkDiffusionImaging_EXPORT DicomDiffusionImageHeaderReader : public itk::Object + class DiffusionCore_EXPORT DicomDiffusionImageHeaderReader : public itk::Object { public: mitkClassMacro( DicomDiffusionImageHeaderReader, itk::Object ); itkNewMacro(Self); /** En enum to distinguish in processing between the different vendoors */ enum SupportedVendors{ SV_SIEMENS, SV_SIEMENS_MOSAIC, SV_PHILIPS, SV_GE, SV_UNKNOWN_VENDOR }; typedef std::vector< std::string > FileNamesContainer; typedef short PixelValueType; typedef itk::OrientedImage< PixelValueType, 2 > SliceType; typedef itk::OrientedImage< PixelValueType, 3 > VolumeType; typedef itk::ImageSeriesReader< VolumeType > VolumeReaderType; typedef itk::ImageFileReader< SliceType > SliceReaderType; typedef itk::GDCMImageIO ImageIOType; /** Set the dicom file names to be considered */ void SetSeriesDicomFilenames(FileNamesContainer dicomFilenames) { this->m_DicomFilenames = dicomFilenames; } void SetGdcmIO(ImageIOType::Pointer gdcmIO) { this->m_GdcmIO = gdcmIO; } /** Set the volume reader in case the default volume reader shouldn't be used */ void SetVolumeReader(VolumeReaderType::Pointer volumeReader) { this->m_VolumeReader = volumeReader; } /** Set the output object that will contain the read-in information after update */ void SetOutputPointer(DiffusionImageHeaderInformation::Pointer output) { this->m_Output = output; } /** do the work */ virtual void Update(); /** return output */ DiffusionImageHeaderInformation::Pointer GetOutput(); /** identify vendor */ SupportedVendors GetVendorID(); protected: /** Default c'tor */ DicomDiffusionImageHeaderReader(); /** Default d'tor */ virtual ~DicomDiffusionImageHeaderReader(); void ReadPublicTags(); void ReadPublicTags2(); void TransformGradients(); FileNamesContainer m_DicomFilenames; DiffusionImageHeaderInformation::Pointer m_Output; ImageIOType::Pointer m_GdcmIO; VolumeReaderType::Pointer m_VolumeReader; bool m_SliceOrderIS; bool m_SingleSeries; int m_nSlice; std::vector m_sliceLocations; }; } #endif diff --git a/Modules/DiffusionImaging/DicomImport/mitkDicomDiffusionImageReader.cpp b/Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkDicomDiffusionImageReader.cpp similarity index 100% rename from Modules/DiffusionImaging/DicomImport/mitkDicomDiffusionImageReader.cpp rename to Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkDicomDiffusionImageReader.cpp diff --git a/Modules/DiffusionImaging/DicomImport/mitkDicomDiffusionImageReader.h b/Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkDicomDiffusionImageReader.h similarity index 100% rename from Modules/DiffusionImaging/DicomImport/mitkDicomDiffusionImageReader.h rename to Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkDicomDiffusionImageReader.h diff --git a/Modules/DiffusionImaging/DicomImport/mitkGEDicomDiffusionImageHeaderReader.cpp b/Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkGEDicomDiffusionImageHeaderReader.cpp similarity index 100% rename from Modules/DiffusionImaging/DicomImport/mitkGEDicomDiffusionImageHeaderReader.cpp rename to Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkGEDicomDiffusionImageHeaderReader.cpp diff --git a/Modules/DiffusionImaging/DicomImport/mitkGEDicomDiffusionImageHeaderReader.h b/Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkGEDicomDiffusionImageHeaderReader.h similarity index 100% rename from Modules/DiffusionImaging/DicomImport/mitkGEDicomDiffusionImageHeaderReader.h rename to Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkGEDicomDiffusionImageHeaderReader.h diff --git a/Modules/DiffusionImaging/DicomImport/mitkGroupDiffusionHeadersFilter.cpp b/Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkGroupDiffusionHeadersFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/DicomImport/mitkGroupDiffusionHeadersFilter.cpp rename to Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkGroupDiffusionHeadersFilter.cpp diff --git a/Modules/DiffusionImaging/DicomImport/mitkGroupDiffusionHeadersFilter.h b/Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkGroupDiffusionHeadersFilter.h similarity index 94% rename from Modules/DiffusionImaging/DicomImport/mitkGroupDiffusionHeadersFilter.h rename to Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkGroupDiffusionHeadersFilter.h index 4d324f0916..a4f37682bb 100644 --- a/Modules/DiffusionImaging/DicomImport/mitkGroupDiffusionHeadersFilter.h +++ b/Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkGroupDiffusionHeadersFilter.h @@ -1,105 +1,105 @@ /*=================================================================== 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 _mitkGroupDiffusionHeadersFilter_h #define _mitkGroupDiffusionHeadersFilter_h -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #include "mitkBaseProcess.h" #include "mitkDiffusionImageHeaderInformation.h" namespace mitk { /** * @brief Groups Headers containing Diffusion Information * @ingroup Process */ - class MitkDiffusionImaging_EXPORT GroupDiffusionHeadersFilter : public BaseProcess + class DiffusionCore_EXPORT GroupDiffusionHeadersFilter : public BaseProcess { public: mitkClassMacro( GroupDiffusionHeadersFilter, BaseProcess ); itkNewMacro( Self ); typedef mitk::DiffusionImageHeaderInformation HeaderType; typedef HeaderType::Pointer HeaderPointer; typedef std::vector InputType; typedef std::vector OutputType; /** * Sets the input of this process object * @param input the input */ virtual void SetInput( InputType input ); /** * Sets the input n'th of this process object * @param idx the number associated with the given input */ virtual void SetInput( const unsigned int& idx, InputType input ); /** * Sets the input n'th of this process object * @param idx the number associated with the given input */ virtual void SetNthOutput( const unsigned int& idx, InputType output ); /** * @returns the input tree of the process object */ InputType GetInput( void ); /** * @param idx the index of the input to return * @returns the input object with the given index */ InputType GetInput( const unsigned int& idx ); OutputType GetOutput(); virtual void GenerateOutputInformation(); virtual void Update(); protected: /** * A default constructor */ GroupDiffusionHeadersFilter(); /** * The destructor */ virtual ~GroupDiffusionHeadersFilter(); OutputType m_Output; InputType m_Input; private: void operator=( const Self& ); //purposely not implemented } ; } //end of namespace mitk #endif diff --git a/Modules/DiffusionImaging/DicomImport/mitkPhilipsDicomDiffusionImageHeaderReader.cpp b/Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkPhilipsDicomDiffusionImageHeaderReader.cpp similarity index 100% rename from Modules/DiffusionImaging/DicomImport/mitkPhilipsDicomDiffusionImageHeaderReader.cpp rename to Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkPhilipsDicomDiffusionImageHeaderReader.cpp diff --git a/Modules/DiffusionImaging/DicomImport/mitkPhilipsDicomDiffusionImageHeaderReader.h b/Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkPhilipsDicomDiffusionImageHeaderReader.h similarity index 100% rename from Modules/DiffusionImaging/DicomImport/mitkPhilipsDicomDiffusionImageHeaderReader.h rename to Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkPhilipsDicomDiffusionImageHeaderReader.h diff --git a/Modules/DiffusionImaging/DicomImport/mitkSiemensDicomDiffusionImageHeaderReader.cpp b/Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkSiemensDicomDiffusionImageHeaderReader.cpp similarity index 100% rename from Modules/DiffusionImaging/DicomImport/mitkSiemensDicomDiffusionImageHeaderReader.cpp rename to Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkSiemensDicomDiffusionImageHeaderReader.cpp diff --git a/Modules/DiffusionImaging/DicomImport/mitkSiemensDicomDiffusionImageHeaderReader.h b/Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkSiemensDicomDiffusionImageHeaderReader.h similarity index 100% rename from Modules/DiffusionImaging/DicomImport/mitkSiemensDicomDiffusionImageHeaderReader.h rename to Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkSiemensDicomDiffusionImageHeaderReader.h diff --git a/Modules/DiffusionImaging/DicomImport/mitkSiemensMosaicDicomDiffusionImageHeaderReader.cpp b/Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkSiemensMosaicDicomDiffusionImageHeaderReader.cpp similarity index 100% rename from Modules/DiffusionImaging/DicomImport/mitkSiemensMosaicDicomDiffusionImageHeaderReader.cpp rename to Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkSiemensMosaicDicomDiffusionImageHeaderReader.cpp diff --git a/Modules/DiffusionImaging/DicomImport/mitkSiemensMosaicDicomDiffusionImageHeaderReader.h b/Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkSiemensMosaicDicomDiffusionImageHeaderReader.h similarity index 100% rename from Modules/DiffusionImaging/DicomImport/mitkSiemensMosaicDicomDiffusionImageHeaderReader.h rename to Modules/DiffusionImaging/DiffusionCore/DicomImport/mitkSiemensMosaicDicomDiffusionImageHeaderReader.h diff --git a/Modules/DiffusionImaging/Documentation/doxygen/DiffusionImagingProperties.dox b/Modules/DiffusionImaging/DiffusionCore/Documentation/doxygen/DiffusionImagingProperties.dox similarity index 100% rename from Modules/DiffusionImaging/Documentation/doxygen/DiffusionImagingProperties.dox rename to Modules/DiffusionImaging/DiffusionCore/Documentation/doxygen/DiffusionImagingProperties.dox diff --git a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImage.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImage.h similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImage.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImage.h diff --git a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImage.txx b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImage.txx similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImage.txx rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImage.txx diff --git a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageHeaderInformation.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageHeaderInformation.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageHeaderInformation.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageHeaderInformation.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageHeaderInformation.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageHeaderInformation.h similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageHeaderInformation.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageHeaderInformation.h diff --git a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSerializer.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSerializer.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSerializer.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSerializer.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSerializer.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSerializer.h similarity index 88% rename from Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSerializer.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSerializer.h index dc1e27a23a..ddb2dca91e 100644 --- a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSerializer.h +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSerializer.h @@ -1,39 +1,39 @@ /*=================================================================== 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 mitkDiffusionImageSerializer_h_included #define mitkDiffusionImageSerializer_h_included -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #include "mitkBaseDataSerializer.h" namespace mitk { /** \brief Serializes mitk::Surface for mitk::SceneIO */ -class MitkDiffusionImaging_EXPORT DiffusionImageSerializer : public BaseDataSerializer +class DiffusionCore_EXPORT DiffusionImageSerializer : public BaseDataSerializer { public: mitkClassMacro( DiffusionImageSerializer, BaseDataSerializer ); itkNewMacro(Self); virtual std::string Serialize(); protected: DiffusionImageSerializer(); virtual ~DiffusionImageSerializer(); }; } // namespace #endif diff --git a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSource.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSource.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSource.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSource.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSource.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSource.h similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSource.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkDiffusionImageSource.h diff --git a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageIOFactory.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageIOFactory.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageIOFactory.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageIOFactory.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageIOFactory.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageIOFactory.h similarity index 94% rename from Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageIOFactory.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageIOFactory.h index 4f4e162fe1..b4562dabda 100644 --- a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageIOFactory.h +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageIOFactory.h @@ -1,77 +1,77 @@ /*=================================================================== 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_NRRD_DIFFUSION_VOULMES_IO_FACTORY_H_HEADER__ #define __MITK_NRRD_DIFFUSION_VOULMES_IO_FACTORY_H_HEADER__ #ifdef _MSC_VER #pragma warning ( disable : 4786 ) #endif #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" namespace mitk { //##Documentation //## @brief Create instances of NrrdDiffusionImageReader objects using an object factory. //## //## @ingroup IO -class MitkDiffusionImaging_EXPORT NrrdDiffusionImageIOFactory : public itk::ObjectFactoryBase +class DiffusionCore_EXPORT NrrdDiffusionImageIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ typedef NrrdDiffusionImageIOFactory Self; typedef itk::ObjectFactoryBase Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); static NrrdDiffusionImageIOFactory* FactoryNew() { return new NrrdDiffusionImageIOFactory;} /** Run-time type information (and related methods). */ itkTypeMacro(NrrdDiffusionImageIOFactory, ObjectFactoryBase); /** Register one factory of this type */ static void RegisterOneFactory(void) { static bool IsRegistered = false; if ( !IsRegistered ) { NrrdDiffusionImageIOFactory::Pointer fac = NrrdDiffusionImageIOFactory::New(); ObjectFactoryBase::RegisterFactory( fac ); IsRegistered = true; } } protected: NrrdDiffusionImageIOFactory(); ~NrrdDiffusionImageIOFactory(); private: NrrdDiffusionImageIOFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif // __MITK_NRRD_DIFFUSION_VOULMES_IO_FACTORY_H_HEADER__ diff --git a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageReader.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageReader.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageReader.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageReader.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageReader.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageReader.h similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageReader.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageReader.h diff --git a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriter.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriter.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriter.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriter.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriter.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriter.h similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriter.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriter.h diff --git a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriterFactory.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriterFactory.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriterFactory.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriterFactory.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriterFactory.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriterFactory.h similarity index 92% rename from Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriterFactory.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriterFactory.h index 34672ca8a9..12634b90c2 100644 --- a/Modules/DiffusionImaging/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriterFactory.h +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriterFactory.h @@ -1,67 +1,67 @@ /*=================================================================== 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 NRRDDIFFIMAGE_WRITERFACTORY_H_HEADER_INCLUDED #define NRRDDIFFIMAGE_WRITERFACTORY_H_HEADER_INCLUDED #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" namespace mitk { -class MitkDiffusionImaging_EXPORT NrrdDiffusionImageWriterFactory : public itk::ObjectFactoryBase +class DiffusionCore_EXPORT NrrdDiffusionImageWriterFactory : public itk::ObjectFactoryBase { public: mitkClassMacro( mitk::NrrdDiffusionImageWriterFactory, itk::ObjectFactoryBase ) /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); /** Register one factory of this type */ static void RegisterOneFactory(void) { static bool IsRegistered = false; if ( !IsRegistered ) { NrrdDiffusionImageWriterFactory::Pointer fac = NrrdDiffusionImageWriterFactory::New(); ObjectFactoryBase::RegisterFactory( fac ); IsRegistered = true; } } protected: NrrdDiffusionImageWriterFactory(); ~NrrdDiffusionImageWriterFactory(); private: NrrdDiffusionImageWriterFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif // NRRDDIFFIMAGE_WRITERFACTORY_H_HEADER_INCLUDED diff --git a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageIOFactory.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageIOFactory.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageIOFactory.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageIOFactory.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageIOFactory.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageIOFactory.h similarity index 94% rename from Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageIOFactory.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageIOFactory.h index ab74552ba1..b482312645 100644 --- a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageIOFactory.h +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageIOFactory.h @@ -1,78 +1,78 @@ /*=================================================================== 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_NRRD_QBI_IO_FACTORY_H_HEADER__ #define __MITK_NRRD_QBI_IO_FACTORY_H_HEADER__ #ifdef _MSC_VER #pragma warning ( disable : 4786 ) #endif #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" namespace mitk { //##Documentation //## @brief Create instances of NrrdQBallImageReader objects using an object factory. //## //## @ingroup IO -class MitkDiffusionImaging_EXPORT NrrdQBallImageIOFactory : public itk::ObjectFactoryBase +class DiffusionCore_EXPORT NrrdQBallImageIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ typedef NrrdQBallImageIOFactory Self; typedef itk::ObjectFactoryBase Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); static NrrdQBallImageIOFactory* FactoryNew() { return new NrrdQBallImageIOFactory;} /** Run-time type information (and related methods). */ itkTypeMacro(NrrdQBallImageIOFactory, ObjectFactoryBase); /** Register one factory of this type */ static void RegisterOneFactory(void) { static bool IsRegistered = false; if ( !IsRegistered ) { NrrdQBallImageIOFactory::Pointer fac = NrrdQBallImageIOFactory::New(); ObjectFactoryBase::RegisterFactory( fac ); IsRegistered = true; } } protected: NrrdQBallImageIOFactory(); ~NrrdQBallImageIOFactory(); private: NrrdQBallImageIOFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif // __MITK_NRRD_QBI_IO_FACTORY_H_HEADER__ diff --git a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageReader.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageReader.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageReader.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageReader.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageReader.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageReader.h similarity index 92% rename from Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageReader.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageReader.h index e3a1333873..2ef96bc94d 100644 --- a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageReader.h +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageReader.h @@ -1,70 +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. ===================================================================*/ #ifndef __mitkNrrdQBallImageReader_h #define __mitkNrrdQBallImageReader_h #include "mitkCommon.h" #include "itkVectorContainer.h" #include "mitkFileReader.h" #include "vnl/vnl_vector_fixed.h" #include "mitkQBallImage.h" #include "mitkQBallImageSource.h" #include "itkVectorImage.h" -#include +#include namespace mitk { /** \brief */ - class MitkDiffusionImaging_EXPORT NrrdQBallImageReader : public mitk::QBallImageSource, public FileReader + class DiffusionCore_EXPORT NrrdQBallImageReader : public mitk::QBallImageSource, public FileReader { public: typedef mitk::QBallImage OutputType; typedef mitk::QBallImageSource QBImgSourceType; mitkClassMacro( NrrdQBallImageReader, QBImgSourceType ); itkNewMacro(Self); const char* GetFileName() const; void SetFileName(const char* aFileName); const char* GetFilePrefix() const; void SetFilePrefix(const char* aFilePrefix); const char* GetFilePattern() const; void SetFilePattern(const char* aFilePattern); static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern); protected: /** Does the real work. */ virtual void GenerateData(); virtual void GenerateOutputInformation(); std::string m_FileName; std::string m_FilePrefix; std::string m_FilePattern; private: void operator=(const Self&); //purposely not implemented }; } //namespace MITK #endif // __mitkNrrdQBallImageReader_h diff --git a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageWriter.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageWriter.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageWriter.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageWriter.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageWriter.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageWriter.h similarity index 95% rename from Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageWriter.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageWriter.h index 0f7e637c9c..6622bd1e47 100644 --- a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageWriter.h +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageWriter.h @@ -1,130 +1,130 @@ /*=================================================================== 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_NRRDQBI_WRITER__H_ #define _MITK_NRRDQBI_WRITER__H_ #include #include #include -#include +#include namespace mitk { /** * Writes diffusion volumes to a file * @ingroup Process */ -class MitkDiffusionImaging_EXPORT NrrdQBallImageWriter : public mitk::FileWriterWithInformation +class DiffusionCore_EXPORT NrrdQBallImageWriter : public mitk::FileWriterWithInformation { public: mitkClassMacro( NrrdQBallImageWriter, mitk::FileWriterWithInformation ); mitkWriterMacro; itkNewMacro( Self ); typedef mitk::QBallImage InputType; /** * Sets the filename of the file to write. * @param FileName the name of the file to write. */ itkSetStringMacro( FileName ); /** * @returns the name of the file to be written to disk. */ itkGetStringMacro( FileName ); /** * @warning multiple write not (yet) supported */ itkSetStringMacro( FilePrefix ); /** * @warning multiple write not (yet) supported */ itkGetStringMacro( FilePrefix ); /** * @warning multiple write not (yet) supported */ itkSetStringMacro( FilePattern ); /** * @warning multiple write not (yet) supported */ itkGetStringMacro( FilePattern ); /** * Sets the input object for the filter. * @param input the diffusion volumes to write to file. */ void SetInput( InputType* input ); /** * @returns the 0'th input object of the filter. */ InputType* GetInput(); /** * Returns false if an error happened during writing */ itkGetMacro( Success, bool ); /** * @return possible file extensions for the data type associated with the writer */ virtual std::vector GetPossibleFileExtensions(); // FileWriterWithInformation methods virtual const char * GetDefaultFilename() { return "QBalls.qbi"; } virtual const char * GetFileDialogPattern() { return "Q-Ball Images (*.qbi *.hqbi"; } virtual const char * GetDefaultExtension() { return ".qbi"; } virtual bool CanWriteBaseDataType(BaseData::Pointer data) { return (dynamic_cast(data.GetPointer()) != NULL); }; virtual void DoWrite(BaseData::Pointer data) { if (CanWriteBaseDataType(data)) { this->SetInput(dynamic_cast(data.GetPointer())); this->Update(); } }; protected: NrrdQBallImageWriter(); virtual ~NrrdQBallImageWriter(); virtual void GenerateData(); std::string m_FileName; std::string m_FilePrefix; std::string m_FilePattern; bool m_Success; }; } // end of namespace mitk #endif //_MITK_NRRDQBI_WRITER__H_ diff --git a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageWriterFactory.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageWriterFactory.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageWriterFactory.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageWriterFactory.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageWriterFactory.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageWriterFactory.h similarity index 92% rename from Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageWriterFactory.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageWriterFactory.h index 64cfac876d..5d1a9b3eb0 100644 --- a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkNrrdQBallImageWriterFactory.h +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkNrrdQBallImageWriterFactory.h @@ -1,67 +1,67 @@ /*=================================================================== 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 NRRDQBI_WRITERFACTORY_H_HEADER_INCLUDED #define NRRDQBI_WRITERFACTORY_H_HEADER_INCLUDED #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" namespace mitk { -class MitkDiffusionImaging_EXPORT NrrdQBallImageWriterFactory : public itk::ObjectFactoryBase +class DiffusionCore_EXPORT NrrdQBallImageWriterFactory : public itk::ObjectFactoryBase { public: mitkClassMacro( mitk::NrrdQBallImageWriterFactory, itk::ObjectFactoryBase ) /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); /** Register one factory of this type */ static void RegisterOneFactory(void) { static bool IsRegistered = false; if ( !IsRegistered ) { NrrdQBallImageWriterFactory::Pointer fac = NrrdQBallImageWriterFactory::New(); ObjectFactoryBase::RegisterFactory( fac ); IsRegistered = true; } } protected: NrrdQBallImageWriterFactory(); ~NrrdQBallImageWriterFactory(); private: NrrdQBallImageWriterFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif // NRRDQBI_WRITERFACTORY_H_HEADER_INCLUDED diff --git a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkQBallImage.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkQBallImage.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/QBallImages/mitkQBallImage.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkQBallImage.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkQBallImage.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkQBallImage.h similarity index 92% rename from Modules/DiffusionImaging/IODataStructures/QBallImages/mitkQBallImage.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkQBallImage.h index f727d210b1..d88ffc6a00 100644 --- a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkQBallImage.h +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkQBallImage.h @@ -1,70 +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. ===================================================================*/ #ifndef __mitkQBallImage__h #define __mitkQBallImage__h #include "mitkImage.h" #include "itkVectorImage.h" #include "mitkImageVtkAccessor.h" -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" // generate by n-fold subdivisions of an icosahedron // 1 - 12 // 2 - 42 // 3 - 92 // 4 - 162 // 5 - 252 // 6 - 362 // 7 - 492 // 8 - 642 // 9 - 812 // 10 - 1002 #define QBALL_ODFSIZE 252 namespace mitk { /** * \brief this class encapsulates qball images */ - class MitkDiffusionImaging_EXPORT QBallImage : public Image + class DiffusionCore_EXPORT QBallImage : public Image { public: mitkClassMacro( QBallImage, Image ); itkNewMacro(Self); virtual ImageVtkAccessor* GetNonRgbVtkImageData(int t = 0, int n = 0); virtual ImageVtkAccessor* GetVtkImageData(int t = 0, int n = 0); virtual void ConstructRgbImage(); protected: QBallImage(); virtual ~QBallImage(); mitk::Image::Pointer m_RgbImage; }; } // namespace mitk #endif /* __mitkQBallImage__h */ diff --git a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkQBallImageSerializer.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkQBallImageSerializer.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/QBallImages/mitkQBallImageSerializer.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkQBallImageSerializer.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkQBallImageSerializer.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkQBallImageSerializer.h similarity index 88% rename from Modules/DiffusionImaging/IODataStructures/QBallImages/mitkQBallImageSerializer.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkQBallImageSerializer.h index e069998e50..b023494114 100644 --- a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkQBallImageSerializer.h +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkQBallImageSerializer.h @@ -1,39 +1,39 @@ /*=================================================================== 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 mitkQBallImageSerializer_h_included #define mitkQBallImageSerializer_h_included -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #include "mitkBaseDataSerializer.h" namespace mitk { /** \brief Serializes mitk::Surface for mitk::SceneIO */ -class MitkDiffusionImaging_EXPORT QBallImageSerializer : public BaseDataSerializer +class DiffusionCore_EXPORT QBallImageSerializer : public BaseDataSerializer { public: mitkClassMacro( QBallImageSerializer, BaseDataSerializer ); itkNewMacro(Self); virtual std::string Serialize(); protected: QBallImageSerializer(); virtual ~QBallImageSerializer(); }; } // namespace #endif diff --git a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkQBallImageSource.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkQBallImageSource.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/QBallImages/mitkQBallImageSource.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkQBallImageSource.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkQBallImageSource.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkQBallImageSource.h similarity index 91% rename from Modules/DiffusionImaging/IODataStructures/QBallImages/mitkQBallImageSource.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkQBallImageSource.h index eb4cc66e4a..b30cf8bc27 100644 --- a/Modules/DiffusionImaging/IODataStructures/QBallImages/mitkQBallImageSource.h +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/QBallImages/mitkQBallImageSource.h @@ -1,49 +1,49 @@ /*=================================================================== 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 QBallImageSource_H_HEADER_INCLUDED_C1E7D6EC #define QBallImageSource_H_HEADER_INCLUDED_C1E7D6EC #include "mitkImageSource.h" #include "mitkQBallImage.h" -#include +#include namespace mitk { -class MitkDiffusionImaging_EXPORT QBallImageSource : public ImageSource +class DiffusionCore_EXPORT QBallImageSource : public ImageSource { public: typedef mitk::QBallImage OutputImageType; typedef OutputImageType::Pointer OutputImagePointer; typedef SlicedData::RegionType OutputImageRegionType; typedef itk::DataObject::Pointer DataObjectPointer; mitkClassMacro(QBallImageSource,ImageSource); itkNewMacro(Self); virtual DataObjectPointer MakeOutput(unsigned int idx); protected: QBallImageSource(); virtual ~QBallImageSource() {} }; } // namespace mitk #endif /* QBallImageSource_H_HEADER_INCLUDED_C1E7D6EC */ diff --git a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageIOFactory.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageIOFactory.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageIOFactory.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageIOFactory.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageIOFactory.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageIOFactory.h similarity index 94% rename from Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageIOFactory.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageIOFactory.h index db03b5bf40..890d8a7096 100644 --- a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageIOFactory.h +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageIOFactory.h @@ -1,77 +1,77 @@ /*=================================================================== 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_NRRD_DTI_IO_FACTORY_H_HEADER__ #define __MITK_NRRD_DTI_IO_FACTORY_H_HEADER__ #ifdef _MSC_VER #pragma warning ( disable : 4786 ) #endif #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" namespace mitk { //##Documentation //## @brief Create instances of NrrdTensorImageReader objects using an object factory. //## //## @ingroup IO -class MitkDiffusionImaging_EXPORT NrrdTensorImageIOFactory : public itk::ObjectFactoryBase +class DiffusionCore_EXPORT NrrdTensorImageIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ typedef NrrdTensorImageIOFactory Self; typedef itk::ObjectFactoryBase Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); static NrrdTensorImageIOFactory* FactoryNew() { return new NrrdTensorImageIOFactory;} /** Run-time type information (and related methods). */ itkTypeMacro(NrrdTensorImageIOFactory, ObjectFactoryBase); /** Register one factory of this type */ static void RegisterOneFactory(void) { static bool IsRegistered = false; if ( !IsRegistered ) { NrrdTensorImageIOFactory::Pointer ugVtkWriterFactory = NrrdTensorImageIOFactory::New(); ObjectFactoryBase::RegisterFactory( ugVtkWriterFactory ); IsRegistered = true; } } protected: NrrdTensorImageIOFactory(); ~NrrdTensorImageIOFactory(); private: NrrdTensorImageIOFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif // __MITK_NRRD_DTI_IO_FACTORY_H_HEADER__ diff --git a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageReader.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageReader.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageReader.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageReader.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageReader.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageReader.h similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageReader.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageReader.h diff --git a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageWriter.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageWriter.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageWriter.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageWriter.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageWriter.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageWriter.h similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageWriter.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageWriter.h diff --git a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageWriterFactory.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageWriterFactory.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageWriterFactory.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageWriterFactory.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageWriterFactory.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageWriterFactory.h similarity index 92% rename from Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageWriterFactory.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageWriterFactory.h index d487e793c8..762a02d598 100644 --- a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkNrrdTensorImageWriterFactory.h +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkNrrdTensorImageWriterFactory.h @@ -1,67 +1,67 @@ /*=================================================================== 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 NRRDDTI_WRITERFACTORY_H_HEADER_INCLUDED #define NRRDDTI_WRITERFACTORY_H_HEADER_INCLUDED #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" namespace mitk { -class MitkDiffusionImaging_EXPORT NrrdTensorImageWriterFactory : public itk::ObjectFactoryBase +class DiffusionCore_EXPORT NrrdTensorImageWriterFactory : public itk::ObjectFactoryBase { public: mitkClassMacro( mitk::NrrdTensorImageWriterFactory, itk::ObjectFactoryBase ) /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); /** Register one factory of this type */ static void RegisterOneFactory(void) { static bool IsRegistered = false; if ( !IsRegistered ) { NrrdTensorImageWriterFactory::Pointer ugVtkWriterFactory = NrrdTensorImageWriterFactory::New(); ObjectFactoryBase::RegisterFactory( ugVtkWriterFactory ); IsRegistered = true; } } protected: NrrdTensorImageWriterFactory(); ~NrrdTensorImageWriterFactory(); private: NrrdTensorImageWriterFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif // NRRDDTI_WRITERFACTORY_H_HEADER_INCLUDED diff --git a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkTensorImage.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkTensorImage.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TensorImages/mitkTensorImage.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkTensorImage.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkTensorImage.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkTensorImage.h similarity index 91% rename from Modules/DiffusionImaging/IODataStructures/TensorImages/mitkTensorImage.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkTensorImage.h index 27026a4836..cf64e5332c 100644 --- a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkTensorImage.h +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkTensorImage.h @@ -1,59 +1,59 @@ /*=================================================================== 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 __mitkTensorImage__h #define __mitkTensorImage__h #include "mitkImage.h" #include "itkVectorImage.h" -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #define TENSOR_NUM_ELEMENTS 6 namespace mitk { /** * \brief this class encapsulates tensor images */ - class MitkDiffusionImaging_EXPORT TensorImage : public Image + class DiffusionCore_EXPORT TensorImage : public Image { public: mitkClassMacro( TensorImage, Image ); itkNewMacro(Self); virtual ImageVtkAccessor* GetNonRgbVtkImageData(int t = 0, int n = 0); virtual ImageVtkAccessor* GetVtkImageData(int t = 0, int n = 0); virtual void ConstructRgbImage(); protected: TensorImage(); virtual ~TensorImage(); mitk::Image::Pointer m_RgbImage; }; } // namespace mitk #endif /* __mitkTensorImage__h */ diff --git a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkTensorImageSerializer.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkTensorImageSerializer.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TensorImages/mitkTensorImageSerializer.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkTensorImageSerializer.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkTensorImageSerializer.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkTensorImageSerializer.h similarity index 88% rename from Modules/DiffusionImaging/IODataStructures/TensorImages/mitkTensorImageSerializer.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkTensorImageSerializer.h index fadf66087f..e19ec997b9 100644 --- a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkTensorImageSerializer.h +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkTensorImageSerializer.h @@ -1,39 +1,39 @@ /*=================================================================== 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 mitkTensorImageSerializer_h_included #define mitkTensorImageSerializer_h_included -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #include "mitkBaseDataSerializer.h" namespace mitk { /** \brief Serializes mitk::Surface for mitk::SceneIO */ -class MitkDiffusionImaging_EXPORT TensorImageSerializer : public BaseDataSerializer +class DiffusionCore_EXPORT TensorImageSerializer : public BaseDataSerializer { public: mitkClassMacro( TensorImageSerializer, BaseDataSerializer ); itkNewMacro(Self); virtual std::string Serialize(); protected: TensorImageSerializer(); virtual ~TensorImageSerializer(); }; } // namespace #endif diff --git a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkTensorImageSource.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkTensorImageSource.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TensorImages/mitkTensorImageSource.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkTensorImageSource.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TensorImages/mitkTensorImageSource.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkTensorImageSource.h similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TensorImages/mitkTensorImageSource.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/TensorImages/mitkTensorImageSource.h diff --git a/Modules/DiffusionImaging/IODataStructures/mitkDiffusionImagingObjectFactory.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/mitkDiffusionCoreObjectFactory.cpp similarity index 54% rename from Modules/DiffusionImaging/IODataStructures/mitkDiffusionImagingObjectFactory.cpp rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/mitkDiffusionCoreObjectFactory.cpp index 160a7b60b1..4a8a868b18 100644 --- a/Modules/DiffusionImaging/IODataStructures/mitkDiffusionImagingObjectFactory.cpp +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/mitkDiffusionCoreObjectFactory.cpp @@ -1,419 +1,277 @@ /*=================================================================== 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 "mitkDiffusionImagingObjectFactory.h" +#include "mitkDiffusionCoreObjectFactory.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 "mitkVolumeDataVtkMapper3D.h" -#include "mitkTbssImageMapper.h" - - -//modernized fiberbundle datastrucutre -#include "mitkFiberBundleX.h" -#include "mitkFiberBundleXIOFactory.h" -#include "mitkFiberBundleXWriterFactory.h" -#include "mitkFiberBundleXWriter.h" -#include "mitkFiberBundleXMapper3D.h" -#include "mitkFiberBundleXMapper2D.h" - -#include "mitkFiberBundleXThreadMonitorMapper3D.h" -#include "mitkFiberBundleXThreadMonitor.h" - -#include "mitkNrrdTbssImageIOFactory.h" -#include "mitkNrrdTbssImageWriterFactory.h" -#include "mitkNrrdTbssImageWriter.h" - -#include "mitkNrrdTbssRoiImageIOFactory.h" -#include "mitkNrrdTbssRoiImageWriterFactory.h" -#include "mitkNrrdTbssRoiImageWriter.h" #include "mitkPlanarFigureMapper3D.h" -#include "mitkConnectomicsNetwork.h" -#include "mitkConnectomicsNetworkIOFactory.h" -#include "mitkConnectomicsNetworkWriter.h" -#include "mitkConnectomicsNetworkWriterFactory.h" -#include "mitkConnectomicsNetworkMapper3D.h" typedef short DiffusionPixelType; -typedef char TbssRoiPixelType; -typedef float TbssPixelType; -typedef int TbssGradientPixelType; - typedef mitk::DiffusionImage DiffusionImageShort; typedef std::multimap MultimapType; -mitk::DiffusionImagingObjectFactory::DiffusionImagingObjectFactory(bool /*registerSelf*/) -:CoreObjectFactoryBase() +mitk::DiffusionCoreObjectFactory::DiffusionCoreObjectFactory(bool /*registerSelf*/) + :CoreObjectFactoryBase() { static bool alreadyDone = false; if (!alreadyDone) { - MITK_DEBUG << "DiffusionImagingObjectFactory c'tor" << std::endl; + MITK_DEBUG << "DiffusionCoreObjectFactory c'tor" << std::endl; RegisterIOFactories(); - mitk::NrrdDiffusionImageIOFactory::RegisterOneFactory(); mitk::NrrdQBallImageIOFactory::RegisterOneFactory(); mitk::NrrdTensorImageIOFactory::RegisterOneFactory(); - mitk::NrrdTbssImageIOFactory::RegisterOneFactory(); - mitk::NrrdTbssRoiImageIOFactory::RegisterOneFactory(); - mitk::FiberBundleXIOFactory::RegisterOneFactory(); //modernized - mitk::ConnectomicsNetworkIOFactory::RegisterOneFactory(); - mitk::NrrdDiffusionImageWriterFactory::RegisterOneFactory(); mitk::NrrdQBallImageWriterFactory::RegisterOneFactory(); mitk::NrrdTensorImageWriterFactory::RegisterOneFactory(); - mitk::NrrdTbssImageWriterFactory::RegisterOneFactory(); - mitk::NrrdTbssRoiImageWriterFactory::RegisterOneFactory(); - mitk::FiberBundleXWriterFactory::RegisterOneFactory();//modernized - mitk::ConnectomicsNetworkWriterFactory::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( NrrdTbssImageWriter::New().GetPointer() ); - m_FileWriters.push_back( NrrdTbssRoiImageWriter::New().GetPointer() ); - m_FileWriters.push_back( mitk::FiberBundleXWriter::New().GetPointer() );//modernized - m_FileWriters.push_back( mitk::ConnectomicsNetworkWriter::New().GetPointer() ); mitk::CoreObjectFactory::GetInstance()->RegisterExtraFactory(this); CreateFileExtensionsMap(); alreadyDone = true; } } -mitk::Mapper::Pointer mitk::DiffusionImagingObjectFactory::CreateMapper(mitk::DataNode* node, MapperSlotId id) +mitk::Mapper::Pointer mitk::DiffusionCoreObjectFactory::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); } - classname = "TbssRoiImage"; - if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) - { - newMapper = mitk::ImageVtkMapper2D::New(); - newMapper->SetDataNode(node); - } - - classname = "FiberBundleX"; - if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) - { - newMapper = mitk::FiberBundleXMapper2D::New(); - newMapper->SetDataNode(node); - } - - classname = "TbssImage"; - if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) - { - newMapper = mitk::TbssImageMapper::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 = "FiberBundleX"; - if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) - { - newMapper = mitk::FiberBundleXMapper3D::New(); - newMapper->SetDataNode(node); - } - - classname = "FiberBundleXThreadMonitor"; - if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) - { - newMapper = mitk::FiberBundleXThreadMonitorMapper3D::New(); - newMapper->SetDataNode(node); - } - - classname = "TbssRoiImage"; - if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) - { - newMapper = mitk::VolumeDataVtkMapper3D::New(); - newMapper->SetDataNode(node); - } - - classname = "TbssImage"; - if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) - { - newMapper = mitk::TbssImageMapper::New(); - newMapper->SetDataNode(node); - } - classname = "PlanarRectangle"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::PlanarFigureMapper3D::New(); newMapper->SetDataNode(node); } classname = "PlanarCircle"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::PlanarFigureMapper3D::New(); newMapper->SetDataNode(node); } classname = "PlanarEllipse"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::PlanarFigureMapper3D::New(); newMapper->SetDataNode(node); } classname = "PlanarPolygon"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { newMapper = mitk::PlanarFigureMapper3D::New(); newMapper->SetDataNode(node); } - classname = "ConnectomicsNetwork"; - if (node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) - { - newMapper = mitk::ConnectomicsNetworkMapper3D::New(); - newMapper->SetDataNode(node); - } - } return newMapper; } -void mitk::DiffusionImagingObjectFactory::SetDefaultProperties(mitk::DataNode* node) +void mitk::DiffusionCoreObjectFactory::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 = "FiberBundleX"; - if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) - { - mitk::FiberBundleXMapper3D::SetDefaultProperties(node); - mitk::FiberBundleXMapper2D::SetDefaultProperties(node); - } - - classname = "FiberBundleXThreadMonitor"; - if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) - { - mitk::FiberBundleXThreadMonitorMapper3D::SetDefaultProperties(node); - } - - classname = "TbssRoiImage"; - if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) - { - mitk::ImageVtkMapper2D::SetDefaultProperties(node); - mitk::VolumeDataVtkMapper3D::SetDefaultProperties(node); - } - - classname = "TbssImage"; - if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) - { - mitk::TbssImageMapper::SetDefaultProperties(node); - mitk::GPUVolumeMapper3D::SetDefaultProperties(node); - } classname = "PlanarRectangle"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { mitk::PlanarFigureMapper3D::SetDefaultProperties(node); } classname = "PlanarEllipse"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { mitk::PlanarFigureMapper3D::SetDefaultProperties(node); } classname = "PlanarCircle"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { mitk::PlanarFigureMapper3D::SetDefaultProperties(node); } classname = "PlanarPolygon"; if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) { mitk::PlanarFigureMapper3D::SetDefaultProperties(node); } - classname = "ConnectomicsNetwork"; - if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) - { - mitk::ConnectomicsNetworkMapper3D::SetDefaultProperties(node); - } - - } -const char* mitk::DiffusionImagingObjectFactory::GetFileExtensions() +const char* mitk::DiffusionCoreObjectFactory::GetFileExtensions() { std::string fileExtension; this->CreateFileExtensions(m_FileExtensionsMap, fileExtension); return fileExtension.c_str(); -}; +} -mitk::CoreObjectFactoryBase::MultimapType mitk::DiffusionImagingObjectFactory::GetFileExtensionsMap() +mitk::CoreObjectFactoryBase::MultimapType mitk::DiffusionCoreObjectFactory::GetFileExtensionsMap() { return m_FileExtensionsMap; } -const char* mitk::DiffusionImagingObjectFactory::GetSaveFileExtensions() +const char* mitk::DiffusionCoreObjectFactory::GetSaveFileExtensions() { std::string fileExtension; this->CreateFileExtensions(m_SaveFileExtensionsMap, fileExtension); return fileExtension.c_str(); -}; +} -mitk::CoreObjectFactoryBase::MultimapType mitk::DiffusionImagingObjectFactory::GetSaveFileExtensionsMap() +mitk::CoreObjectFactoryBase::MultimapType mitk::DiffusionCoreObjectFactory::GetSaveFileExtensionsMap() { return m_SaveFileExtensionsMap; } -void mitk::DiffusionImagingObjectFactory::CreateFileExtensionsMap() +void mitk::DiffusionCoreObjectFactory::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_FileExtensionsMap.insert(std::pair("*.vtk", "Fiber Bundle")); - m_FileExtensionsMap.insert(std::pair("*.tbss", "TBSS data")); - m_FileExtensionsMap.insert(std::pair("*.pf", "Planar Figure File")); - m_FileExtensionsMap.insert(std::pair("*.roi", "TBSS ROI data")); - m_FileExtensionsMap.insert(std::pair("*.cnf", "Connectomics Network File")); + // m_FileExtensionsMap.insert(std::pair("*.pf", "Planar Figure File")); + 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")); - m_SaveFileExtensionsMap.insert(std::pair("*.vtk", "Fiber Bundle")); - m_SaveFileExtensionsMap.insert(std::pair("*.tbss", "TBSS data")); - m_SaveFileExtensionsMap.insert(std::pair("*.pf", "Planar Figure File")); - m_SaveFileExtensionsMap.insert(std::pair("*.roi", "TBSS ROI data")); - m_SaveFileExtensionsMap.insert(std::pair("*.cnf", "Connectomics Network File")); + // m_SaveFileExtensionsMap.insert(std::pair("*.pf", "Planar Figure File")); + } -void mitk::DiffusionImagingObjectFactory::RegisterIOFactories() +void mitk::DiffusionCoreObjectFactory::RegisterIOFactories() { } -void RegisterDiffusionImagingObjectFactory() +void RegisterDiffusionCoreObjectFactory() { - static bool oneDiffusionImagingObjectFactoryRegistered = false; - if ( ! oneDiffusionImagingObjectFactoryRegistered ) { - MITK_DEBUG << "Registering DiffusionImagingObjectFactory..." << std::endl; - mitk::CoreObjectFactory::GetInstance()->RegisterExtraFactory(mitk::DiffusionImagingObjectFactory::New()); + static bool oneDiffusionCoreObjectFactoryRegistered = false; + if ( ! oneDiffusionCoreObjectFactoryRegistered ) { + MITK_DEBUG << "Registering DiffusionCoreObjectFactory..." << std::endl; + mitk::CoreObjectFactory::GetInstance()->RegisterExtraFactory(mitk::DiffusionCoreObjectFactory::New()); - oneDiffusionImagingObjectFactoryRegistered = true; + oneDiffusionCoreObjectFactoryRegistered = true; } } diff --git a/Modules/DiffusionImaging/IODataStructures/mitkDiffusionImagingObjectFactory.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/mitkDiffusionCoreObjectFactory.h similarity index 73% rename from Modules/DiffusionImaging/IODataStructures/mitkDiffusionImagingObjectFactory.h rename to Modules/DiffusionImaging/DiffusionCore/IODataStructures/mitkDiffusionCoreObjectFactory.h index ec6379c488..fe8a78da0e 100644 --- a/Modules/DiffusionImaging/IODataStructures/mitkDiffusionImagingObjectFactory.h +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/mitkDiffusionCoreObjectFactory.h @@ -1,55 +1,55 @@ /*=================================================================== 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 DiffusionImagingObjectFactory_H_INCLUDED -#define DiffusionImagingObjectFactory_H_INCLUDED +#ifndef DiffusionCoreObjectFactory_H_INCLUDED +#define DiffusionCoreObjectFactory_H_INCLUDED #include "mitkCoreObjectFactory.h" -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" namespace mitk { -class MitkDiffusionImaging_EXPORT DiffusionImagingObjectFactory : public CoreObjectFactoryBase +class DiffusionCore_EXPORT DiffusionCoreObjectFactory : public CoreObjectFactoryBase { public: - mitkClassMacro(DiffusionImagingObjectFactory,CoreObjectFactoryBase); - itkNewMacro(DiffusionImagingObjectFactory); + mitkClassMacro(DiffusionCoreObjectFactory,CoreObjectFactoryBase); + itkNewMacro(DiffusionCoreObjectFactory); virtual Mapper::Pointer CreateMapper(mitk::DataNode* node, MapperSlotId slotId); virtual void SetDefaultProperties(mitk::DataNode* node); virtual const char* GetFileExtensions(); virtual mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap(); virtual const char* GetSaveFileExtensions(); virtual mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap(); void RegisterIOFactories(); protected: - DiffusionImagingObjectFactory(bool registerSelf = true); + DiffusionCoreObjectFactory(bool registerSelf = true); private: void CreateFileExtensionsMap(); std::string m_ExternalFileExtensions; std::string m_InternalFileExtensions; std::string m_SaveFileExtensions; MultimapType m_FileExtensionsMap; MultimapType m_SaveFileExtensionsMap; }; } // global declaration for simple call by // applications -void MitkDiffusionImaging_EXPORT RegisterDiffusionImagingObjectFactory(); +void DiffusionCore_EXPORT RegisterDiffusionCoreObjectFactory(); #endif diff --git a/Modules/DiffusionImaging/Rendering/mitkCompositeMapper.cpp b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkCompositeMapper.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkCompositeMapper.cpp rename to Modules/DiffusionImaging/DiffusionCore/Rendering/mitkCompositeMapper.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkCompositeMapper.h b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkCompositeMapper.h similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkCompositeMapper.h rename to Modules/DiffusionImaging/DiffusionCore/Rendering/mitkCompositeMapper.h diff --git a/Modules/DiffusionImaging/Rendering/mitkDiffusionImageMapper.cpp b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkDiffusionImageMapper.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkDiffusionImageMapper.cpp rename to Modules/DiffusionImaging/DiffusionCore/Rendering/mitkDiffusionImageMapper.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkDiffusionImageMapper.h b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkDiffusionImageMapper.h similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkDiffusionImageMapper.h rename to Modules/DiffusionImaging/DiffusionCore/Rendering/mitkDiffusionImageMapper.h diff --git a/Modules/DiffusionImaging/Rendering/mitkOdfNormalizationMethodProperty.cpp b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkOdfNormalizationMethodProperty.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkOdfNormalizationMethodProperty.cpp rename to Modules/DiffusionImaging/DiffusionCore/Rendering/mitkOdfNormalizationMethodProperty.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkOdfNormalizationMethodProperty.h b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkOdfNormalizationMethodProperty.h similarity index 92% rename from Modules/DiffusionImaging/Rendering/mitkOdfNormalizationMethodProperty.h rename to Modules/DiffusionImaging/DiffusionCore/Rendering/mitkOdfNormalizationMethodProperty.h index 2e4db4ec78..85f094f7b5 100644 --- a/Modules/DiffusionImaging/Rendering/mitkOdfNormalizationMethodProperty.h +++ b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkOdfNormalizationMethodProperty.h @@ -1,135 +1,135 @@ /*=================================================================== 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_OdfNormalizationMethodProperty__H_ #define _MITK_OdfNormalizationMethodProperty__H_ #include "mitkEnumerationProperty.h" #include "mitkEnumerationPropertySerializer.h" -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #include "mitkSerializerMacros.h" namespace mitk { enum OdfNormalizationMethod { ODFN_MINMAX, ODFN_MAX, ODFN_NONE, ODFN_GLOBAL_MAX }; /** * Encapsulates the enumeration for ODF normalization. Valid values are * ODFN_MINMAX, ODFN_MAX, ODFN_NONE ODFN_GLOBAL_MAX * Default is ODFN_MINMAX */ -class MitkDiffusionImaging_EXPORT OdfNormalizationMethodProperty : public EnumerationProperty +class DiffusionCore_EXPORT OdfNormalizationMethodProperty : public EnumerationProperty { public: mitkClassMacro( OdfNormalizationMethodProperty, EnumerationProperty ); itkNewMacro(OdfNormalizationMethodProperty); mitkNewMacro1Param(OdfNormalizationMethodProperty, const IdType&); mitkNewMacro1Param(OdfNormalizationMethodProperty, const std::string&); /** * Returns the current interpolation value as defined by VTK constants. */ virtual int GetNormalization(); /** * Sets the interpolation type to ODFN_MINMAX. */ virtual void SetNormalizationToMinMax(); /** * Sets the interpolation type to ODFN_MAX. */ virtual void SetNormalizationToMax(); /** * Sets the interpolation type to ODFN_NONE. */ virtual void SetNormalizationToNone(); /** * Sets the interpolation type to ODFN_GLOBAL_MAX. */ virtual void SetNormalizationToGlobalMax(); protected: /** Sets reslice interpolation mode to default (VTK_RESLICE_NEAREST). */ OdfNormalizationMethodProperty( ); /** * Constructor. Sets reslice interpolation to the given value. */ OdfNormalizationMethodProperty( const IdType& value ); /** * Constructor. Sets reslice interpolation to the given value. */ OdfNormalizationMethodProperty( const std::string& value ); /** * this function is overridden as protected, so that the user may not add * additional invalid interpolation types. */ 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 AddInterpolationTypes(); }; -class MitkDiffusionImaging_EXPORT OdfNormalizationMethodPropertySerializer : public EnumerationPropertySerializer +class DiffusionCore_EXPORT OdfNormalizationMethodPropertySerializer : public EnumerationPropertySerializer { public: mitkClassMacro( OdfNormalizationMethodPropertySerializer, EnumerationPropertySerializer ); itkNewMacro(Self); virtual BaseProperty::Pointer Deserialize(TiXmlElement* element) { if (!element) return NULL; const char* sa( element->Attribute("value") ); std::string s(sa?sa:""); OdfNormalizationMethodProperty::Pointer property = OdfNormalizationMethodProperty::New(); property->SetValue( s ); return property.GetPointer(); } protected: OdfNormalizationMethodPropertySerializer () {} virtual ~OdfNormalizationMethodPropertySerializer () {} }; } // end of namespace mitk #endif diff --git a/Modules/DiffusionImaging/Rendering/mitkOdfScaleByProperty.cpp b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkOdfScaleByProperty.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkOdfScaleByProperty.cpp rename to Modules/DiffusionImaging/DiffusionCore/Rendering/mitkOdfScaleByProperty.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkOdfScaleByProperty.h b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkOdfScaleByProperty.h similarity index 92% rename from Modules/DiffusionImaging/Rendering/mitkOdfScaleByProperty.h rename to Modules/DiffusionImaging/DiffusionCore/Rendering/mitkOdfScaleByProperty.h index c2f45b56fa..27a76ff580 100644 --- a/Modules/DiffusionImaging/Rendering/mitkOdfScaleByProperty.h +++ b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkOdfScaleByProperty.h @@ -1,115 +1,115 @@ /*=================================================================== 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_OdfScaleByProperty__H_ #define _MITK_OdfScaleByProperty__H_ -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #include "mitkEnumerationProperty.h" #include "mitkEnumerationPropertySerializer.h" namespace mitk { enum OdfScaleBy { ODFSB_NONE, ODFSB_GFA, ODFSB_PC }; /** * Encapsulates the enumeration for ODF normalization. Valid values are * ODFSB_NONE, ODFSB_GFA, ODFSB_PC * Default is ODFSB_NONE */ -class MitkDiffusionImaging_EXPORT OdfScaleByProperty : public EnumerationProperty +class DiffusionCore_EXPORT OdfScaleByProperty : public EnumerationProperty { public: mitkClassMacro( OdfScaleByProperty, EnumerationProperty ); itkNewMacro(OdfScaleByProperty); mitkNewMacro1Param(OdfScaleByProperty, const IdType&); mitkNewMacro1Param(OdfScaleByProperty, const std::string&); /** * Returns the current interpolation value as defined by VTK constants. */ virtual int GetScaleBy(); virtual void SetScaleByNothing(); virtual void SetScaleByGFA(); virtual void SetScaleByPrincipalCurvature(); protected: /** Sets reslice interpolation mode to default (ODFSB_NONE). */ OdfScaleByProperty( ); /** * Constructor. Sets reslice interpolation to the given value. */ OdfScaleByProperty( const IdType& value ); /** * Constructor. Sets reslice interpolation to the given value. */ OdfScaleByProperty( const std::string& value ); /** * this function is overridden as protected, so that the user may not add * additional invalid interpolation types. */ 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 AddInterpolationTypes(); }; -class MitkDiffusionImaging_EXPORT OdfScaleByPropertySerializer : public EnumerationPropertySerializer +class DiffusionCore_EXPORT OdfScaleByPropertySerializer : public EnumerationPropertySerializer { public: mitkClassMacro( OdfScaleByPropertySerializer, EnumerationPropertySerializer ); itkNewMacro(Self); virtual BaseProperty::Pointer Deserialize(TiXmlElement* element) { if (!element) return NULL; const char* sa( element->Attribute("value") ); std::string s(sa?sa:""); OdfScaleByProperty::Pointer property = OdfScaleByProperty::New(); property->SetValue( s ); return property.GetPointer(); } protected: OdfScaleByPropertySerializer () {} virtual ~OdfScaleByPropertySerializer () {} }; } // end of namespace mitk #endif diff --git a/Modules/DiffusionImaging/Rendering/mitkOdfVtkMapper2D.h b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkOdfVtkMapper2D.h similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkOdfVtkMapper2D.h rename to Modules/DiffusionImaging/DiffusionCore/Rendering/mitkOdfVtkMapper2D.h diff --git a/Modules/DiffusionImaging/Rendering/mitkOdfVtkMapper2D.txx b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkOdfVtkMapper2D.txx similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkOdfVtkMapper2D.txx rename to Modules/DiffusionImaging/DiffusionCore/Rendering/mitkOdfVtkMapper2D.txx diff --git a/Modules/DiffusionImaging/Rendering/mitkPlanarFigureMapper3D.cpp b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkPlanarFigureMapper3D.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkPlanarFigureMapper3D.cpp rename to Modules/DiffusionImaging/DiffusionCore/Rendering/mitkPlanarFigureMapper3D.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkPlanarFigureMapper3D.h b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkPlanarFigureMapper3D.h similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkPlanarFigureMapper3D.h rename to Modules/DiffusionImaging/DiffusionCore/Rendering/mitkPlanarFigureMapper3D.h diff --git a/Modules/DiffusionImaging/Rendering/mitkVectorImageVtkGlyphMapper3D.cpp b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkVectorImageVtkGlyphMapper3D.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkVectorImageVtkGlyphMapper3D.cpp rename to Modules/DiffusionImaging/DiffusionCore/Rendering/mitkVectorImageVtkGlyphMapper3D.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkVectorImageVtkGlyphMapper3D.h b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkVectorImageVtkGlyphMapper3D.h similarity index 94% rename from Modules/DiffusionImaging/Rendering/mitkVectorImageVtkGlyphMapper3D.h rename to Modules/DiffusionImaging/DiffusionCore/Rendering/mitkVectorImageVtkGlyphMapper3D.h index e083edbb4a..f75dd01ea8 100644 --- a/Modules/DiffusionImaging/Rendering/mitkVectorImageVtkGlyphMapper3D.h +++ b/Modules/DiffusionImaging/DiffusionCore/Rendering/mitkVectorImageVtkGlyphMapper3D.h @@ -1,100 +1,100 @@ /*=================================================================== 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_VECTOR_IMAGE_VTK_MAPPER_3D__H #define _MITK_VECTOR_IMAGE_VTK_MAPPER_3D__H -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #include "mitkVtkMapper3D.h" #include "mitkImage.h" class vtkMaskedGlyph3D; class vtkActor; class vtkPolyDataMapper; class vtkMaskPoints; namespace mitk { -class MitkDiffusionImaging_EXPORT VectorImageVtkGlyphMapper3D : public VtkMapper3D +class DiffusionCore_EXPORT VectorImageVtkGlyphMapper3D : public VtkMapper3D { public: mitkClassMacro( VectorImageVtkGlyphMapper3D, VtkMapper3D ); itkNewMacro( Self ); enum GlyphType {LineGlyph, ArrowGlyph}; itkSetMacro(MaximumNumberOfPoints, unsigned int); itkGetMacro(MaximumNumberOfPoints, unsigned int); itkSetMacro(UseMaskPoints, bool); itkGetMacro(UseMaskPoints, bool); itkBooleanMacro(UseMaskPoints); itkSetMacro(RandomMode, bool); itkGetMacro(RandomMode, bool); itkBooleanMacro(RandomMode); virtual vtkProp* GetVtkProp(mitk::BaseRenderer* renderer); protected: /** * Constructor. Doesn't do anything... */ VectorImageVtkGlyphMapper3D(); /** * Destructor */ virtual ~VectorImageVtkGlyphMapper3D(); /** * Generate a vtkPolyData by creating vectors as glyphs */ virtual void GenerateData(); /** * This method is called, each time a specific renderer is updated. */ virtual void GenerateDataForRenderer( mitk::BaseRenderer* renderer ); /** * Returns the input data object of the given filter. In this * case, a mitk::Image is returned. */ Image* GetInput(); vtkMaskedGlyph3D* m_Glyph3DGenerator; vtkActor* m_Glyph3DActor; vtkPolyDataMapper* m_Glyph3DMapper; GlyphType m_GlyphType; unsigned int m_MaximumNumberOfPoints; bool m_UseMaskPoints; bool m_RandomMode; }; } //end of namespace mitk #endif diff --git a/Modules/DiffusionImaging/Rendering/vtkMaskedProgrammableGlyphFilter.cpp b/Modules/DiffusionImaging/DiffusionCore/Rendering/vtkMaskedProgrammableGlyphFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/vtkMaskedProgrammableGlyphFilter.cpp rename to Modules/DiffusionImaging/DiffusionCore/Rendering/vtkMaskedProgrammableGlyphFilter.cpp diff --git a/Modules/DiffusionImaging/Rendering/vtkMaskedProgrammableGlyphFilter.h b/Modules/DiffusionImaging/DiffusionCore/Rendering/vtkMaskedProgrammableGlyphFilter.h similarity index 95% rename from Modules/DiffusionImaging/Rendering/vtkMaskedProgrammableGlyphFilter.h rename to Modules/DiffusionImaging/DiffusionCore/Rendering/vtkMaskedProgrammableGlyphFilter.h index e5565522a6..f5203fd558 100644 --- a/Modules/DiffusionImaging/Rendering/vtkMaskedProgrammableGlyphFilter.h +++ b/Modules/DiffusionImaging/DiffusionCore/Rendering/vtkMaskedProgrammableGlyphFilter.h @@ -1,115 +1,115 @@ /*=================================================================== 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 __vtkMaskedProgrammableGlyphFilter_h #define __vtkMaskedProgrammableGlyphFilter_h -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #include "vtkProgrammableGlyphFilter.h" #include "mitkGeometry3D.h" class vtkMaskPoints; /** * This class masked points of the input data set and glyphs * only the selected poitns. Points may be selected either by * random or by ratio. * Additionally, this class allows to set the InputScalars, * InputVectors and InputNormals by their field name in the * input dataset. */ -class MitkDiffusionImaging_EXPORT vtkMaskedProgrammableGlyphFilter : public vtkProgrammableGlyphFilter +class DiffusionCore_EXPORT vtkMaskedProgrammableGlyphFilter : public vtkProgrammableGlyphFilter { public: vtkTypeRevisionMacro(vtkMaskedProgrammableGlyphFilter,vtkProgrammableGlyphFilter); void PrintSelf(ostream& os, vtkIndent indent); /** * Constructor */ static vtkMaskedProgrammableGlyphFilter *New(); /** * Limit the number of points to glyph */ vtkSetMacro(MaximumNumberOfPoints, int); vtkGetMacro(MaximumNumberOfPoints, int); /** * Set the input to this filter. */ virtual void SetInput(vtkDataSet *input); /** * Set/get whether to mask points */ vtkSetMacro(UseMaskPoints, int); vtkGetMacro(UseMaskPoints, int); /** * Set/get flag to cause randomization of which points to mask. */ void SetRandomMode(int mode); int GetRandomMode(); ///** // * If you want to use an arbitrary scalars array, then set its name here. // * By default this in NULL and the filter will use the active scalar array. // */ //vtkGetStringMacro(InputScalarsSelection); //void SelectInputScalars(const char *fieldName) // {this->SetInputScalarsSelection(fieldName);} ///** // * If you want to use an arbitrary vectors array, then set its name here. // * By default this in NULL and the filter will use the active vector array. // */ //vtkGetStringMacro(InputVectorsSelection); //void SelectInputVectors(const char *fieldName) // {this->SetInputVectorsSelection(fieldName);} ///** // * If you want to use an arbitrary normals array, then set its name here. // * By default this in NULL and the filter will use the active normal array. // */ //vtkGetStringMacro(InputNormalsSelection); //void SelectInputNormals(const char *fieldName) // {this->SetInputNormalsSelection(fieldName);} void SetGeometry(mitk::Geometry3D::Pointer geo) { this->m_Geometry = geo; } mitk::Geometry3D::Pointer GetGeometry() { return this->m_Geometry; } protected: vtkMaskedProgrammableGlyphFilter(); ~vtkMaskedProgrammableGlyphFilter(); virtual void Execute(); virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); vtkMaskPoints *MaskPoints; int MaximumNumberOfPoints; int UseMaskPoints; mitk::Geometry3D::Pointer m_Geometry; private: vtkMaskedProgrammableGlyphFilter(const vtkMaskedProgrammableGlyphFilter&); // Not implemented. void operator=(const vtkMaskedProgrammableGlyphFilter&); // Not implemented. }; #endif diff --git a/Modules/DiffusionImaging/Rendering/vtkOdfSource.cxx b/Modules/DiffusionImaging/DiffusionCore/Rendering/vtkOdfSource.cxx similarity index 100% rename from Modules/DiffusionImaging/Rendering/vtkOdfSource.cxx rename to Modules/DiffusionImaging/DiffusionCore/Rendering/vtkOdfSource.cxx diff --git a/Modules/DiffusionImaging/Rendering/vtkOdfSource.h b/Modules/DiffusionImaging/DiffusionCore/Rendering/vtkOdfSource.h similarity index 94% rename from Modules/DiffusionImaging/Rendering/vtkOdfSource.h rename to Modules/DiffusionImaging/DiffusionCore/Rendering/vtkOdfSource.h index 3f4dcf22c7..8fe65d752c 100644 --- a/Modules/DiffusionImaging/Rendering/vtkOdfSource.h +++ b/Modules/DiffusionImaging/DiffusionCore/Rendering/vtkOdfSource.h @@ -1,69 +1,69 @@ /*=================================================================== 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 __vtkOdfSource_h #define __vtkOdfSource_h -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #include "vtkPolyDataAlgorithm.h" #include "mitkCommon.h" #include #include #include -class MitkDiffusionImaging_EXPORT vtkOdfSource : public vtkPolyDataAlgorithm +class DiffusionCore_EXPORT vtkOdfSource : public vtkPolyDataAlgorithm { public: vtkTypeRevisionMacro(vtkOdfSource,vtkPolyDataAlgorithm); void PrintSelf(ostream& os, vtkIndent indent); typedef itk::OrientationDistributionFunction OdfType; // Description: // Construct sphere with radius=0.5 and default resolution 8 in both Phi // and Theta directions. Theta ranges from (0,360) and phi (0,180) degrees. static vtkOdfSource *New(); vtkSetMacro(Scale,double); vtkGetMacro(Scale,double); vtkSetMacro(AdditionalScale,double); vtkGetMacro(AdditionalScale,double); vtkSetMacro(Normalization,int); vtkGetMacro(Normalization,int); vtkSetMacro(Odf,OdfType); vtkGetMacro(Odf,OdfType); protected: vtkOdfSource(); ~vtkOdfSource() {} int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *); OdfType Odf; double Scale; double AdditionalScale; int Normalization; private: vtkOdfSource(const vtkOdfSource&); // Not implemented. void operator=(const vtkOdfSource&); // Not implemented. }; #endif //__vtkOdfSource_h diff --git a/Modules/DiffusionImaging/Rendering/vtkThickPlane.cxx b/Modules/DiffusionImaging/DiffusionCore/Rendering/vtkThickPlane.cxx similarity index 100% rename from Modules/DiffusionImaging/Rendering/vtkThickPlane.cxx rename to Modules/DiffusionImaging/DiffusionCore/Rendering/vtkThickPlane.cxx diff --git a/Modules/DiffusionImaging/Rendering/vtkThickPlane.h b/Modules/DiffusionImaging/DiffusionCore/Rendering/vtkThickPlane.h similarity index 95% rename from Modules/DiffusionImaging/Rendering/vtkThickPlane.h rename to Modules/DiffusionImaging/DiffusionCore/Rendering/vtkThickPlane.h index afbf1b74e6..6c2639de7d 100644 --- a/Modules/DiffusionImaging/Rendering/vtkThickPlane.h +++ b/Modules/DiffusionImaging/DiffusionCore/Rendering/vtkThickPlane.h @@ -1,95 +1,95 @@ /*=================================================================== 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. ===================================================================*/ // .NAME vtkPlane - perform various plane computations // .SECTION Description // vtkPlane provides methods for various plane computations. These include // projecting points onto a plane, evaluating the plane equation, and // returning plane normal. vtkPlane is a concrete implementation of the // abstract class vtkImplicitFunction. #ifndef __vtkThickPlane_h #define __vtkThickPlane_h -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" #include "vtkImplicitFunction.h" #include "mitkCommon.h" -class MitkDiffusionImaging_EXPORT vtkThickPlane : public vtkImplicitFunction +class DiffusionCore_EXPORT vtkThickPlane : public vtkImplicitFunction { public: // Description // Construct plane passing through origin and normal to z-axis. static vtkThickPlane *New(); vtkTypeRevisionMacro(vtkThickPlane,vtkImplicitFunction); void PrintSelf(ostream& os, vtkIndent indent); // Description // Evaluate plane equation for point x[3]. double EvaluateFunction(double x[3]); double EvaluateFunction(double x, double y, double z); // Description // Evaluate function gradient at point x[3]. void EvaluateGradient(double x[3], double g[3]); // Description: // Set/get plane normal. Plane is defined by point and normal. virtual void SetPose (double _n1, double _n2, double _n3, double _o1, double _o2, double _o3); virtual void SetPose (double _n[3], double _o[3]); vtkGetVectorMacro(Normal,double,3); vtkGetVectorMacro(Origin,double,3); // Description: // Set/get point through which plane passes. Plane is defined by point // and normal. virtual void SetThickness (double _arg); vtkGetMacro(Thickness,double); int count; protected: vtkThickPlane(); ~vtkThickPlane() {}; // Description: // Set/get plane normal. Plane is defined by point and normal. virtual void SetNormal (double _arg1, double _arg2, double _arg3); virtual void SetNormal (double _arg[3]); // Description: // Set/get point through which plane passes. Plane is defined by point // and normal. virtual void SetOrigin (double _arg1, double _arg2, double _arg3); virtual void SetOrigin (double _arg[3]); double Normal[3]; double Origin[3]; double Thickness; double Distance; private: vtkThickPlane(const vtkThickPlane&); // Not implemented. void operator=(const vtkThickPlane&); // Not implemented. }; #endif diff --git a/Modules/DiffusionImaging/DiffusionCore/Testing/CMakeLists.txt b/Modules/DiffusionImaging/DiffusionCore/Testing/CMakeLists.txt new file mode 100644 index 0000000000..d45daf111d --- /dev/null +++ b/Modules/DiffusionImaging/DiffusionCore/Testing/CMakeLists.txt @@ -0,0 +1 @@ +MITK_CREATE_MODULE_TESTS() \ No newline at end of file diff --git a/Modules/DiffusionImaging/DiffusionCore/Testing/files.cmake b/Modules/DiffusionImaging/DiffusionCore/Testing/files.cmake new file mode 100644 index 0000000000..ad622dfcbb --- /dev/null +++ b/Modules/DiffusionImaging/DiffusionCore/Testing/files.cmake @@ -0,0 +1,4 @@ +set(MODULE_TESTS + mitkFactoryRegistrationTest.cpp +) + diff --git a/Modules/DiffusionImaging/DiffusionCore/Testing/mitkB0ExtractionToSeparateImagesFilterTest.cpp b/Modules/DiffusionImaging/DiffusionCore/Testing/mitkB0ExtractionToSeparateImagesFilterTest.cpp new file mode 100644 index 0000000000..fe54a82dbb --- /dev/null +++ b/Modules/DiffusionImaging/DiffusionCore/Testing/mitkB0ExtractionToSeparateImagesFilterTest.cpp @@ -0,0 +1,110 @@ +/*=================================================================== + +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 "mitkTestingMacros.h" +#include "itkVectorImage.h" +#include "mitkBaseData.h" +#include "mitkBaseDataIOFactory.h" + +#include "mitkImageWriter.h" +#include "itkImageFileWriter.h" + +#include "itkB0ImageExtractionToSeparateImageFilter.h" +#include "mitkNrrdDiffusionImageReader.h" +#include "mitkDiffusionImage.h" + +#include "mitkDiffusionCoreObjectFactory.h" + +/** Documentation + * Test for factory registration + */ +int mitkB0ExtractionToSeparateImagesFilterTest(int argc , char* argv[]) +{ + // always start with this! + MITK_TEST_BEGIN("mitkB0ExtractionToSeparateImagesFilterTest"); + + MITK_TEST_CONDITION_REQUIRED(argc > 2, "Test image is specified. "); + + typedef short DiffusionPixelType; + typedef mitk::DiffusionImage< DiffusionPixelType > DiffusionImageType; + typedef mitk::NrrdDiffusionImageReader< DiffusionPixelType> DiffusionNrrdReaderType; + + RegisterDiffusionImagingObjectFactory(); + + std::string inputFileName( argv[1] ); + + std::vector inputBaseDataVector = mitk::BaseDataIO::LoadBaseDataFromFile( inputFileName, "","",false); + + MITK_TEST_CONDITION_REQUIRED( inputBaseDataVector.size() > 0, "BaseDataIO returned non-empty vector."); + + mitk::BaseData::Pointer baseData = inputBaseDataVector.at(0); + + MITK_TEST_CONDITION_REQUIRED( baseData.IsNotNull(), "BaseData is not null") + + DiffusionImageType* vols = dynamic_cast< DiffusionImageType* >(baseData.GetPointer()); + + MITK_TEST_CONDITION_REQUIRED( vols != NULL, "Casting basedata to diffusion image successfull." ); + + // filter + typedef itk::B0ImageExtractionToSeparateImageFilter< short, short> FilterType; + typename FilterType::Pointer filter = FilterType::New(); + + MITK_TEST_CONDITION_REQUIRED(filter.IsNotNull(), "Filter instance created. "); + + filter->SetInput(vols->GetVectorImage()); + filter->SetDirections(vols->GetDirections()); + filter->Update(); + + // output + mitk::Image::Pointer mitkImage = mitk::Image::New(); + + MITK_TEST_CONDITION_REQUIRED( mitkImage.IsNotNull(), "mitkImage not null." ); + + mitkImage->InitializeByItk( filter->GetOutput() ); + + MITK_TEST_CONDITION_REQUIRED( mitkImage->GetDimension()==4, "Output image is a 4D image."); + + mitkImage->SetImportChannel( filter->GetOutput()->GetBufferPointer() ); + + typedef itk::ImageFileWriter< FilterType::OutputImageType > itkImageWriterType; + typename itkImageWriterType::Pointer itkWriter = itkImageWriterType::New(); + + itkWriter->SetFileName( argv[2] ); + itkWriter->SetInput( filter->GetOutput() ); + + try + { + itkWriter->Update(); + } + catch(itk::ExceptionObject &e) + { + MITK_ERROR << "Catched exception from image writer. " << e.what(); + } + + /* + // write output + mitk::ImageWriter::Pointer writer = mitk::ImageWriter::New(); + MITK_TEST_CONDITION_REQUIRED( writer.IsNotNull(), "Writer instance created. "); + + writer->SetInput( mitkImage ); + writer->SetExtension(".nrrd"); + writer->SetFileName( "/localdata/hering/_Images/TestB0Extraction" ); + + writer->Update(); +*/ + // always end with this! + MITK_TEST_END(); +} diff --git a/Modules/DiffusionImaging/Testing/mitkFactoryRegistrationTest.cpp b/Modules/DiffusionImaging/DiffusionCore/Testing/mitkFactoryRegistrationTest.cpp similarity index 100% rename from Modules/DiffusionImaging/Testing/mitkFactoryRegistrationTest.cpp rename to Modules/DiffusionImaging/DiffusionCore/Testing/mitkFactoryRegistrationTest.cpp diff --git a/Modules/DiffusionImaging/DiffusionCore/files.cmake b/Modules/DiffusionImaging/DiffusionCore/files.cmake new file mode 100644 index 0000000000..75d68664b5 --- /dev/null +++ b/Modules/DiffusionImaging/DiffusionCore/files.cmake @@ -0,0 +1,116 @@ +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/mitkDiffusionCoreObjectFactory.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 + + # Rendering + Rendering/vtkMaskedProgrammableGlyphFilter.cpp + Rendering/mitkCompositeMapper.cpp + Rendering/mitkVectorImageVtkGlyphMapper3D.cpp + Rendering/vtkOdfSource.cxx + Rendering/vtkThickPlane.cxx + Rendering/mitkOdfNormalizationMethodProperty.cpp + Rendering/mitkOdfScaleByProperty.cpp + Rendering/mitkPlanarFigureMapper3D.cpp + + # Algorithms + Algorithms/mitkPartialVolumeAnalysisHistogramCalculator.cpp + Algorithms/mitkPartialVolumeAnalysisClusteringCalculator.cpp + + # Function Collection + mitkDiffusionFunctionCollection.cpp +) + +set(H_FILES + # function Collection + mitkDiffusionFunctionCollection.h + + # Rendering + Rendering/mitkDiffusionImageMapper.h + Rendering/mitkOdfVtkMapper2D.h + Rendering/mitkPlanarFigureMapper3D.h + + # Reconstruction + Algorithms/Reconstruction/itkDiffusionQballReconstructionImageFilter.h + Algorithms/Reconstruction/mitkTeemDiffusionTensor3DReconstructionImageFilter.h + Algorithms/Reconstruction/itkAnalyticalDiffusionQballReconstructionImageFilter.h + Algorithms/Reconstruction/itkDiffusionMultiShellQballReconstructionImageFilter.h + Algorithms/Reconstruction/itkPointShell.h + Algorithms/Reconstruction/itkOrientationDistributionFunction.h + Algorithms/Reconstruction/itkDiffusionIntravoxelIncoherentMotionReconstructionImageFilter.h + + # IO Datastructures + IODataStructures/DiffusionWeightedImages/mitkDiffusionImage.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/itkGaussianInterpolateImageFunction.h + Algorithms/mitkPartialVolumeAnalysisHistogramCalculator.h + Algorithms/mitkPartialVolumeAnalysisClusteringCalculator.h + Algorithms/itkDiffusionTensorPrincipalDirectionImageFilter.h + Algorithms/itkCartesianToPolarVectorImageFilter.h + Algorithms/itkPolarToCartesianVectorImageFilter.h + Algorithms/itkDistanceMapFilter.h + Algorithms/itkProjectionFilter.h + Algorithms/itkResidualImageFilter.h + Algorithms/itkExtractChannelFromRgbaImageFilter.h + Algorithms/itkTensorReconstructionWithEigenvalueCorrectionFilter.h + Algorithms/itkMergeDiffusionImagesFilter.h + Algorithms/itkDwiPhantomGenerationFilter.h + Algorithms/itkFiniteDiffOdfMaximaExtractionFilter.h + Algorithms/itkMrtrixPeakImageConverter.h + Algorithms/itkFslPeakImageConverter.h + Algorithms/itkFslShCoefficientImageConverter.h + Algorithms/itkOdfMaximaExtractionFilter.h + Algorithms/itkResampleDwiImageFilter.h + + + +) + +set( TOOL_FILES +) + diff --git a/Modules/DiffusionImaging/mitkDiffusionFunctionCollection.cpp b/Modules/DiffusionImaging/DiffusionCore/mitkDiffusionFunctionCollection.cpp similarity index 100% rename from Modules/DiffusionImaging/mitkDiffusionFunctionCollection.cpp rename to Modules/DiffusionImaging/DiffusionCore/mitkDiffusionFunctionCollection.cpp diff --git a/Modules/DiffusionImaging/mitkDiffusionFunctionCollection.h b/Modules/DiffusionImaging/DiffusionCore/mitkDiffusionFunctionCollection.h similarity index 92% rename from Modules/DiffusionImaging/mitkDiffusionFunctionCollection.h rename to Modules/DiffusionImaging/DiffusionCore/mitkDiffusionFunctionCollection.h index 8d745a306e..8267c5cc9b 100644 --- a/Modules/DiffusionImaging/mitkDiffusionFunctionCollection.h +++ b/Modules/DiffusionImaging/DiffusionCore/mitkDiffusionFunctionCollection.h @@ -1,39 +1,39 @@ /*=================================================================== 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 __mitkDiffusionFunctionCollection_h_ #define __mitkDiffusionFunctionCollection_h_ -#include "MitkDiffusionImagingExports.h" +#include "DiffusionCoreExports.h" namespace mitk{ -class MitkDiffusionImaging_EXPORT sh +class DiffusionCore_EXPORT sh { public: static double factorial(int number); static void Cart2Sph(double x, double y, double z, double* cart); static double legendre0(int l); static double spherical_harmonic(int m,int l,double theta,double phi, bool complexPart); static double Yj(int m, int k, double theta, double phi); }; } #endif //__mitkDiffusionFunctionCollection_h_ diff --git a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkEnergyComputer.cpp b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkEnergyComputer.cpp similarity index 100% rename from Modules/DiffusionImaging/Tractography/GibbsTracking/mitkEnergyComputer.cpp rename to Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkEnergyComputer.cpp diff --git a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkEnergyComputer.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkEnergyComputer.h similarity index 97% rename from Modules/DiffusionImaging/Tractography/GibbsTracking/mitkEnergyComputer.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkEnergyComputer.h index a7a703c917..75322cb443 100644 --- a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkEnergyComputer.h +++ b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkEnergyComputer.h @@ -1,89 +1,89 @@ /*=================================================================== 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 _ENCOMP #define _ENCOMP -#include +#include #include #include #include #include using namespace mitk; /** * \brief Calculates internal and external energy of the new particle configuration proposal. */ -class MitkDiffusionImaging_EXPORT EnergyComputer +class FiberTracking_EXPORT EnergyComputer { public: //typedef itk::Vector OdfVectorType; //typedef itk::Image ItkQBallImgType; typedef itk::Image ItkFloatImageType; typedef itk::Statistics::MersenneTwisterRandomVariateGenerator ItkRandGenType; EnergyComputer(ItkFloatImageType* mask, ParticleGrid* particleGrid, SphereInterpolator* interpolator, ItkRandGenType* randGen); void SetParameters(float particleWeight, float particleWidth, float connectionPotential, float curvThres, float inexBalance, float particlePotential); // get random position inside mask void DrawRandomPosition(vnl_vector_fixed& R); // external energy calculation virtual float ComputeExternalEnergy(vnl_vector_fixed& R, vnl_vector_fixed& N, Particle* dp) =0; // internal energy calculation virtual float ComputeInternalEnergyConnection(Particle *p1,int ep1) = 0; virtual float ComputeInternalEnergyConnection(Particle *p1,int ep1, Particle *p2, int ep2) = 0; virtual float ComputeInternalEnergy(Particle *dp) = 0; int GetNumActiveVoxels(); protected: vnl_matrix_fixed m_RotationMatrix; SphereInterpolator* m_SphereInterpolator; ParticleGrid* m_ParticleGrid; ItkRandGenType* m_RandGen; // ItkQBallImgType* m_Image; ItkFloatImageType* m_Mask; vnl_vector_fixed m_Size; vnl_vector_fixed m_Spacing; std::vector< float > m_CumulatedSpatialProbability; std::vector< int > m_ActiveIndices; // indices inside mask bool m_UseTrilinearInterpolation; // is deactivated if less than 3 image slices are available int m_NumActiveVoxels; // voxels inside mask float m_ConnectionPotential; // larger value results in larger energy value -> higher proposal acceptance probability float m_ParticleChemicalPotential; // larger value results in larger energy value -> higher proposal acceptance probability float gamma_s; float gamma_reg_s; float m_ParticleWeight; // defines how much one particle contributes to the artificial signal float m_ExtStrength; // weighting factor for external energy float m_IntStrength; // weighting factor for internal energy float m_ParticleLength; // particle length float m_SquaredParticleLength; // squared particle length float m_CurvatureThreshold; // maximum angle accepted between two connected particles float SpatProb(vnl_vector_fixed pos); float EvaluateOdf(vnl_vector_fixed &pos, vnl_vector_fixed dir); float mbesseli0(float x); float mexp(float x); }; #endif diff --git a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkFiberBuilder.cpp b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkFiberBuilder.cpp similarity index 100% rename from Modules/DiffusionImaging/Tractography/GibbsTracking/mitkFiberBuilder.cpp rename to Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkFiberBuilder.cpp diff --git a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkFiberBuilder.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkFiberBuilder.h similarity index 94% rename from Modules/DiffusionImaging/Tractography/GibbsTracking/mitkFiberBuilder.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkFiberBuilder.h index 685a521c37..f1294402b4 100644 --- a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkFiberBuilder.h +++ b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkFiberBuilder.h @@ -1,70 +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. ===================================================================*/ #ifndef _BUILDFIBRES #define _BUILDFIBRES // MITK -#include +#include #include // VTK #include #include #include #include #include #include #include using namespace std; namespace mitk { /** * \brief Gnerates actual fiber structure (vtkPolyData) from the particle grid content. */ -class MitkDiffusionImaging_EXPORT FiberBuilder +class FiberTracking_EXPORT FiberBuilder { public: typedef itk::Image ItkFloatImageType; FiberBuilder(ParticleGrid* grid, ItkFloatImageType* image); ~FiberBuilder(); vtkSmartPointer iterate(int minFiberLength); protected: void AddPoint(Particle *dp, vtkSmartPointer container); void LabelPredecessors(Particle* p, int ep, vtkPolyLine* container); void LabelSuccessors(Particle* p, int ep, vtkPolyLine* container); itk::Point m_LastPoint; float m_FiberLength; ItkFloatImageType::Pointer m_Image; ParticleGrid* m_Grid; vtkSmartPointer m_VtkCellArray; vtkSmartPointer m_VtkPoints; }; } #endif diff --git a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkGibbsEnergyComputer.cpp b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkGibbsEnergyComputer.cpp similarity index 99% rename from Modules/DiffusionImaging/Tractography/GibbsTracking/mitkGibbsEnergyComputer.cpp rename to Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkGibbsEnergyComputer.cpp index 8310e5cf48..449a5f75fa 100644 --- a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkGibbsEnergyComputer.cpp +++ b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkGibbsEnergyComputer.cpp @@ -1,213 +1,213 @@ #include #include #include #include -#include +#include #include using namespace mitk; GibbsEnergyComputer::GibbsEnergyComputer(ItkQBallImgType* qballImage, ItkFloatImageType* mask, ParticleGrid* particleGrid, SphereInterpolator* interpolator, ItkRandGenType* randGen) :EnergyComputer(mask, particleGrid, interpolator, randGen) { m_Image = qballImage; } float GibbsEnergyComputer::EvaluateOdf(vnl_vector_fixed& pos, vnl_vector_fixed dir) { const int sampleSteps = 10; // evaluate ODF at 2*sampleSteps+1 positions along dir vnl_vector_fixed samplePos; // current position to evaluate float result = 0; // average of sampled ODF values int xint, yint, zint; // voxel containing samplePos // rotate particle direction according to image rotation dir = m_RotationMatrix*dir; // get interpolation for rotated direction m_SphereInterpolator->getInterpolation(dir); // sample ODF values along particle direction for (int i=-sampleSteps; i <= sampleSteps;i++) { samplePos = pos + (dir * m_ParticleLength) * ((float)i/sampleSteps); if (!m_UseTrilinearInterpolation) // image has not enough slices to use trilinear interpolation { ItkQBallImgType::IndexType index; index[0] = floor(pos[0]/m_Spacing[0]); index[1] = floor(pos[1]/m_Spacing[1]); index[2] = floor(pos[2]/m_Spacing[2]); if (m_Image->GetLargestPossibleRegion().IsInside(index)) { result += (m_Image->GetPixel(index)[m_SphereInterpolator->idx[0]-1]*m_SphereInterpolator->interpw[0] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[1]-1]*m_SphereInterpolator->interpw[1] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[2]-1]* m_SphereInterpolator->interpw[2]); } } else // use trilinear interpolation { float Rx = samplePos[0]/m_Spacing[0]-0.5; float Ry = samplePos[1]/m_Spacing[1]-0.5; float Rz = samplePos[2]/m_Spacing[2]-0.5; xint = floor(Rx); yint = floor(Ry); zint = floor(Rz); if (xint >= 0 && xint < m_Size[0]-1 && yint >= 0 && yint < m_Size[1]-1 && zint >= 0 && zint < m_Size[2]-1) { float xfrac = Rx-xint; float yfrac = Ry-yint; float zfrac = Rz-zint; ItkQBallImgType::IndexType index; float weight; weight = (1-xfrac)*(1-yfrac)*(1-zfrac); index[0] = xint; index[1] = yint; index[2] = zint; result += (m_Image->GetPixel(index)[m_SphereInterpolator->idx[0]-1]*m_SphereInterpolator->interpw[0] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[1]-1]*m_SphereInterpolator->interpw[1] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[2]-1]* m_SphereInterpolator->interpw[2])*weight; weight = (xfrac)*(1-yfrac)*(1-zfrac); index[0] = xint+1; index[1] = yint; index[2] = zint; result += (m_Image->GetPixel(index)[m_SphereInterpolator->idx[0]-1]*m_SphereInterpolator->interpw[0] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[1]-1]*m_SphereInterpolator->interpw[1] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[2]-1]* m_SphereInterpolator->interpw[2])*weight; weight = (1-xfrac)*(yfrac)*(1-zfrac); index[0] = xint; index[1] = yint+1; index[2] = zint; result += (m_Image->GetPixel(index)[m_SphereInterpolator->idx[0]-1]*m_SphereInterpolator->interpw[0] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[1]-1]*m_SphereInterpolator->interpw[1] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[2]-1]* m_SphereInterpolator->interpw[2])*weight; weight = (1-xfrac)*(1-yfrac)*(zfrac); index[0] = xint; index[1] = yint; index[2] = zint+1; result += (m_Image->GetPixel(index)[m_SphereInterpolator->idx[0]-1]*m_SphereInterpolator->interpw[0] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[1]-1]*m_SphereInterpolator->interpw[1] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[2]-1]* m_SphereInterpolator->interpw[2])*weight; weight = (xfrac)*(yfrac)*(1-zfrac); index[0] = xint+1; index[1] = yint+1; index[2] = zint; result += (m_Image->GetPixel(index)[m_SphereInterpolator->idx[0]-1]*m_SphereInterpolator->interpw[0] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[1]-1]*m_SphereInterpolator->interpw[1] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[2]-1]* m_SphereInterpolator->interpw[2])*weight; weight = (1-xfrac)*(yfrac)*(zfrac); index[0] = xint; index[1] = yint+1; index[2] = zint+1; result += (m_Image->GetPixel(index)[m_SphereInterpolator->idx[0]-1]*m_SphereInterpolator->interpw[0] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[1]-1]*m_SphereInterpolator->interpw[1] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[2]-1]* m_SphereInterpolator->interpw[2])*weight; weight = (xfrac)*(1-yfrac)*(zfrac); index[0] = xint+1; index[1] = yint; index[2] = zint+1; result += (m_Image->GetPixel(index)[m_SphereInterpolator->idx[0]-1]*m_SphereInterpolator->interpw[0] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[1]-1]*m_SphereInterpolator->interpw[1] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[2]-1]* m_SphereInterpolator->interpw[2])*weight; weight = (xfrac)*(yfrac)*(zfrac); index[0] = xint+1; index[1] = yint+1; index[2] = zint+1; result += (m_Image->GetPixel(index)[m_SphereInterpolator->idx[0]-1]*m_SphereInterpolator->interpw[0] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[1]-1]*m_SphereInterpolator->interpw[1] + m_Image->GetPixel(index)[m_SphereInterpolator->idx[2]-1]* m_SphereInterpolator->interpw[2])*weight; } } } result /= (2*sampleSteps+1); // average result over taken samples return result; } float GibbsEnergyComputer::ComputeExternalEnergy(vnl_vector_fixed &R, vnl_vector_fixed &N, Particle *dp) { if (SpatProb(R) == 0) // check if position is inside mask return itk::NumericTraits::NonpositiveMin(); float odfVal = EvaluateOdf(R, N); // evaluate ODF in given direction float modelVal = 0; m_ParticleGrid->ComputeNeighbors(R); // retrieve neighbouring particles from particle grid Particle* neighbour = m_ParticleGrid->GetNextNeighbor(); while (neighbour!=NULL) // iterate over nieghbouring particles { if (dp != neighbour) // don't evaluate against itself { // see Reisert et al. "Global Reconstruction of Neuronal Fibers", MICCAI 2009 float dot = fabs(dot_product(N,neighbour->dir)); float bw = mbesseli0(dot); float dpos = (neighbour->pos-R).squared_magnitude(); float w = mexp(dpos*gamma_s); modelVal += w*(bw+m_ParticleChemicalPotential); w = mexp(dpos*gamma_reg_s); } neighbour = m_ParticleGrid->GetNextNeighbor(); } float energy = 2*(odfVal/m_ParticleWeight-modelVal) - (mbesseli0(1.0)+m_ParticleChemicalPotential); return energy*m_ExtStrength; } float GibbsEnergyComputer::ComputeInternalEnergy(Particle *dp) { float energy = 0; if (dp->pID != -1) // has predecessor energy += ComputeInternalEnergyConnection(dp,+1); if (dp->mID != -1) // has successor energy += ComputeInternalEnergyConnection(dp,-1); return energy; } float GibbsEnergyComputer::ComputeInternalEnergyConnection(Particle *p1,int ep1) { Particle *p2 = 0; int ep2; if (ep1 == 1) p2 = m_ParticleGrid->GetParticle(p1->pID); // get predecessor else p2 = m_ParticleGrid->GetParticle(p1->mID); // get successor // check in which direction the connected particle is pointing if (p2->mID == p1->ID) ep2 = -1; else if (p2->pID == p1->ID) ep2 = 1; else std::cout << "EnergyComputer: Connections are inconsistent!" << std::endl; return ComputeInternalEnergyConnection(p1,ep1,p2,ep2); } float GibbsEnergyComputer::ComputeInternalEnergyConnection(Particle *p1,int ep1, Particle *p2, int ep2) { // see Reisert et al. "Global Reconstruction of Neuronal Fibers", MICCAI 2009 if ((dot_product(p1->dir,p2->dir))*ep1*ep2 > -m_CurvatureThreshold) // angle between particles is too sharp return itk::NumericTraits::NonpositiveMin(); // calculate the endpoints of the two particles vnl_vector_fixed endPoint1 = p1->pos + (p1->dir * (m_ParticleLength * ep1)); vnl_vector_fixed endPoint2 = p2->pos + (p2->dir * (m_ParticleLength * ep2)); // check if endpoints are too far apart to connect if ((endPoint1-endPoint2).squared_magnitude() > m_SquaredParticleLength) return itk::NumericTraits::NonpositiveMin(); // calculate center point of the two particles vnl_vector_fixed R = (p2->pos + p1->pos); R *= 0.5; // they are not allowed to connect if the mask image does not allow it if (SpatProb(R) == 0) return itk::NumericTraits::NonpositiveMin(); // get distances of endpoints to center point float norm1 = (endPoint1-R).squared_magnitude(); float norm2 = (endPoint2-R).squared_magnitude(); // calculate actual internal energy float energy = (m_ConnectionPotential-norm1-norm2)*m_IntStrength; return energy; } \ No newline at end of file diff --git a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkGibbsEnergyComputer.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkGibbsEnergyComputer.h similarity index 91% rename from Modules/DiffusionImaging/Tractography/GibbsTracking/mitkGibbsEnergyComputer.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkGibbsEnergyComputer.h index d336f61294..db0335e4fb 100644 --- a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkGibbsEnergyComputer.h +++ b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkGibbsEnergyComputer.h @@ -1,44 +1,44 @@ #ifndef GIBBSENERGYCOMPUTER_H #define GIBBSENERGYCOMPUTER_H -#include +#include #include #include #include #include #include "mitkEnergyComputer.h" using namespace mitk; /** * \brief ODF lookuptable based energy computer. */ -class MitkDiffusionImaging_EXPORT GibbsEnergyComputer : public EnergyComputer +class FiberTracking_EXPORT GibbsEnergyComputer : public EnergyComputer { public: typedef itk::Vector OdfVectorType; typedef itk::Image ItkQBallImgType; typedef itk::Image ItkFloatImageType; typedef itk::Statistics::MersenneTwisterRandomVariateGenerator ItkRandGenType; GibbsEnergyComputer(ItkQBallImgType* qballImage, ItkFloatImageType* mask, ParticleGrid* particleGrid, SphereInterpolator* interpolator, ItkRandGenType* randGen); // external energy calculation float ComputeExternalEnergy(vnl_vector_fixed& R, vnl_vector_fixed& N, Particle* dp); // internal energy calculation float ComputeInternalEnergyConnection(Particle *p1,int ep1); float ComputeInternalEnergyConnection(Particle *p1,int ep1, Particle *p2, int ep2); float ComputeInternalEnergy(Particle *dp); float EvaluateOdf(vnl_vector_fixed& pos, vnl_vector_fixed dir); protected: ItkQBallImgType* m_Image; }; #endif diff --git a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkMetropolisHastingsSampler.cpp b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkMetropolisHastingsSampler.cpp similarity index 100% rename from Modules/DiffusionImaging/Tractography/GibbsTracking/mitkMetropolisHastingsSampler.cpp rename to Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkMetropolisHastingsSampler.cpp diff --git a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkMetropolisHastingsSampler.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkMetropolisHastingsSampler.h similarity index 96% rename from Modules/DiffusionImaging/Tractography/GibbsTracking/mitkMetropolisHastingsSampler.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkMetropolisHastingsSampler.h index c9c15e62d1..11e340cfcd 100644 --- a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkMetropolisHastingsSampler.h +++ b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkMetropolisHastingsSampler.h @@ -1,101 +1,101 @@ /*=================================================================== 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 _SAMPLER #define _SAMPLER // MITK -#include +#include #include #include #include // ITK #include #include // MISC #include namespace mitk { /** * \brief Generates ne proposals of particle configurations. */ -class MitkDiffusionImaging_EXPORT MetropolisHastingsSampler +class FiberTracking_EXPORT MetropolisHastingsSampler { public: typedef itk::Image< float, 3 > ItkFloatImageType; typedef itk::Statistics::MersenneTwisterRandomVariateGenerator ItkRandGenType; MetropolisHastingsSampler(ParticleGrid* grid, EnergyComputer* enComp, ItkRandGenType* randGen, float curvThres); void SetTemperature(float val); void MakeProposal(); int GetNumAcceptedProposals(); void SetProbabilities(float birth, float death, float shift, float optShift, float connect); protected: // connection proposal related methods void ImplementTrack(Track& T); void RemoveAndSaveTrack(EndPoint P); void MakeTrackProposal(EndPoint P); void ComputeEndPointProposalDistribution(EndPoint P); // generate random vectors void DistortVector(float sigma, vnl_vector_fixed& vec); vnl_vector_fixed GetRandomDirection(); ItkRandGenType* m_RandGen; // random generator Track m_ProposalTrack; // stores proposal track Track m_BackupTrack; // stores track removed for new proposal traCK SimpSamp m_SimpSamp; // neighbouring particles and their probabilities for the local tracking float m_InTemp; // simulated annealing temperature float m_ExTemp; // simulated annealing temperature float m_Density; float m_BirthProb; // probability for particle birth float m_DeathProb; // probability for particle death float m_ShiftProb; // probability for particle shift float m_OptShiftProb; // probability for optimal particle shift float m_ConnectionProb; // probability for particle connection proposal float m_Sigma; float m_Gamma; float m_Z; float m_DistanceThreshold; // threshold for maximum distance between connected particles float m_CurvatureThreshold; // threshold for maximum angle between connected particles float m_TractProb; float m_StopProb; float m_DelProb; float m_ParticleLength; float m_ChempotParticle; ParticleGrid* m_ParticleGrid; EnergyComputer* m_EnergyComputer; int m_AcceptedProposals; }; } #endif diff --git a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkParticle.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkParticle.h similarity index 92% rename from Modules/DiffusionImaging/Tractography/GibbsTracking/mitkParticle.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkParticle.h index 2eb79076b9..141c38b20a 100644 --- a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkParticle.h +++ b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkParticle.h @@ -1,76 +1,76 @@ /*=================================================================== 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 _PARTICLE #define _PARTICLE -#include +#include #include namespace mitk { /** * \brief A particle is the basic element of the Gibbs fiber tractography method. */ -class MitkDiffusionImaging_EXPORT Particle +class FiberTracking_EXPORT Particle { public: Particle() { label = 0; pID = -1; mID = -1; } ~Particle() { } vnl_vector_fixed pos; // particle position (world coordinates. corner based voxels. not accounted for image rotation. vnl_vector_fixed dir; // normalized direction vector int gridindex; // index in the grid where it is living int ID; // particle ID int pID; // successor ID int mID; // predecessor ID unsigned char label; // label used in the fiber building process }; -class MitkDiffusionImaging_EXPORT EndPoint +class FiberTracking_EXPORT EndPoint { public: EndPoint() {} EndPoint(Particle *p,int ep) { this->p = p; this->ep = ep; } Particle *p; int ep; inline bool operator==(EndPoint P) { return (P.p == p) && (P.ep == ep); } }; } #endif diff --git a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkParticleGrid.cpp b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkParticleGrid.cpp similarity index 100% rename from Modules/DiffusionImaging/Tractography/GibbsTracking/mitkParticleGrid.cpp rename to Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkParticleGrid.cpp diff --git a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkParticleGrid.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkParticleGrid.h similarity index 95% rename from Modules/DiffusionImaging/Tractography/GibbsTracking/mitkParticleGrid.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkParticleGrid.h index 50619c5552..93030de175 100644 --- a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkParticleGrid.h +++ b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkParticleGrid.h @@ -1,124 +1,124 @@ /*=================================================================== 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 _PARTICLEGRID #define _PARTICLEGRID // MITK -#include "MitkDiffusionImagingExports.h" +#include "FiberTrackingExports.h" #include // ITK #include namespace mitk { /** * \brief Contains and manages particles. */ -class MitkDiffusionImaging_EXPORT ParticleGrid +class FiberTracking_EXPORT ParticleGrid { public: typedef itk::Image< float, 3 > ItkFloatImageType; int m_NumParticles; // number of particles int m_NumConnections; // number of connections int m_NumCellOverflows; // number of cell overflows float m_ParticleLength; ParticleGrid(ItkFloatImageType* image, float particleLength, int cellCapacity); ~ParticleGrid(); Particle* GetParticle(int ID); Particle* NewParticle(vnl_vector_fixed R); bool TryUpdateGrid(int k); void RemoveParticle(int k); void ComputeNeighbors(vnl_vector_fixed &R); Particle* GetNextNeighbor(); void CreateConnection(Particle *P1,int ep1, Particle *P2, int ep2); void DestroyConnection(Particle *P1,int ep1, Particle *P2, int ep2); void DestroyConnection(Particle *P1,int ep1); bool CheckConsistency(); void ResetGrid(); protected: bool ReallocateGrid(); std::vector< Particle* > m_Grid; // the grid std::vector< Particle > m_Particles; // particle container std::vector< int > m_OccupationCount; // number of particles per grid cell int m_ContainerCapacity; // maximal number of particles vnl_vector_fixed< int, 3 > m_GridSize; // grid dimensions vnl_vector_fixed< float, 3 > m_GridScale; // scaling factor for grid int m_CellCapacity; // particle capacity of single cell in grid struct NeighborTracker // to run over the neighbors { std::vector< int > cellidx; std::vector< int > cellidx_c; int cellcnt; int pcnt; } m_NeighbourTracker; }; -class MitkDiffusionImaging_EXPORT Track +class FiberTracking_EXPORT Track { public: std::vector< EndPoint > track; float m_Energy; float m_Probability; int m_Length; Track() { track.resize(1000); } ~Track(){} void clear() { m_Length = 0; m_Energy = 0; m_Probability = 1; } bool isequal(Track& t) { for (int i = 0; i < m_Length;i++) { if (track[i].p != t.track[i].p || track[i].ep != t.track[i].ep) return false; } return true; } }; } #endif diff --git a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkSimpSamp.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkSimpSamp.h similarity index 96% rename from Modules/DiffusionImaging/Tractography/GibbsTracking/mitkSimpSamp.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkSimpSamp.h index 100e259e3b..5bd1f74c62 100644 --- a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkSimpSamp.h +++ b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkSimpSamp.h @@ -1,124 +1,124 @@ /*=================================================================== 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 _SIMPSAMP #define _SIMPSAMP -#include +#include #include #include using namespace std; namespace mitk { /** * \brief Samples new tract from surrounding fiber segments. */ -class MitkDiffusionImaging_EXPORT SimpSamp +class FiberTracking_EXPORT SimpSamp { float *P; int cnt; public: EndPoint* objs; SimpSamp() { P = (float*) malloc(sizeof(float)*1000); objs = (EndPoint*) malloc(sizeof(EndPoint)*1000); } ~SimpSamp() { free(P); free(objs); } inline void clear() { cnt = 1; P[0] = 0; } inline void add(float p, EndPoint obj) { P[cnt] = P[cnt-1] + p; objs[cnt-1] = obj; cnt++; } inline int draw(float prob) { float r = prob*P[cnt-1]; int j; int rl = 1; int rh = cnt-1; while(rh != rl) { j = rl + (rh-rl)/2; if (r < P[j]) { rh = j; continue; } if (r > P[j]) { rl = j+1; continue; } break; } return rh-1; } inline EndPoint drawObj(float prob) { return objs[draw(prob)]; } inline bool isempty() { if (cnt == 1) return true; else return false; } float probFor(int idx) { return (P[idx+1]-P[idx])/P[cnt-1]; } float probFor(EndPoint& t) { for (int i = 1; i< cnt;i++) { if (t == objs[i-1]) return probFor(i-1); } return 0; } }; } #endif diff --git a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkSphereInterpolator.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkSphereInterpolator.h similarity index 99% rename from Modules/DiffusionImaging/Tractography/GibbsTracking/mitkSphereInterpolator.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkSphereInterpolator.h index 1783936787..709e1a25d8 100644 --- a/Modules/DiffusionImaging/Tractography/GibbsTracking/mitkSphereInterpolator.h +++ b/Modules/DiffusionImaging/FiberTracking/Algorithms/GibbsTracking/mitkSphereInterpolator.h @@ -1,338 +1,338 @@ /*=================================================================== 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 _SPHEREINTERPOLATOR #define _SPHEREINTERPOLATOR -#include +#include #include #include #include #include #include #include #include #include using namespace std; /** * \brief Lookuptable based trilinear interpolation of spherically arranged scalar values. */ -class MitkDiffusionImaging_EXPORT SphereInterpolator +class FiberTracking_EXPORT SphereInterpolator { public: int size; // size of LUT int sN; // (sizeofLUT-1)/2 int nverts; // number of data vertices float beta; float inva; float b; bool m_ValidState; vector< float > barycoords; vector< int > indices; vnl_vector_fixed< int, 3 > idx; vnl_vector_fixed< float, 3 > interpw; SphereInterpolator(string lutPath) { m_ValidState = true; if (lutPath.length()==0) { if (!LoadLookuptables()) { m_ValidState = false; return; } } else { if (!LoadLookuptables(lutPath)) { m_ValidState = false; return; } } size = 301; sN = (size-1)/2; nverts = QBALL_ODFSIZE; beta = 0.5; inva = (sqrt(1+beta)-sqrt(beta)); b = 1/(1-sqrt(1/beta + 1)); } inline bool IsInValidState() { return m_ValidState; } ~SphereInterpolator() { } inline void getInterpolation(vnl_vector_fixed N) { float nx = N[0]; float ny = N[1]; float nz = N[2]; if (nz > 0.5) { int x = float2int(nx); int y = float2int(ny); int i = 3*6*(x+y*size); // (:,1,x,y) idx[0] = indices[i]; idx[1] = indices[i+1]; idx[2] = indices[i+2]; interpw[0] = barycoords[i]; interpw[1] = barycoords[i+1]; interpw[2] = barycoords[i+2]; return; } if (nz < -0.5) { int x = float2int(nx); int y = float2int(ny); int i = 3*(1+6*(x+y*size)); // (:,2,x,y) idx[0] = indices[i]; idx[1] = indices[i+1]; idx[2] = indices[i+2]; interpw[0] = barycoords[i]; interpw[1] = barycoords[i+1]; interpw[2] = barycoords[i+2]; return; } if (nx > 0.5) { int z = float2int(nz); int y = float2int(ny); int i = 3*(2+6*(z+y*size)); // (:,2,x,y) idx[0] = indices[i]; idx[1] = indices[i+1]; idx[2] = indices[i+2]; interpw[0] = barycoords[i]; interpw[1] = barycoords[i+1]; interpw[2] = barycoords[i+2]; return; } if (nx < -0.5) { int z = float2int(nz); int y = float2int(ny); int i = 3*(3+6*(z+y*size)); // (:,2,x,y) idx[0] = indices[i]; idx[1] = indices[i+1]; idx[2] = indices[i+2]; interpw[0] = barycoords[i]; interpw[1] = barycoords[i+1]; interpw[2] = barycoords[i+2]; return; } if (ny > 0) { int x = float2int(nx); int z = float2int(nz); int i = 3*(4+6*(x+z*size)); // (:,1,x,y) idx[0] = indices[i]; idx[1] = indices[i+1]; idx[2] = indices[i+2]; interpw[0] = barycoords[i]; interpw[1] = barycoords[i+1]; interpw[2] = barycoords[i+2]; return; } else { int x = float2int(nx); int z = float2int(nz); int i = 3*(5+6*(x+z*size)); // (:,1,x,y) idx[0] = indices[i]; idx[1] = indices[i+1]; idx[2] = indices[i+2]; interpw[0] = barycoords[i]; interpw[1] = barycoords[i+1]; interpw[2] = barycoords[i+2]; return; } } protected: bool LoadLookuptables(string lutPath) { MITK_INFO << "SphereInterpolator: loading lookuptables from custom path: " << lutPath; string path = lutPath; path.append("FiberTrackingLUTBaryCoords.bin"); std::ifstream BaryCoordsStream; BaryCoordsStream.open(path.c_str(), ios::in | ios::binary); MITK_INFO << "SphereInterpolator: 1 " << path; if (BaryCoordsStream.is_open()) { try { float tmp; BaryCoordsStream.seekg (0, ios::beg); MITK_INFO << "SphereInterpolator: 2"; while (!BaryCoordsStream.eof()) { BaryCoordsStream.read((char *)&tmp, sizeof(tmp)); barycoords.push_back(tmp); } MITK_INFO << "SphereInterpolator: 3"; BaryCoordsStream.close(); } catch (const std::exception& e) { MITK_INFO << e.what(); } } else { MITK_INFO << "SphereInterpolator: could not load FiberTrackingLUTBaryCoords.bin from " << path; return false; } MITK_INFO << "SphereInterpolator: first lut loaded successfully"; ifstream IndicesStream; path = lutPath; path.append("FiberTrackingLUTIndices.bin"); IndicesStream.open(path.c_str(), ios::in | ios::binary); MITK_INFO << "SphereInterpolator: 1 " << path; if (IndicesStream.is_open()) { try { int tmp; IndicesStream.seekg (0, ios::beg); MITK_INFO << "SphereInterpolator: 2"; while (!IndicesStream.eof()) { IndicesStream.read((char *)&tmp, sizeof(tmp)); indices.push_back(tmp); } MITK_INFO << "SphereInterpolator: 3"; IndicesStream.close(); } catch (const std::exception& e) { MITK_INFO << e.what(); } } else { MITK_INFO << "SphereInterpolator: could not load FiberTrackingLUTIndices.bin from " << path; return false; } MITK_INFO << "SphereInterpolator: second lut loaded successfully"; return true; } bool LoadLookuptables() { MITK_INFO << "SphereInterpolator: loading lookuptables"; QString applicationDir = QCoreApplication::applicationDirPath(); applicationDir.append("/"); mitk::StandardFileLocations::GetInstance()->AddDirectoryForSearch( applicationDir.toStdString().c_str(), false ); applicationDir.append("../"); mitk::StandardFileLocations::GetInstance()->AddDirectoryForSearch( applicationDir.toStdString().c_str(), false ); applicationDir.append("../../"); mitk::StandardFileLocations::GetInstance()->AddDirectoryForSearch( applicationDir.toStdString().c_str(), false ); applicationDir = QCoreApplication::applicationDirPath(); applicationDir.append("/bin/"); mitk::StandardFileLocations::GetInstance()->AddDirectoryForSearch( applicationDir.toStdString().c_str(), false ); string lutPath = mitk::StandardFileLocations::GetInstance()->FindFile("FiberTrackingLUTBaryCoords.bin"); std::ifstream BaryCoordsStream; BaryCoordsStream.open(lutPath.c_str(), ios::in | ios::binary); if (BaryCoordsStream.is_open()) { try { float tmp; BaryCoordsStream.seekg (0, ios::beg); while (!BaryCoordsStream.eof()) { BaryCoordsStream.read((char *)&tmp, sizeof(tmp)); barycoords.push_back(tmp); } BaryCoordsStream.close(); } catch (const std::exception& e) { MITK_INFO << e.what(); } } else { MITK_INFO << "SphereInterpolator: could not load FiberTrackingLUTBaryCoords.bin from " << lutPath; return false; } ifstream IndicesStream; lutPath = mitk::StandardFileLocations::GetInstance()->FindFile("FiberTrackingLUTIndices.bin"); IndicesStream.open(lutPath.c_str(), ios::in | ios::binary); if (IndicesStream.is_open()) { try { int tmp; IndicesStream.seekg (0, ios::beg); while (!IndicesStream.eof()) { IndicesStream.read((char *)&tmp, sizeof(tmp)); indices.push_back(tmp); } IndicesStream.close(); } catch (const std::exception& e) { MITK_INFO << e.what(); } } else { MITK_INFO << "SphereInterpolator: could not load FiberTrackingLUTIndices.bin from " << lutPath; return false; } return true; } inline float invrescale(float f) { float x = (fabs(f)-b)*inva; if (f>0) return (x*x-beta); else return beta - x*x; } inline int float2int(float x) { return int((invrescale(x)+1)*sN-0.5); } }; #endif diff --git a/Modules/DiffusionImaging/Tractography/StochasticTracking/StochasticTractographyFilter.cxx b/Modules/DiffusionImaging/FiberTracking/Algorithms/StochasticTracking/StochasticTractographyFilter.cxx similarity index 100% rename from Modules/DiffusionImaging/Tractography/StochasticTracking/StochasticTractographyFilter.cxx rename to Modules/DiffusionImaging/FiberTracking/Algorithms/StochasticTracking/StochasticTractographyFilter.cxx diff --git a/Modules/DiffusionImaging/Tractography/StochasticTracking/StochasticTractographyFilter.xml b/Modules/DiffusionImaging/FiberTracking/Algorithms/StochasticTracking/StochasticTractographyFilter.xml similarity index 100% rename from Modules/DiffusionImaging/Tractography/StochasticTracking/StochasticTractographyFilter.xml rename to Modules/DiffusionImaging/FiberTracking/Algorithms/StochasticTracking/StochasticTractographyFilter.xml diff --git a/Modules/DiffusionImaging/Tractography/StochasticTracking/itkSlowPolyLineParametricPath.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/StochasticTracking/itkSlowPolyLineParametricPath.h similarity index 100% rename from Modules/DiffusionImaging/Tractography/StochasticTracking/itkSlowPolyLineParametricPath.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/StochasticTracking/itkSlowPolyLineParametricPath.h diff --git a/Modules/DiffusionImaging/Tractography/StochasticTracking/itkSlowPolyLineParametricPath.txx b/Modules/DiffusionImaging/FiberTracking/Algorithms/StochasticTracking/itkSlowPolyLineParametricPath.txx similarity index 100% rename from Modules/DiffusionImaging/Tractography/StochasticTracking/itkSlowPolyLineParametricPath.txx rename to Modules/DiffusionImaging/FiberTracking/Algorithms/StochasticTracking/itkSlowPolyLineParametricPath.txx diff --git a/Modules/DiffusionImaging/Tractography/StochasticTracking/itkStochasticTractographyFilter_SD.txx b/Modules/DiffusionImaging/FiberTracking/Algorithms/StochasticTracking/itkStochasticTractographyFilter_SD.txx similarity index 100% rename from Modules/DiffusionImaging/Tractography/StochasticTracking/itkStochasticTractographyFilter_SD.txx rename to Modules/DiffusionImaging/FiberTracking/Algorithms/StochasticTracking/itkStochasticTractographyFilter_SD.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkElectrostaticRepulsionDiffusionGradientReductionFilter.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkElectrostaticRepulsionDiffusionGradientReductionFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkElectrostaticRepulsionDiffusionGradientReductionFilter.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkElectrostaticRepulsionDiffusionGradientReductionFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkElectrostaticRepulsionDiffusionGradientReductionFilter.txx b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkElectrostaticRepulsionDiffusionGradientReductionFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkElectrostaticRepulsionDiffusionGradientReductionFilter.txx rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkElectrostaticRepulsionDiffusionGradientReductionFilter.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkFibersFromPlanarFiguresFilter.cpp b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkFibersFromPlanarFiguresFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkFibersFromPlanarFiguresFilter.cpp rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkFibersFromPlanarFiguresFilter.cpp diff --git a/Modules/DiffusionImaging/Algorithms/itkFibersFromPlanarFiguresFilter.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkFibersFromPlanarFiguresFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkFibersFromPlanarFiguresFilter.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkFibersFromPlanarFiguresFilter.h diff --git a/Modules/DiffusionImaging/Tractography/itkGibbsTrackingFilter.cpp b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkGibbsTrackingFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Tractography/itkGibbsTrackingFilter.cpp rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkGibbsTrackingFilter.cpp diff --git a/Modules/DiffusionImaging/Tractography/itkGibbsTrackingFilter.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkGibbsTrackingFilter.h similarity index 100% rename from Modules/DiffusionImaging/Tractography/itkGibbsTrackingFilter.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkGibbsTrackingFilter.h diff --git a/Modules/DiffusionImaging/Tractography/itkStochasticTractographyFilter.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkStochasticTractographyFilter.h similarity index 100% rename from Modules/DiffusionImaging/Tractography/itkStochasticTractographyFilter.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkStochasticTractographyFilter.h diff --git a/Modules/DiffusionImaging/Tractography/itkStochasticTractographyFilter.txx b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkStochasticTractographyFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Tractography/itkStochasticTractographyFilter.txx rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkStochasticTractographyFilter.txx diff --git a/Modules/DiffusionImaging/Tractography/itkStreamlineTrackingFilter.cpp b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkStreamlineTrackingFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Tractography/itkStreamlineTrackingFilter.cpp rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkStreamlineTrackingFilter.cpp diff --git a/Modules/DiffusionImaging/Tractography/itkStreamlineTrackingFilter.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkStreamlineTrackingFilter.h similarity index 99% rename from Modules/DiffusionImaging/Tractography/itkStreamlineTrackingFilter.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkStreamlineTrackingFilter.h index 343cccd962..6a2cbd91f6 100644 --- a/Modules/DiffusionImaging/Tractography/itkStreamlineTrackingFilter.h +++ b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkStreamlineTrackingFilter.h @@ -1,137 +1,137 @@ /*=================================================================== 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. ===================================================================*/ /*=================================================================== This file is based heavily on a corresponding ITK filter. ===================================================================*/ #ifndef __itkStreamlineTrackingFilter_h_ #define __itkStreamlineTrackingFilter_h_ -#include "MitkDiffusionImagingExports.h" +#include "FiberTrackingExports.h" #include #include #include #include #include #include #include #include #include namespace itk{ /** * \brief Performes deterministic streamline tracking on the input tensor image. */ template< class TTensorPixelType, class TPDPixelType=double> class StreamlineTrackingFilter : public ImageToImageFilter< Image< DiffusionTensor3D, 3 >, Image< Vector< TPDPixelType, 3 >, 3 > > { public: typedef StreamlineTrackingFilter Self; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; typedef ImageToImageFilter< Image< DiffusionTensor3D, 3 >, Image< Vector< TPDPixelType, 3 >, 3 > > Superclass; /** Method for creation through the object factory. */ itkNewMacro(Self) /** Runtime information support. */ itkTypeMacro(StreamlineTrackingFilter, ImageToImageFilter) typedef TTensorPixelType TensorComponentType; typedef TPDPixelType DirectionPixelType; typedef typename Superclass::InputImageType InputImageType; typedef typename Superclass::OutputImageType OutputImageType; typedef typename Superclass::OutputImageRegionType OutputImageRegionType; typedef itk::Image ItkUcharImgType; typedef itk::Image ItkFloatImgType; typedef itk::Image< vnl_vector_fixed, 3> ItkPDImgType; typedef vtkSmartPointer< vtkPolyData > FiberPolyDataType; itkGetMacro( FiberPolyData, FiberPolyDataType ) itkSetMacro( SeedImage, ItkUcharImgType::Pointer) itkSetMacro( MaskImage, ItkUcharImgType::Pointer) itkSetMacro( SeedsPerVoxel, int) itkSetMacro( FaThreshold, float) itkSetMacro( StepSize, float) itkSetMacro( F, float ) itkSetMacro( G, float ) itkSetMacro( Interpolate, bool ) itkSetMacro( MinTractLength, float ) itkGetMacro( MinTractLength, float ) itkSetMacro( MinCurvatureRadius, float ) itkGetMacro( MinCurvatureRadius, float ) protected: StreamlineTrackingFilter(); ~StreamlineTrackingFilter() {} void PrintSelf(std::ostream& os, Indent indent) const; void CalculateNewPosition(itk::ContinuousIndex& pos, vnl_vector_fixed& dir, typename InputImageType::IndexType& index); float FollowStreamline(itk::ContinuousIndex pos, int dirSign, vtkPoints* points, std::vector< vtkIdType >& ids); bool IsValidPosition(itk::ContinuousIndex& pos, typename InputImageType::IndexType& index, vnl_vector_fixed< float, 8 >& interpWeights); double RoundToNearest(double num); void BeforeThreadedGenerateData(); void ThreadedGenerateData( const OutputImageRegionType &outputRegionForThread, int threadId); void AfterThreadedGenerateData(); FiberPolyDataType AddPolyData(FiberPolyDataType poly1, FiberPolyDataType poly2); FiberPolyDataType m_FiberPolyData; vtkSmartPointer m_Points; vtkSmartPointer m_Cells; ItkFloatImgType::Pointer m_EmaxImage; ItkFloatImgType::Pointer m_FaImage; ItkPDImgType::Pointer m_PdImage; typename InputImageType::Pointer m_InputImage; float m_FaThreshold; float m_MinCurvatureRadius; float m_StepSize; int m_MaxLength; float m_MinTractLength; int m_SeedsPerVoxel; float m_F; float m_G; std::vector< int > m_ImageSize; std::vector< float > m_ImageSpacing; ItkUcharImgType::Pointer m_SeedImage; ItkUcharImgType::Pointer m_MaskImage; bool m_Interpolate; float m_PointPistance; itk::VectorContainer< int, FiberPolyDataType >::Pointer m_PolyDataContainer; private: }; } #ifndef ITK_MANUAL_INSTANTIATION #include "itkStreamlineTrackingFilter.cpp" #endif #endif //__itkStreamlineTrackingFilter_h_ diff --git a/Modules/DiffusionImaging/Algorithms/itkTractDensityImageFilter.cpp b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractDensityImageFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTractDensityImageFilter.cpp rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractDensityImageFilter.cpp diff --git a/Modules/DiffusionImaging/Algorithms/itkTractDensityImageFilter.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractDensityImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTractDensityImageFilter.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractDensityImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkTractsToDWIImageFilter.cpp b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractsToDWIImageFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTractsToDWIImageFilter.cpp rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractsToDWIImageFilter.cpp diff --git a/Modules/DiffusionImaging/Algorithms/itkTractsToDWIImageFilter.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractsToDWIImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTractsToDWIImageFilter.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractsToDWIImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkTractsToFiberEndingsImageFilter.cpp b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractsToFiberEndingsImageFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTractsToFiberEndingsImageFilter.cpp rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractsToFiberEndingsImageFilter.cpp diff --git a/Modules/DiffusionImaging/Algorithms/itkTractsToFiberEndingsImageFilter.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractsToFiberEndingsImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTractsToFiberEndingsImageFilter.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractsToFiberEndingsImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkTractsToRgbaImageFilter.cpp b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractsToRgbaImageFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTractsToRgbaImageFilter.cpp rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractsToRgbaImageFilter.cpp diff --git a/Modules/DiffusionImaging/Algorithms/itkTractsToRgbaImageFilter.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractsToRgbaImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTractsToRgbaImageFilter.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractsToRgbaImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkTractsToVectorImageFilter.cpp b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractsToVectorImageFilter.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTractsToVectorImageFilter.cpp rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractsToVectorImageFilter.cpp diff --git a/Modules/DiffusionImaging/Algorithms/itkTractsToVectorImageFilter.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractsToVectorImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkTractsToVectorImageFilter.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/itkTractsToVectorImageFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/mitkTractAnalyzer.cpp b/Modules/DiffusionImaging/FiberTracking/Algorithms/mitkTractAnalyzer.cpp similarity index 100% rename from Modules/DiffusionImaging/Algorithms/mitkTractAnalyzer.cpp rename to Modules/DiffusionImaging/FiberTracking/Algorithms/mitkTractAnalyzer.cpp diff --git a/Modules/DiffusionImaging/Algorithms/mitkTractAnalyzer.h b/Modules/DiffusionImaging/FiberTracking/Algorithms/mitkTractAnalyzer.h similarity index 88% rename from Modules/DiffusionImaging/Algorithms/mitkTractAnalyzer.h rename to Modules/DiffusionImaging/FiberTracking/Algorithms/mitkTractAnalyzer.h index 4ba41facc3..ccedb1ce6b 100644 --- a/Modules/DiffusionImaging/Algorithms/mitkTractAnalyzer.h +++ b/Modules/DiffusionImaging/FiberTracking/Algorithms/mitkTractAnalyzer.h @@ -1,149 +1,155 @@ /*=================================================================== 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. ===================================================================*/ /*=================================================================== This file is based heavily on a corresponding ITK filter. ===================================================================*/ #ifndef __mitkTractAnalyzer_h_ #define __mitkTractAnalyzer_h_ -#include "MitkDiffusionImagingExports.h" +#include "FiberTrackingExports.h" #include -#include +#include +#include "mitkImage.h" +#include "mitkImageCast.h" + +//#include namespace mitk{ /** \class TractAnalyzer */ -class MitkDiffusionImaging_EXPORT TractAnalyzer +class FiberTracking_EXPORT TractAnalyzer { public: TractAnalyzer(); ~TractAnalyzer() {}; typedef itk::Image CharImageType; typedef itk::Image FloatImageType; typedef itk::Image ProjectionsImageType; typedef itk::VectorImage VectorImageType; /* void SetSkeleton(CharImageType::Pointer skeleton) { m_Skeleton = skeleton; } void SetMeanSkeleton(FloatImageType::Pointer i) { m_MeanSkeleton = i; }*/ + /* Unused method - would introduce circular dependency to the new module structure + * of the diffusion imaging void SetTbssImage(mitk::TbssImage::Pointer tbssImg) { m_TbssImage = tbssImg; - } + }*/ void SetProjections(ProjectionsImageType::Pointer projections) { m_Projections = projections; } void BuildGraph(itk::Index<3> startPoint, itk::Index<3> endPoint); std::vector< itk::Index<3> > GetPath() { return m_Path; } void SetFileName(std::string fname) { m_FileName = fname; } void SetFileNameLong(std::string fname) { m_FileNameLong = fname; } void SetRoi(std::vector< itk::Index<3> > roi) { m_Roi = roi; } CharImageType::Pointer GetRoiImage() { return m_RoiImg; } void SetGroups(std::vector< std::pair > groups) { m_Groups = groups; } void MeasureRoi(); void SetInputImage(mitk::Image::Pointer inputImage) { m_InputImage = inputImage; } void SetThreshold(double threshold) { m_Threshold = threshold; } protected: //CharImageType::Pointer m_Skeleton; CharImageType::Pointer m_RoiImg; ProjectionsImageType::Pointer m_Projections; //FloatImageType::Pointer m_MeanSkeleton; - mitk::TbssImage::Pointer m_TbssImage; + //mitk::TbssImage::Pointer m_TbssImage; mitk::Image::Pointer m_InputImage; double m_Threshold; std::vector< itk::Index<3> > m_Path; std::string m_FileName; std::string m_FileNameLong; // For the regression analysis 'friendly' file std::vector< std::pair > m_Groups; std::vector< itk::Index<3> > m_Roi; private: }; } #endif //__itkTractAnalyzer_h_ diff --git a/Modules/DiffusionImaging/FiberTracking/CMakeLists.txt b/Modules/DiffusionImaging/FiberTracking/CMakeLists.txt new file mode 100644 index 0000000000..261cd51200 --- /dev/null +++ b/Modules/DiffusionImaging/FiberTracking/CMakeLists.txt @@ -0,0 +1,13 @@ +MITK_CREATE_MODULE( FiberTracking + INCLUDE_DIRS Algorithms Algorithms/GibbsTracking Algorithms/StochasticTracking IODataStructures IODataStructures/FiberBundleX IODataStructures/PlanarFigureComposite Interactions SignalModels Rendering ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS DiffusionCore MitkGraphAlgorithms +) + +if(FiberTracking_IS_ENABLED) + file(DOWNLOAD http://mitk.org/download/data/FibertrackingLUT.tar.gz ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/FibertrackingLUT.tar.gz TIMEOUT 10) + execute_process(COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} tar xzf FibertrackingLUT.tar.gz) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Rendering/mitkShaderFiberClipping.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mitkShaderFiberClipping.xml) + MITK_INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mitkShaderFiberClipping.xml ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/FiberTrackingLUTBaryCoords.bin ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/FiberTrackingLUTIndices.bin) +endif() + +add_subdirectory(Testing) \ No newline at end of file diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleX.cpp b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleX.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleX.cpp rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleX.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleX.h b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleX.h similarity index 97% rename from Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleX.h rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleX.h index 45ce4a1dad..17742d09c8 100644 --- a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleX.h +++ b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleX.h @@ -1,154 +1,154 @@ /*=================================================================== 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_FiberBundleX_H #define _MITK_FiberBundleX_H //includes for MITK datastructure #include -#include "MitkDiffusionImagingExports.h" +#include "FiberTrackingExports.h" #include //includes storing fiberdata #include //may be replaced by class precompile argument #include // may be replaced by class #include // my be replaced by class #include #include #include namespace mitk { /** * \brief Base Class for Fiber Bundles; */ -class MitkDiffusionImaging_EXPORT FiberBundleX : public BaseData +class FiberTracking_EXPORT FiberBundleX : public BaseData { public: // fiber colorcodings static const char* COLORCODING_ORIENTATION_BASED; static const char* COLORCODING_FA_BASED; static const char* COLORCODING_CUSTOM; static const char* FIBER_ID_ARRAY; virtual void UpdateOutputInformation(); virtual void SetRequestedRegionToLargestPossibleRegion(); virtual bool RequestedRegionIsOutsideOfTheBufferedRegion(); virtual bool VerifyRequestedRegion(); virtual void SetRequestedRegion( itk::DataObject *data ); mitkClassMacro( FiberBundleX, BaseData ) itkNewMacro( Self ) mitkNewMacro1Param(Self, vtkSmartPointer) // custom constructor // colorcoding related methods void SetColorCoding(const char*); void SetFAMap(mitk::Image::Pointer); void DoColorCodingOrientationBased(); void DoColorCodingFaBased(); void DoUseFaFiberOpacity(); void ResetFiberOpacity(); // fiber smoothing/resampling void ResampleFibers(float pointDistance = 1); void DoFiberSmoothing(int pointsPerCm); void DoFiberSmoothing(int pointsPerCm, double tension, double continuity, double bias ); bool RemoveShortFibers(float lengthInMM); bool RemoveLongFibers(float lengthInMM); bool ApplyCurvatureThreshold(float minRadius, bool deleteFibers); void MirrorFibers(unsigned int axis); void RotateAroundAxis(double x, double y, double z); void TranslateFibers(double x, double y, double z); // add/subtract fibers FiberBundleX::Pointer AddBundle(FiberBundleX* fib); FiberBundleX::Pointer SubtractBundle(FiberBundleX* fib); // fiber subset extraction FiberBundleX::Pointer ExtractFiberSubset(PlanarFigure *pf); std::vector ExtractFiberIdSubset(PlanarFigure* pf); vtkSmartPointer GeneratePolyDataByIds( std::vector ); // TODO: make protected void GenerateFiberIds(); // TODO: make protected // get/set data void SetFiberPolyData(vtkSmartPointer, bool updateGeometry = true); vtkSmartPointer GetFiberPolyData(); QStringList GetAvailableColorCodings(); char* GetCurrentColorCoding(); itkGetMacro( NumFibers, int) itkGetMacro( FiberSampling, int) itkGetMacro( MinFiberLength, float ) itkGetMacro( MaxFiberLength, float ) itkGetMacro( MeanFiberLength, float ) itkGetMacro( MedianFiberLength, float ) itkGetMacro( LengthStDev, float ) std::vector GetPointsRoi() { return m_PointsRoi; } // copy fiber bundle mitk::FiberBundleX::Pointer GetDeepCopy(); // compare fiber bundles bool Equals(FiberBundleX* fib); protected: FiberBundleX( vtkPolyData* fiberPolyData = NULL ); virtual ~FiberBundleX(); itk::Point GetItkPoint(double point[3]); // calculate geometry from fiber extent void UpdateFiberGeometry(); // calculate colorcoding values according to m_CurrentColorCoding void UpdateColorCoding(); private: // actual fiber container vtkSmartPointer m_FiberPolyData; // contains fiber ids vtkSmartPointer m_FiberIdDataSet; char* m_CurrentColorCoding; int m_NumFibers; std::vector< float > m_FiberLengths; float m_MinFiberLength; float m_MaxFiberLength; float m_MeanFiberLength; float m_MedianFiberLength; float m_LengthStDev; int m_FiberSampling; std::vector m_PointsRoi; // this global variable needs to be refactored }; } // namespace mitk #endif /* _MITK_FiberBundleX_H */ diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXIOFactory.cpp b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXIOFactory.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXIOFactory.cpp rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXIOFactory.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXIOFactory.h b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXIOFactory.h similarity index 94% rename from Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXIOFactory.h rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXIOFactory.h index ff0f548eef..fa7f1af7a0 100644 --- a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXIOFactory.h +++ b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXIOFactory.h @@ -1,75 +1,75 @@ /*=================================================================== 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_FIBER_BUNDLEX_IO_FACTORY_H_HEADER__ #define __MITK_FIBER_BUNDLEX_IO_FACTORY_H_HEADER__ #ifdef _MSC_VER #pragma warning ( disable : 4786 ) #endif #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" -#include "MitkDiffusionImagingExports.h" +#include "FiberTrackingExports.h" //NOTE>umbenennen in internal FiberBundleIOFactory namespace mitk { //##Documentation //## @brief Create instances of NrrdQBallImageReader objects using an object factory. //## //## @ingroup IO -class MitkDiffusionImaging_EXPORT FiberBundleXIOFactory : public itk::ObjectFactoryBase +class FiberTracking_EXPORT FiberBundleXIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ typedef FiberBundleXIOFactory Self; typedef itk::ObjectFactoryBase Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); static FiberBundleXIOFactory* FactoryNew() { return new FiberBundleXIOFactory;} /** Run-time type information (and related methods). */ itkTypeMacro(FiberBundleXIOFactory, ObjectFactoryBase); /** Register one factory of this type */ static void RegisterOneFactory(void) { FiberBundleXIOFactory::Pointer FiberBundleXIOFactory = FiberBundleXIOFactory::New(); ObjectFactoryBase::RegisterFactory(FiberBundleXIOFactory); } protected: FiberBundleXIOFactory(); ~FiberBundleXIOFactory(); private: FiberBundleXIOFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif // __MITK_FIBER_BUNDLE_IO_FACTORY_H_HEADER__ diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXReader.cpp b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXReader.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXReader.cpp rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXReader.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXReader.h b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXReader.h similarity index 93% rename from Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXReader.h rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXReader.h index 0b87169bda..3fcfe85c40 100644 --- a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXReader.h +++ b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXReader.h @@ -1,77 +1,77 @@ /*=================================================================== 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 __mitkFiberBundleXReader_h #define __mitkFiberBundleXReader_h #include #include #include #include -#include +#include namespace mitk { /** \brief */ - class MitkDiffusionImaging_EXPORT FiberBundleXReader : public FileReader, public BaseProcess + class FiberTracking_EXPORT FiberBundleXReader : public FileReader, public BaseProcess { public: /** Types for the standardized TractContainer **/ /* direct linked includes of mitkFiberBundleX DataStructure */ typedef mitk::FiberBundleX OutputType; mitkClassMacro( FiberBundleXReader, BaseProcess ); itkNewMacro(Self); const char* GetFileName() const; void SetFileName(const char* aFileName); const char* GetFilePrefix() const; void SetFilePrefix(const char* aFilePrefix); const char* GetFilePattern() const; void SetFilePattern(const char* aFilePattern); static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern); // itkGetMacro(GroupFiberBundleX, FiberGroupType::Pointer); // itkGetMacro(TractContainer, ContainerType::Pointer); virtual void Update(); protected: /** Does the real work. */ virtual void GenerateData(); virtual void GenerateOutputInformation(); OutputType::Pointer m_OutputCache; std::string m_FileName; std::string m_FilePrefix; std::string m_FilePattern; private: void operator=(const Self&); //purposely not implemented }; } //namespace MITK #endif // __mitkFiberBundleXReader_h diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXSerializer.cpp b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXSerializer.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXSerializer.cpp rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXSerializer.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXSerializer.h b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXSerializer.h similarity index 88% rename from Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXSerializer.h rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXSerializer.h index 5798c7d960..ef5838ccd2 100644 --- a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXSerializer.h +++ b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXSerializer.h @@ -1,39 +1,39 @@ /*=================================================================== 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 mitkFiberBundleXSerializer_h_included #define mitkFiberBundleXSerializer_h_included -#include "MitkDiffusionImagingExports.h" +#include "FiberTrackingExports.h" #include "mitkBaseDataSerializer.h" namespace mitk { /** \brief Serializes mitk::Surface for mitk::SceneIO */ -class MitkDiffusionImaging_EXPORT FiberBundleXSerializer : public BaseDataSerializer +class FiberTracking_EXPORT FiberBundleXSerializer : public BaseDataSerializer { public: mitkClassMacro( FiberBundleXSerializer, BaseDataSerializer ); itkNewMacro(Self); virtual std::string Serialize(); protected: FiberBundleXSerializer(); virtual ~FiberBundleXSerializer(); }; } // namespace #endif diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXSource.cpp b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXSource.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXSource.cpp rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXSource.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXSource.h b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXSource.h similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXSource.h rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXSource.h diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXThreadMonitor.cpp b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXThreadMonitor.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXThreadMonitor.cpp rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXThreadMonitor.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXThreadMonitor.h b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXThreadMonitor.h similarity index 97% rename from Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXThreadMonitor.h rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXThreadMonitor.h index fe62b90d20..208d9d8acd 100644 --- a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXThreadMonitor.h +++ b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXThreadMonitor.h @@ -1,153 +1,153 @@ /*=================================================================== 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_FiberBundleXThreadMonitor_H #define _MITK_FiberBundleXThreadMonitor_H //includes for MITK datastructure #include "mitkBaseData.h" -#include "MitkDiffusionImagingExports.h" +#include "FiberTrackingExports.h" #include #include namespace mitk { /** * \brief Base Class for Fiber Bundles; */ - class MitkDiffusionImaging_EXPORT FiberBundleXThreadMonitor : public BaseData + class FiberTracking_EXPORT FiberBundleXThreadMonitor : public BaseData { public: // ======virtual methods must have====== virtual void UpdateOutputInformation(); virtual void SetRequestedRegionToLargestPossibleRegion(); virtual bool RequestedRegionIsOutsideOfTheBufferedRegion(); virtual bool VerifyRequestedRegion(); virtual void SetRequestedRegion( itk::DataObject *data ); //======================================= mitkClassMacro( FiberBundleXThreadMonitor, BaseData ); itkNewMacro( Self ); void setTextL1(QString); QString getTextL1(); QString getBracketOpen(); mitk::Point2D getBracketOpenPosition(); void setBracketOpenPosition(mitk::Point2D); int getBracketOpenOpacity(); // range 0 - 10, multiplicationfactor 0.1 (in mapper) QString getBracketClose(); mitk::Point2D getBracketClosePosition(); void setBracketClosePosition(mitk::Point2D); int getBracketCloseOpacity(); // range 0 - 10, multiplicationfactor 0.1 (in mapper) QString getHeading(); mitk::Point2D getHeadingPosition(); void setHeadingPosition(mitk::Point2D); int getHeadingOpacity(); // range 0 - 10, multiplicationfactor 0.1 (in mapper) void setHeadingOpacity(int); QString getMask(); mitk::Point2D getMaskPosition(); void setMaskPosition(mitk::Point2D); int getMaskOpacity(); // multiplicationfactor 0.1 (in mapper) void setMaskOpacity(int); QString getStatus(); void setStatus(QString); mitk::Point2D getStatusPosition(); void setStatusPosition(mitk::Point2D); int getStatusOpacity(); // multiplicationfactor 0.1 (in mapper) void setStatusOpacity(int); int getStarted(); void setStarted(int); mitk::Point2D getStartedPosition(); void setStartedPosition(mitk::Point2D); int getStartedOpacity(); // multiplicationfactor 0.1 (in mapper) void setStartedOpacity(int); int getFinished(); void setFinished(int); mitk::Point2D getFinishedPosition(); void setFinishedPosition(mitk::Point2D); int getFinishedOpacity(); // multiplicationfactor 0.1 (in mapper) void setFinishedOpacity(int); int getTerminated(); void setTerminated(int); mitk::Point2D getTerminatedPosition(); void setTerminatedPosition(mitk::Point2D); int getTerminatedOpacity(); // multiplicationfactor 0.1 (in mapper) void setTerminatedOpacity(int); protected: FiberBundleXThreadMonitor(); virtual ~FiberBundleXThreadMonitor(); private: QString m_monitorBracketOpen; mitk::Point2D m_monitorBracketOpenPosition; QString m_monitorBracketClose; mitk::Point2D m_monitorBracketClosePosition; QString m_monitorHeading; mitk::Point2D m_monitorHeadingPosition; int m_monitorHeadingOpacity; QString m_monitorMask; mitk::Point2D m_monitorMaskPosition; int m_monitorMaskOpacity; QString m_monitorStatus; mitk::Point2D m_monitorStatusPosition; int m_monitorStatusOpacity; int m_monitorStarted; mitk::Point2D m_monitorStartedPosition; int m_monitorStartedOpacity; int m_monitorFinished; mitk::Point2D m_monitorFinishedPosition; int m_monitorFinishedOpacity; int m_monitorTerminated; mitk::Point2D m_monitorTerminatedPosition; int m_monitorTerminatedOpacity; QMutex m_startedMutex; QMutex m_finishedMutex; QMutex m_terminatedMutex; QMutex m_statusMutex; }; } // namespace mitk #endif /* _MITK_FiberBundleX_H */ diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXWriter.cpp b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXWriter.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXWriter.cpp rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXWriter.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXWriter.h b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXWriter.h similarity index 97% rename from Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXWriter.h rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXWriter.h index d73d895110..ae436596a2 100644 --- a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXWriter.h +++ b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXWriter.h @@ -1,216 +1,216 @@ /*=================================================================== 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 __mitkFiberBundleXWriter_h #define __mitkFiberBundleXWriter_h #include #include #include "mitkFiberBundleX.h" #include -#include +#include namespace mitk { /** * Writes fiber bundles to a file * @ingroup Process */ -class MitkDiffusionImaging_EXPORT FiberBundleXWriter : public mitk::FileWriterWithInformation +class FiberTracking_EXPORT FiberBundleXWriter : public mitk::FileWriterWithInformation { public: mitkClassMacro( FiberBundleXWriter, mitk::FileWriterWithInformation ); itkNewMacro( Self ); //mitkWriterMacro; virtual void Write() { if ( this->GetInput() == NULL ) { itkExceptionMacro(<<"Write:Please specify an input!"); return; } /* Fill in image information.*/ this->UpdateOutputInformation(); (*(this->GetInputs().begin()))->SetRequestedRegionToLargestPossibleRegion(); this->PropagateRequestedRegion(NULL); this->UpdateOutputData(NULL); } virtual void Update() { Write(); } typedef mitk::FiberBundleX InputType; /** * Sets the filename of the file to write. * @param FileName the name of the file to write. */ itkSetStringMacro( FileName ); /** * @returns the name of the file to be written to disk. */ itkGetStringMacro( FileName ); /** * @warning multiple write not (yet) supported */ itkSetStringMacro( FilePrefix ); /** * @warning multiple write not (yet) supported */ itkGetStringMacro( FilePrefix ); /** * @warning multiple write not (yet) supported */ itkSetStringMacro( FilePattern ); /** * @warning multiple write not (yet) supported */ itkGetStringMacro( FilePattern ); /** * Sets the input object for the filter. * @param input the diffusion volumes to write to file. */ void SetInputFiberBundleX( InputType* input ); /** * @returns the 0'th input object of the filter. */ InputType* GetInput(); /** * Returns false if an error happened during writing */ itkGetMacro( Success, bool ); /** * @return possible file extensions for the data type associated with the writer */ virtual std::vector GetPossibleFileExtensions(); // FileWriterWithInformation methods virtual const char * GetDefaultFilename() { return "FiberBundle.fib"; } virtual const char * GetFileDialogPattern() { return "Fiber Bundle (*.fib *.vtk)"; } virtual const char * GetDefaultExtension() { return ".fib"; } virtual bool CanWriteBaseDataType(BaseData::Pointer data) { return (dynamic_cast(data.GetPointer()) != NULL); }; virtual void DoWrite(BaseData::Pointer data) { if (CanWriteBaseDataType(data)) { this->SetInputFiberBundleX(dynamic_cast(data.GetPointer())); this->Update(); } }; static const char* XML_GEOMETRY; static const char* XML_MATRIX_XX; static const char* XML_MATRIX_XY; static const char* XML_MATRIX_XZ; static const char* XML_MATRIX_YX; static const char* XML_MATRIX_YY; static const char* XML_MATRIX_YZ; static const char* XML_MATRIX_ZX; static const char* XML_MATRIX_ZY; static const char* XML_MATRIX_ZZ; static const char* XML_ORIGIN_X; static const char* XML_ORIGIN_Y; static const char* XML_ORIGIN_Z; static const char* XML_SPACING_X; static const char* XML_SPACING_Y; static const char* XML_SPACING_Z; static const char* XML_SIZE_X; static const char* XML_SIZE_Y; static const char* XML_SIZE_Z; static const char* XML_FIBER_BUNDLE; static const char* XML_FIBER; static const char* XML_PARTICLE; static const char* XML_ID; static const char* XML_POS_X; static const char* XML_POS_Y; static const char* XML_POS_Z; static const char* VERSION_STRING; static const char* XML_FIBER_BUNDLE_FILE; static const char* XML_FILE_VERSION; static const char* XML_NUM_FIBERS; static const char* XML_NUM_PARTICLES; static const char* ASCII_FILE; static const char* FILE_NAME; protected: FiberBundleXWriter(); virtual ~FiberBundleXWriter(); virtual void GenerateData(); std::string m_FileName; std::string m_FilePrefix; std::string m_FilePattern; bool m_Success; }; } // end of namespace mitk #endif //__mitkFiberBundleXWriter_h diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXWriterFactory.cpp b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXWriterFactory.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXWriterFactory.cpp rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXWriterFactory.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXWriterFactory.h b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXWriterFactory.h similarity index 92% rename from Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXWriterFactory.h rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXWriterFactory.h index cdbfa3a7f8..a0ab485fb6 100644 --- a/Modules/DiffusionImaging/IODataStructures/FiberBundleX/mitkFiberBundleXWriterFactory.h +++ b/Modules/DiffusionImaging/FiberTracking/IODataStructures/FiberBundleX/mitkFiberBundleXWriterFactory.h @@ -1,67 +1,67 @@ /*=================================================================== 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 FIBERBUNDLEX_WRITERFACTORY_H_HEADER_INCLUDED #define FIBERBUNDLEX_WRITERFACTORY_H_HEADER_INCLUDED #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" -#include "MitkDiffusionImagingExports.h" +#include "FiberTrackingExports.h" namespace mitk { -class MitkDiffusionImaging_EXPORT FiberBundleXWriterFactory : public itk::ObjectFactoryBase +class FiberTracking_EXPORT FiberBundleXWriterFactory : public itk::ObjectFactoryBase { public: mitkClassMacro( mitk::FiberBundleXWriterFactory, itk::ObjectFactoryBase ) /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); /** Register one factory of this type */ static void RegisterOneFactory(void) { static bool IsRegistered = false; if ( !IsRegistered ) { FiberBundleXWriterFactory::Pointer ugVtkWriterFactory = FiberBundleXWriterFactory::New(); ObjectFactoryBase::RegisterFactory( ugVtkWriterFactory ); IsRegistered = true; } } protected: FiberBundleXWriterFactory(); ~FiberBundleXWriterFactory(); private: FiberBundleXWriterFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif // FiberBundleX_WRITERFACTORY_H_HEADER_INCLUDED diff --git a/Modules/DiffusionImaging/IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.cpp b/Modules/DiffusionImaging/FiberTracking/IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.cpp rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.h b/Modules/DiffusionImaging/FiberTracking/IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.h similarity index 96% rename from Modules/DiffusionImaging/IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.h rename to Modules/DiffusionImaging/FiberTracking/IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.h index 3d48c39470..1f511228bb 100644 --- a/Modules/DiffusionImaging/IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.h +++ b/Modules/DiffusionImaging/FiberTracking/IODataStructures/PlanarFigureComposite/mitkPlanarFigureComposite.h @@ -1,125 +1,125 @@ /*=================================================================== 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. ===================================================================*/ /* * 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 "MitkDiffusionImagingExports.h" +#include "FiberTrackingExports.h" #include "mitkPlanarFigure.h" #include "itkVectorContainer.h" #include "mitkDataNode.h" namespace mitk { enum PFCompositionOperation { PFCOMPOSITION_AND_OPERATION, PFCOMPOSITION_OR_OPERATION, PFCOMPOSITION_NOT_OPERATION, }; - class MitkDiffusionImaging_EXPORT PlanarFigureComposite : public PlanarFigure + class FiberTracking_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/FiberTracking/IODataStructures/mitkFiberTrackingObjectFactory.cpp b/Modules/DiffusionImaging/FiberTracking/IODataStructures/mitkFiberTrackingObjectFactory.cpp new file mode 100644 index 0000000000..7ff0166236 --- /dev/null +++ b/Modules/DiffusionImaging/FiberTracking/IODataStructures/mitkFiberTrackingObjectFactory.cpp @@ -0,0 +1,124 @@ +#include "mitkFiberTrackingObjectFactory.h" + + +mitk::FiberTrackingObjectFactory::FiberTrackingObjectFactory(bool /*registerSelf*/) + :CoreObjectFactoryBase() +{ + + static bool alreadyDone = false; + if (!alreadyDone) + { + MITK_DEBUG << "FiberTrackingObjectFactory c'tor" << std::endl; + RegisterIOFactories(); + + mitk::FiberBundleXIOFactory::RegisterOneFactory(); //modernized + + mitk::FiberBundleXWriterFactory::RegisterOneFactory();//modernized + + m_FileWriters.push_back( mitk::FiberBundleXWriter::New().GetPointer() );//modernized + + mitk::CoreObjectFactory::GetInstance()->RegisterExtraFactory(this); + CreateFileExtensionsMap(); + + alreadyDone = true; + } + +} + +mitk::Mapper::Pointer mitk::FiberTrackingObjectFactory::CreateMapper(mitk::DataNode* node, MapperSlotId id) +{ + mitk::Mapper::Pointer newMapper=NULL; + + if ( id == mitk::BaseRenderer::Standard2D ) + { + std::string classname("FiberBundleX"); + if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) + { + newMapper = mitk::FiberBundleXMapper2D::New(); + newMapper->SetDataNode(node); + } + + } + else if ( id == mitk::BaseRenderer::Standard3D ) + { + std::string classname("FiberBundleX"); + if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) + { + newMapper = mitk::FiberBundleXMapper3D::New(); + newMapper->SetDataNode(node); + } + + classname = "FiberBundleXThreadMonitor"; + if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) + { + newMapper = mitk::FiberBundleXThreadMonitorMapper3D::New(); + newMapper->SetDataNode(node); + } + } + + return newMapper; +} + +void mitk::FiberTrackingObjectFactory::SetDefaultProperties(mitk::DataNode* node) +{ + std::string classname("FiberBundleX"); + if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) + { + mitk::FiberBundleXMapper3D::SetDefaultProperties(node); + mitk::FiberBundleXMapper2D::SetDefaultProperties(node); + } + + classname = "FiberBundleXThreadMonitor"; + if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) + { + mitk::FiberBundleXThreadMonitorMapper3D::SetDefaultProperties(node); + } +} + +const char* mitk::FiberTrackingObjectFactory::GetFileExtensions() +{ + std::string fileExtension; + this->CreateFileExtensions(m_FileExtensionsMap, fileExtension); + return fileExtension.c_str(); +} + +mitk::CoreObjectFactoryBase::MultimapType mitk::FiberTrackingObjectFactory::GetFileExtensionsMap() +{ + return m_FileExtensionsMap; +} + +const char* mitk::FiberTrackingObjectFactory::GetSaveFileExtensions() +{ + std::string fileExtension; + this->CreateFileExtensions(m_SaveFileExtensionsMap, fileExtension); + return fileExtension.c_str(); +} + +mitk::CoreObjectFactoryBase::MultimapType mitk::FiberTrackingObjectFactory::GetSaveFileExtensionsMap() +{ + return m_SaveFileExtensionsMap; +} + +void mitk::FiberTrackingObjectFactory::CreateFileExtensionsMap() +{ + m_FileExtensionsMap.insert(std::pair("*.fib", "Fiber Bundle")); + m_FileExtensionsMap.insert(std::pair("*.vtk", "Fiber Bundle")); + + m_SaveFileExtensionsMap.insert(std::pair("*.fib", "Fiber Bundle")); + m_SaveFileExtensionsMap.insert(std::pair("*.vtk", "Fiber Bundle")); +} + +void mitk::FiberTrackingObjectFactory::RegisterIOFactories() +{ +} + +void RegisterFiberTrackingObjectFactory() +{ + static bool oneFiberTrackingObjectFactoryRegistered = false; + if ( ! oneFiberTrackingObjectFactoryRegistered ) { + MITK_DEBUG << "Registering FiberTrackingObjectFactory..." << std::endl; + mitk::CoreObjectFactory::GetInstance()->RegisterExtraFactory(mitk::FiberTrackingObjectFactory::New()); + + oneFiberTrackingObjectFactoryRegistered = true; + } +} \ No newline at end of file diff --git a/Modules/DiffusionImaging/FiberTracking/IODataStructures/mitkFiberTrackingObjectFactory.h b/Modules/DiffusionImaging/FiberTracking/IODataStructures/mitkFiberTrackingObjectFactory.h new file mode 100644 index 0000000000..3ba7a4b04b --- /dev/null +++ b/Modules/DiffusionImaging/FiberTracking/IODataStructures/mitkFiberTrackingObjectFactory.h @@ -0,0 +1,54 @@ +#ifndef MITKFIBERTRACKINGOBJECTFACTORY_H +#define MITKFIBERTRACKINGOBJECTFACTORY_H + +#include "mitkCoreObjectFactory.h" +#include "FiberTrackingExports.h" + +//modernized fiberbundle datastrucutre +#include "mitkFiberBundleX.h" +#include "mitkFiberBundleXIOFactory.h" +#include "mitkFiberBundleXWriterFactory.h" +#include "mitkFiberBundleXWriter.h" +#include "mitkFiberBundleXMapper3D.h" +#include "mitkFiberBundleXMapper2D.h" + +#include "mitkFiberBundleXThreadMonitorMapper3D.h" +#include "mitkFiberBundleXThreadMonitor.h" + + + +#include "mitkPlanarFigureMapper3D.h" + +namespace mitk { + +class FiberTracking_EXPORT FiberTrackingObjectFactory : public CoreObjectFactoryBase +{ + public: + mitkClassMacro(FiberTrackingObjectFactory,CoreObjectFactoryBase); + itkNewMacro(FiberTrackingObjectFactory); + + virtual Mapper::Pointer CreateMapper(mitk::DataNode* node, MapperSlotId slotId); + virtual void SetDefaultProperties(mitk::DataNode* node); + virtual const char* GetFileExtensions(); + virtual mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap(); + virtual const char* GetSaveFileExtensions(); + virtual mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap(); + void RegisterIOFactories(); + protected: + FiberTrackingObjectFactory(bool registerSelf = true); + private: + void CreateFileExtensionsMap(); + std::string m_ExternalFileExtensions; + std::string m_InternalFileExtensions; + std::string m_SaveFileExtensions; + MultimapType m_FileExtensionsMap; + MultimapType m_SaveFileExtensionsMap; +}; + +} +// global declaration for simple call by +// applications +void FiberTracking_EXPORT RegisterFiberTrackingObjectFactory(); + + +#endif // MITKFIBERTRACKINGOBJECTFACTORY_H diff --git a/Modules/DiffusionImaging/Interactions/mitkFiberBundleInteractor.cpp b/Modules/DiffusionImaging/FiberTracking/Interactions/mitkFiberBundleInteractor.cpp similarity index 100% rename from Modules/DiffusionImaging/Interactions/mitkFiberBundleInteractor.cpp rename to Modules/DiffusionImaging/FiberTracking/Interactions/mitkFiberBundleInteractor.cpp diff --git a/Modules/DiffusionImaging/Interactions/mitkFiberBundleInteractor.h b/Modules/DiffusionImaging/FiberTracking/Interactions/mitkFiberBundleInteractor.h similarity index 96% rename from Modules/DiffusionImaging/Interactions/mitkFiberBundleInteractor.h rename to Modules/DiffusionImaging/FiberTracking/Interactions/mitkFiberBundleInteractor.h index e6dd4e7324..8fdee475c2 100644 --- a/Modules/DiffusionImaging/Interactions/mitkFiberBundleInteractor.h +++ b/Modules/DiffusionImaging/FiberTracking/Interactions/mitkFiberBundleInteractor.h @@ -1,99 +1,99 @@ /*=================================================================== 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 MITKFiberBundleINTERACTOR_H_HEADER_INCLUDED #define MITKFiberBundleINTERACTOR_H_HEADER_INCLUDED #include "mitkCommon.h" #include "MitkExtExports.h" #include #include -#include "MitkDiffusionImagingExports.h" +#include "FiberTrackingExports.h" #include namespace mitk { class DataNode; //##Documentation //## @brief Just select a point, that's the only way to interact with the point //## //## Interact with a point: Select the point without moving to get parameters that does not change //## All Set-operations would be done through the method "ExecuteAction", if there would be anyone. //## the identificationnumber of this point is set by this points and evalued from an empty place in the DataStructure //## @ingroup Interaction - class MitkDiffusionImaging_EXPORT FiberBundleInteractor : public Interactor + class FiberTracking_EXPORT FiberBundleInteractor : public Interactor { public: mitkClassMacro(FiberBundleInteractor, Interactor); mitkNewMacro2Param(Self, const char*, DataNode*); //##Documentation //## @brief Sets the amount of precision void SetPrecision(unsigned int precision); //##Documentation //## @brief derived from mitk::Interactor; calculates Jurisdiction according to points //## //## standard method can not be used, since it doesn't calculate in points, only in BoundingBox of Points virtual float CanHandleEvent(StateEvent const* stateEvent) const; protected: //##Documentation //##@brief Constructor FiberBundleInteractor(const char * type, DataNode* dataNode); //##Documentation //##@brief Destructor virtual ~FiberBundleInteractor(); //##Documentation //## @brief select the point on the given position virtual void SelectFiber(int position); //##Documentation //## @brief unselect all points that exist in mesh virtual void DeselectAllFibers(); //##Documentation //## @brief Executes Actions virtual bool ExecuteAction(Action* action, mitk::StateEvent const* stateEvent); private: //##Documentation //## @brief to calculate a direction vector from last point and actual point Point3D m_LastPoint; //##Documentation //## @brief to store a position unsigned int m_LastPosition; // Point3D m_InitialPickedPoint; // Point2D m_InitialPickedDisplayPoint; // vtkFloatingPointType m_InitialPickedPointWorld[4]; Point3D m_CurrentPickedPoint; Point2D m_CurrentPickedDisplayPoint; vtkFloatingPointType m_CurrentPickedPointWorld[4]; }; } #endif /* MITKFiberBundleInteractor_H_HEADER_INCLUDED */ diff --git a/Modules/DiffusionImaging/Rendering/mitkFiberBundleXMapper2D.cpp b/Modules/DiffusionImaging/FiberTracking/Rendering/mitkFiberBundleXMapper2D.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkFiberBundleXMapper2D.cpp rename to Modules/DiffusionImaging/FiberTracking/Rendering/mitkFiberBundleXMapper2D.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkFiberBundleXMapper2D.h b/Modules/DiffusionImaging/FiberTracking/Rendering/mitkFiberBundleXMapper2D.h similarity index 98% rename from Modules/DiffusionImaging/Rendering/mitkFiberBundleXMapper2D.h rename to Modules/DiffusionImaging/FiberTracking/Rendering/mitkFiberBundleXMapper2D.h index 7f0f774039..40a4110f13 100644 --- a/Modules/DiffusionImaging/Rendering/mitkFiberBundleXMapper2D.h +++ b/Modules/DiffusionImaging/FiberTracking/Rendering/mitkFiberBundleXMapper2D.h @@ -1,111 +1,111 @@ /*=================================================================== 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 FIBERBUNDLEXMAPPER2D_H_HEADER_INCLUDED #define FIBERBUNDLEXMAPPER2D_H_HEADER_INCLUDED //MITK Rendering #include #include -//#include "MitkDiffusionImagingExports.h" +//#include "FiberTrackingExports.h" #include #include #include class vtkActor; //class vtkPropAssembly; //lets see if we need it class mitkBaseRenderer; class vtkPolyDataMapper; class vtkCutter; class vtkPlane; class vtkPolyData; namespace mitk { class FiberBundleXMapper2D : public VtkMapper2D { public: mitkClassMacro(FiberBundleXMapper2D, VtkMapper2D); itkNewMacro(Self); mitk::FiberBundleX* GetInput(); /** \brief Checks whether this mapper needs to update itself and generate * data. */ virtual void Update(mitk::BaseRenderer * renderer); static void SetDefaultProperties(DataNode* node, BaseRenderer* renderer = NULL, bool overwrite = false ); //### methods of MITK-VTK rendering pipeline virtual vtkProp* GetVtkProp(mitk::BaseRenderer* renderer); virtual void MitkRenderOverlay(BaseRenderer* renderer); virtual void MitkRenderOpaqueGeometry(BaseRenderer* renderer); virtual void MitkRenderTranslucentGeometry(BaseRenderer* renderer); virtual void MitkRenderVolumetricGeometry(BaseRenderer* renderer); //### end of methods of MITK-VTK rendering pipeline class FBXLocalStorage : public mitk::Mapper::BaseLocalStorage { public: /** \brief Point Actor of a 2D render window. */ vtkSmartPointer m_PointActor; /** \brief Point Mapper of a 2D render window. */ vtkSmartPointer m_PointMapper; vtkSmartPointer m_SlicingPlane; //needed later when optimized 2D mapper vtkSmartPointer m_SlicedResult; //might be depricated in optimized 2D mapper /** \brief Timestamp of last update of stored data. */ itk::TimeStamp m_LastUpdateTime; /** \brief Constructor of the local storage. Do as much actions as possible in here to avoid double executions. */ FBXLocalStorage(); //if u copy&paste from this 2Dmapper, be aware that the implementation of this constructor is in the cpp file ~FBXLocalStorage() { } }; /** \brief This member holds all three LocalStorages for the three 2D render windows. */ mitk::Mapper::LocalStorageHandler m_LSH; protected: FiberBundleXMapper2D(); virtual ~FiberBundleXMapper2D(); /** Does the actual resampling, without rendering. */ virtual void GenerateDataForRenderer(mitk::BaseRenderer*); void UpdateShaderParameter(mitk::BaseRenderer*); private: vtkSmartPointer m_lut; }; }//end namespace #endif diff --git a/Modules/DiffusionImaging/Rendering/mitkFiberBundleXMapper3D.cpp b/Modules/DiffusionImaging/FiberTracking/Rendering/mitkFiberBundleXMapper3D.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkFiberBundleXMapper3D.cpp rename to Modules/DiffusionImaging/FiberTracking/Rendering/mitkFiberBundleXMapper3D.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkFiberBundleXMapper3D.h b/Modules/DiffusionImaging/FiberTracking/Rendering/mitkFiberBundleXMapper3D.h similarity index 96% rename from Modules/DiffusionImaging/Rendering/mitkFiberBundleXMapper3D.h rename to Modules/DiffusionImaging/FiberTracking/Rendering/mitkFiberBundleXMapper3D.h index 8e729f838c..6d238416cc 100644 --- a/Modules/DiffusionImaging/Rendering/mitkFiberBundleXMapper3D.h +++ b/Modules/DiffusionImaging/FiberTracking/Rendering/mitkFiberBundleXMapper3D.h @@ -1,104 +1,104 @@ /*=================================================================== 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 FiberBundleXMapper3D_H_HEADER_INCLUDED #define FiberBundleXMapper3D_H_HEADER_INCLUDED //#include //?? necessary -#include +#include #include #include #include #include #include #include class vtkPropAssembly; namespace mitk { //##Documentation //## @brief Mapper for FiberBundleX //## @ingroup Mapper -class MitkDiffusionImaging_EXPORT FiberBundleXMapper3D : public VtkMapper3D +class FiberTracking_EXPORT FiberBundleXMapper3D : public VtkMapper3D { public: mitkClassMacro(FiberBundleXMapper3D, VtkMapper3D); itkNewMacro(Self); //========== essential implementation for 3D mapper ======== const FiberBundleX* 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 GenerateDataForRenderer(mitk::BaseRenderer* renderer); //========================================================= virtual void GenerateData(mitk::BaseRenderer *renderer); class FBXLocalStorage3D : public mitk::Mapper::BaseLocalStorage { public: /** \brief Point Actor of a 3D render window. */ vtkSmartPointer m_FiberActor; /** \brief Point Mapper of a 3D render window. */ vtkSmartPointer m_FiberMapper; vtkSmartPointer m_FiberAssembly; /** \brief Timestamp of last update of stored data. */ itk::TimeStamp m_LastUpdateTime; /** \brief Constructor of the local storage. Do as much actions as possible in here to avoid double executions. */ FBXLocalStorage3D(); //if u copy&paste from this 2Dmapper, be aware that the implementation of this constructor is in the cpp file ~FBXLocalStorage3D() { } }; /** \brief This member holds all three LocalStorages for the 3D render window(s). */ mitk::Mapper::LocalStorageHandler m_LSH; protected: FiberBundleXMapper3D(); virtual ~FiberBundleXMapper3D(); void UpdateVtkObjects(); //?? private: vtkSmartPointer m_lut; }; } // end namespace mitk #endif /* FiberBundleXMapper3D_H_HEADER_INCLUDED */ diff --git a/Modules/DiffusionImaging/Rendering/mitkFiberBundleXThreadMonitorMapper3D.cpp b/Modules/DiffusionImaging/FiberTracking/Rendering/mitkFiberBundleXThreadMonitorMapper3D.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkFiberBundleXThreadMonitorMapper3D.cpp rename to Modules/DiffusionImaging/FiberTracking/Rendering/mitkFiberBundleXThreadMonitorMapper3D.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkFiberBundleXThreadMonitorMapper3D.h b/Modules/DiffusionImaging/FiberTracking/Rendering/mitkFiberBundleXThreadMonitorMapper3D.h similarity index 95% rename from Modules/DiffusionImaging/Rendering/mitkFiberBundleXThreadMonitorMapper3D.h rename to Modules/DiffusionImaging/FiberTracking/Rendering/mitkFiberBundleXThreadMonitorMapper3D.h index c0664828d9..dbff4caf6c 100644 --- a/Modules/DiffusionImaging/Rendering/mitkFiberBundleXThreadMonitorMapper3D.h +++ b/Modules/DiffusionImaging/FiberTracking/Rendering/mitkFiberBundleXThreadMonitorMapper3D.h @@ -1,90 +1,90 @@ /*=================================================================== 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 FiberBundleXThreadMonitorMapper3D_H_HEADER_INCLUDED #define FiberBundleXThreadMonitorMapper3D_H_HEADER_INCLUDED //#include //?? necessary -#include +#include #include #include #include #include #include class vtkPropAssembly; namespace mitk { //##Documentation //## @brief Mapper for FiberBundleX //## @ingroup Mapper - class MitkDiffusionImaging_EXPORT FiberBundleXThreadMonitorMapper3D : public VtkMapper3D + class FiberTracking_EXPORT FiberBundleXThreadMonitorMapper3D : public VtkMapper3D { public: mitkClassMacro(FiberBundleXThreadMonitorMapper3D, VtkMapper3D); itkNewMacro(Self); //========== essential implementation for 3D mapper ======== const FiberBundleXThreadMonitor* 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 GenerateDataForRenderer(mitk::BaseRenderer* renderer); virtual void GenerateData(); //========================================================= protected: FiberBundleXThreadMonitorMapper3D(); virtual ~FiberBundleXThreadMonitorMapper3D(); void UpdateVtkObjects(); //?? vtkSmartPointer m_FiberMonitorMapper; vtkSmartPointer m_TextActorClose; vtkSmartPointer m_TextActorOpen; vtkSmartPointer m_TextActorHeading; vtkSmartPointer m_TextActorMask; vtkSmartPointer m_TextActorStatus; vtkSmartPointer m_TextActorStarted; vtkSmartPointer m_TextActorFinished; vtkSmartPointer m_TextActorTerminated; vtkPropAssembly* m_FiberAssembly; private: double m_lastModifiedMonitorNodeTime; }; } // end namespace mitk #endif /* FiberBundleXMapper3D_H_HEADER_INCLUDED */ diff --git a/Modules/DiffusionImaging/Rendering/mitkShaderFiberClipping.xml b/Modules/DiffusionImaging/FiberTracking/Rendering/mitkShaderFiberClipping.xml similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkShaderFiberClipping.xml rename to Modules/DiffusionImaging/FiberTracking/Rendering/mitkShaderFiberClipping.xml diff --git a/Modules/DiffusionImaging/SignalModels/mitkBallModel.cpp b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkBallModel.cpp similarity index 100% rename from Modules/DiffusionImaging/SignalModels/mitkBallModel.cpp rename to Modules/DiffusionImaging/FiberTracking/SignalModels/mitkBallModel.cpp diff --git a/Modules/DiffusionImaging/SignalModels/mitkBallModel.h b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkBallModel.h similarity index 100% rename from Modules/DiffusionImaging/SignalModels/mitkBallModel.h rename to Modules/DiffusionImaging/FiberTracking/SignalModels/mitkBallModel.h diff --git a/Modules/DiffusionImaging/SignalModels/mitkDiffusionNoiseModel.h b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkDiffusionNoiseModel.h similarity index 96% rename from Modules/DiffusionImaging/SignalModels/mitkDiffusionNoiseModel.h rename to Modules/DiffusionImaging/FiberTracking/SignalModels/mitkDiffusionNoiseModel.h index 5281eec741..7d16b63563 100644 --- a/Modules/DiffusionImaging/SignalModels/mitkDiffusionNoiseModel.h +++ b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkDiffusionNoiseModel.h @@ -1,55 +1,55 @@ /*=================================================================== 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_DiffusionNoiseModel_H #define _MITK_DiffusionNoiseModel_H -#include +#include #include #include #include namespace mitk { /** * \brief Abstract class for diffusion noise models * */ template< class ScalarType > class DiffusionNoiseModel { public: DiffusionNoiseModel(){} ~DiffusionNoiseModel(){} typedef itk::VariableLengthVector< ScalarType > PixelType; /** Adds noise according to model to the input pixel. Has to be implemented in subclass. **/ virtual void AddNoise(PixelType& pixel) = 0; void SetNoiseVariance(double var){ m_NoiseVariance = var; } protected: double m_NoiseVariance; ///< variance of underlying distribution }; } #endif diff --git a/Modules/DiffusionImaging/SignalModels/mitkDiffusionSignalModel.h b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkDiffusionSignalModel.h similarity index 98% rename from Modules/DiffusionImaging/SignalModels/mitkDiffusionSignalModel.h rename to Modules/DiffusionImaging/FiberTracking/SignalModels/mitkDiffusionSignalModel.h index eca85986e5..e2f9a7fb3d 100644 --- a/Modules/DiffusionImaging/SignalModels/mitkDiffusionSignalModel.h +++ b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkDiffusionSignalModel.h @@ -1,81 +1,81 @@ /*=================================================================== 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_DiffusionSignalModel_H #define _MITK_DiffusionSignalModel_H -#include +#include #include #include #include namespace mitk { /** * \brief Abstract class for diffusion signal models * */ template< class ScalarType > class DiffusionSignalModel { public: DiffusionSignalModel() : m_SignalScale(200){} ~DiffusionSignalModel(){} typedef itk::VariableLengthVector< ScalarType > PixelType; typedef itk::Vector GradientType; typedef std::vector GradientListType; /** Realizes actual signal generation. Has to be implemented in subclass. **/ virtual PixelType SimulateMeasurement() = 0; void SetFiberDirection(GradientType fiberDirection){ m_FiberDirection = fiberDirection; } void SetGradientList(GradientListType gradientList) { m_GradientList = gradientList; } void SetSignalScale(ScalarType signalScale) { m_SignalScale = signalScale; } void SetRelaxationT2(double T2) { m_RelaxationT2 = T2; } double GetRelaxationT2() { return m_RelaxationT2; } ScalarType GetSignalScale() { return m_SignalScale; } int GetNumGradients(){ return m_GradientList.size(); } std::vector< int > GetBaselineIndices() { std::vector< int > result; for( unsigned int i=0; im_GradientList.size(); i++) if (m_GradientList.at(i).GetNorm()<0.0001) result.push_back(i); return result; } int GetFirstBaselineIndex() { for( unsigned int i=0; im_GradientList.size(); i++) if (m_GradientList.at(i).GetNorm()<0.0001) return i; return -1; } protected: GradientType m_FiberDirection; ///< Needed to generate anisotropc signal to determin direction of anisotropy GradientListType m_GradientList; ///< Diffusion gradient direction container ScalarType m_SignalScale; ///< Scaling factor for signal value double m_RelaxationT2; ///< Tissue specific relaxation time (used for artificial artifacts) }; } #endif diff --git a/Modules/DiffusionImaging/SignalModels/mitkGibbsRingingArtifact.cpp b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkGibbsRingingArtifact.cpp similarity index 100% rename from Modules/DiffusionImaging/SignalModels/mitkGibbsRingingArtifact.cpp rename to Modules/DiffusionImaging/FiberTracking/SignalModels/mitkGibbsRingingArtifact.cpp diff --git a/Modules/DiffusionImaging/SignalModels/mitkGibbsRingingArtifact.h b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkGibbsRingingArtifact.h similarity index 97% rename from Modules/DiffusionImaging/SignalModels/mitkGibbsRingingArtifact.h rename to Modules/DiffusionImaging/FiberTracking/SignalModels/mitkGibbsRingingArtifact.h index 1cd8061924..9115346e66 100644 --- a/Modules/DiffusionImaging/SignalModels/mitkGibbsRingingArtifact.h +++ b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkGibbsRingingArtifact.h @@ -1,58 +1,58 @@ /*=================================================================== 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_GibbsRingingArtifact_H #define _MITK_GibbsRingingArtifact_H -#include +#include #include #include #include namespace mitk { /** * \brief Class to add gibbs ringing artifact to input complex slice * */ template< class ScalarType > class GibbsRingingArtifact : public KspaceArtifact< ScalarType > { public: GibbsRingingArtifact(); ~GibbsRingingArtifact(); typedef typename KspaceArtifact< ScalarType >::ComplexSliceType ComplexSliceType; /** Adds Gibbs ringing to the input slice (by zero padding). **/ typename ComplexSliceType::Pointer AddArtifact(typename ComplexSliceType::Pointer slice); void SetKspaceCropping(int factor){ m_KspaceCropping=factor; } int GetKspaceCropping(){ return m_KspaceCropping; } protected: int m_KspaceCropping; }; #include "mitkGibbsRingingArtifact.cpp" } #endif diff --git a/Modules/DiffusionImaging/SignalModels/mitkKspaceArtifact.h b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkKspaceArtifact.h similarity index 96% rename from Modules/DiffusionImaging/SignalModels/mitkKspaceArtifact.h rename to Modules/DiffusionImaging/FiberTracking/SignalModels/mitkKspaceArtifact.h index 751dfddf4a..eb204990d8 100644 --- a/Modules/DiffusionImaging/SignalModels/mitkKspaceArtifact.h +++ b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkKspaceArtifact.h @@ -1,55 +1,55 @@ /*=================================================================== 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_KspaceArtifact_H #define _MITK_KspaceArtifact_H -#include +#include #include #include namespace mitk { /** * \brief Abstract class for diffusion noise models * */ template< class ScalarType > class KspaceArtifact { public: KspaceArtifact(){ m_T2=90; } ~KspaceArtifact(){} typedef typename itk::FFTRealToComplexConjugateImageFilter< ScalarType, 2 >::OutputImageType ComplexSliceType; /** Adds artifact according to model to the input slice. Has to be implemented in subclass. **/ virtual typename ComplexSliceType::Pointer AddArtifact(typename ComplexSliceType::Pointer slice) = 0; void SetRelaxationT2(unsigned int T2){ m_T2=T2; } protected: unsigned int m_T2; }; } #endif diff --git a/Modules/DiffusionImaging/SignalModels/mitkRicianNoiseModel.cpp b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkRicianNoiseModel.cpp similarity index 100% rename from Modules/DiffusionImaging/SignalModels/mitkRicianNoiseModel.cpp rename to Modules/DiffusionImaging/FiberTracking/SignalModels/mitkRicianNoiseModel.cpp diff --git a/Modules/DiffusionImaging/SignalModels/mitkRicianNoiseModel.h b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkRicianNoiseModel.h similarity index 100% rename from Modules/DiffusionImaging/SignalModels/mitkRicianNoiseModel.h rename to Modules/DiffusionImaging/FiberTracking/SignalModels/mitkRicianNoiseModel.h diff --git a/Modules/DiffusionImaging/SignalModels/mitkStickModel.cpp b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkStickModel.cpp similarity index 100% rename from Modules/DiffusionImaging/SignalModels/mitkStickModel.cpp rename to Modules/DiffusionImaging/FiberTracking/SignalModels/mitkStickModel.cpp diff --git a/Modules/DiffusionImaging/SignalModels/mitkStickModel.h b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkStickModel.h similarity index 100% rename from Modules/DiffusionImaging/SignalModels/mitkStickModel.h rename to Modules/DiffusionImaging/FiberTracking/SignalModels/mitkStickModel.h diff --git a/Modules/DiffusionImaging/SignalModels/mitkT2SmearingArtifact.cpp b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkT2SmearingArtifact.cpp similarity index 100% rename from Modules/DiffusionImaging/SignalModels/mitkT2SmearingArtifact.cpp rename to Modules/DiffusionImaging/FiberTracking/SignalModels/mitkT2SmearingArtifact.cpp diff --git a/Modules/DiffusionImaging/SignalModels/mitkT2SmearingArtifact.h b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkT2SmearingArtifact.h similarity index 97% rename from Modules/DiffusionImaging/SignalModels/mitkT2SmearingArtifact.h rename to Modules/DiffusionImaging/FiberTracking/SignalModels/mitkT2SmearingArtifact.h index 70495f164e..2348cd2bb9 100644 --- a/Modules/DiffusionImaging/SignalModels/mitkT2SmearingArtifact.h +++ b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkT2SmearingArtifact.h @@ -1,57 +1,57 @@ /*=================================================================== 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_T2SmearingArtifact_H #define _MITK_T2SmearingArtifact_H -#include +#include #include #include #include namespace mitk { /** * \brief Class to add gibbs ringing artifact to input complex slice * */ template< class ScalarType > class T2SmearingArtifact : public KspaceArtifact< ScalarType > { public: T2SmearingArtifact(); ~T2SmearingArtifact(); typedef typename KspaceArtifact< ScalarType >::ComplexSliceType ComplexSliceType; /** Attenuate signal according to given T2 time. **/ typename ComplexSliceType::Pointer AddArtifact(typename ComplexSliceType::Pointer slice); void SetReadoutPulseLength(double t){ m_ReadoutPulseLength=t; } protected: unsigned int m_ReadoutPulseLength; }; #include "mitkT2SmearingArtifact.cpp" } #endif diff --git a/Modules/DiffusionImaging/SignalModels/mitkTensorModel.cpp b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkTensorModel.cpp similarity index 100% rename from Modules/DiffusionImaging/SignalModels/mitkTensorModel.cpp rename to Modules/DiffusionImaging/FiberTracking/SignalModels/mitkTensorModel.cpp diff --git a/Modules/DiffusionImaging/SignalModels/mitkTensorModel.h b/Modules/DiffusionImaging/FiberTracking/SignalModels/mitkTensorModel.h similarity index 100% rename from Modules/DiffusionImaging/SignalModels/mitkTensorModel.h rename to Modules/DiffusionImaging/FiberTracking/SignalModels/mitkTensorModel.h diff --git a/Modules/DiffusionImaging/Testing/CMakeLists.txt b/Modules/DiffusionImaging/FiberTracking/Testing/CMakeLists.txt similarity index 58% rename from Modules/DiffusionImaging/Testing/CMakeLists.txt rename to Modules/DiffusionImaging/FiberTracking/Testing/CMakeLists.txt index 4f7aaef365..d6aa30bd5f 100644 --- a/Modules/DiffusionImaging/Testing/CMakeLists.txt +++ b/Modules/DiffusionImaging/FiberTracking/Testing/CMakeLists.txt @@ -1,12 +1,5 @@ MITK_CREATE_MODULE_TESTS() - mitkAddCustomModuleTest(mitkFiberBundleXReaderWriterTest mitkFiberBundleXReaderWriterTest ${MITK_DATA_DIR}/DiffusionImaging/fiberBundleX.fib) mitkAddCustomModuleTest(mitkGibbsTrackingTest mitkGibbsTrackingTest ${MITK_DATA_DIR}/DiffusionImaging/qBallImage.qbi ${MITK_DATA_DIR}/DiffusionImaging/diffusionImageMask.nrrd ${MITK_DATA_DIR}/DiffusionImaging/gibbsTrackingParameters.gtp ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ ${MITK_DATA_DIR}/DiffusionImaging/fiberBundleX.fib) #mitkAddCustomModuleTest(mitkFiberBundleXTest mitkFiberBundleXTest ${MITK_DATA_DIR}/DiffusionImaging/fiberBundleX.fib) - - -mitkAddCustomModuleTest(mitkTbssNrrdImageReaderTest mitkTbssNrrdImageReaderTest ${MITK_DATA_DIR}/DiffusionImaging/tbss.tbss) -#mitkAddCustomModuleTest(mitkTbssRoiNrrdImageReaderTest mitkTbssRoiNrrdImageReaderTest ${MITK_DATA_DIR}/DiffusionImaging/bodyfornix.roi) -mitkAddCustomModuleTest(mitkTbssNrrdImageWriterTest mitkTbssNrrdImageWriterTest ${MITK_DATA_DIR}/DiffusionImaging/tbss.tbss ${MITK_DATA_DIR}/DiffusionImaging/tbss2.tbss) - diff --git a/Modules/DiffusionImaging/FiberTracking/Testing/files.cmake b/Modules/DiffusionImaging/FiberTracking/Testing/files.cmake new file mode 100644 index 0000000000..b5d52ea256 --- /dev/null +++ b/Modules/DiffusionImaging/FiberTracking/Testing/files.cmake @@ -0,0 +1,7 @@ +SET(MODULE_CUSTOM_TESTS + mitkFiberBundleXReaderWriterTest.cpp + mitkFiberBundleXTest.cpp + mitkGibbsTrackingTest.cpp +) + + diff --git a/Modules/DiffusionImaging/Testing/mitkFiberBundleXReaderWriterTest.cpp b/Modules/DiffusionImaging/FiberTracking/Testing/mitkFiberBundleXReaderWriterTest.cpp similarity index 100% rename from Modules/DiffusionImaging/Testing/mitkFiberBundleXReaderWriterTest.cpp rename to Modules/DiffusionImaging/FiberTracking/Testing/mitkFiberBundleXReaderWriterTest.cpp diff --git a/Modules/DiffusionImaging/Testing/mitkFiberBundleXTest.cpp b/Modules/DiffusionImaging/FiberTracking/Testing/mitkFiberBundleXTest.cpp similarity index 100% rename from Modules/DiffusionImaging/Testing/mitkFiberBundleXTest.cpp rename to Modules/DiffusionImaging/FiberTracking/Testing/mitkFiberBundleXTest.cpp diff --git a/Modules/DiffusionImaging/Testing/mitkGibbsTrackingTest.cpp b/Modules/DiffusionImaging/FiberTracking/Testing/mitkGibbsTrackingTest.cpp similarity index 100% rename from Modules/DiffusionImaging/Testing/mitkGibbsTrackingTest.cpp rename to Modules/DiffusionImaging/FiberTracking/Testing/mitkGibbsTrackingTest.cpp diff --git a/Modules/DiffusionImaging/FiberTracking/files.cmake b/Modules/DiffusionImaging/FiberTracking/files.cmake new file mode 100644 index 0000000000..36e2eb59cf --- /dev/null +++ b/Modules/DiffusionImaging/FiberTracking/files.cmake @@ -0,0 +1,88 @@ +set(CPP_FILES + +# 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 + IODataStructures/mitkFiberTrackingObjectFactory.cpp + + # Rendering + Rendering/mitkFiberBundleXMapper2D.cpp + Rendering/mitkFiberBundleXMapper3D.cpp + Rendering/mitkFiberBundleXThreadMonitorMapper3D.cpp + #Rendering/mitkPlanarFigureMapper3D.cpp + + # Interactions + Interactions/mitkFiberBundleInteractor.cpp + + # Algorithms + Algorithms/mitkTractAnalyzer.cpp + + # Tractography + Algorithms/GibbsTracking/mitkParticleGrid.cpp + Algorithms/GibbsTracking/mitkMetropolisHastingsSampler.cpp + Algorithms/GibbsTracking/mitkEnergyComputer.cpp + Algorithms/GibbsTracking/mitkGibbsEnergyComputer.cpp + Algorithms/GibbsTracking/mitkFiberBuilder.cpp +) + +set(H_FILES + # Rendering + Rendering/mitkFiberBundleXMapper3D.h + Rendering/mitkFiberBundleXMapper2D.h + Rendering/mitkFiberBundleXThreadMonitorMapper3D.h + #Rendering/mitkPlanarFigureMapper3D.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 + + IODataStructures/mitkFiberTrackingObjectFactory.h + + # Algorithms + Algorithms/itkTractDensityImageFilter.h + Algorithms/itkTractsToFiberEndingsImageFilter.h + Algorithms/itkTractsToRgbaImageFilter.h + Algorithms/itkElectrostaticRepulsionDiffusionGradientReductionFilter.h + Algorithms/itkFibersFromPlanarFiguresFilter.h + Algorithms/itkTractsToDWIImageFilter.h + Algorithms/itkTractsToVectorImageFilter.h + + # (old) Tractography + Algorithms/itkGibbsTrackingFilter.h + Algorithms/itkStochasticTractographyFilter.h + Algorithms/itkStreamlineTrackingFilter.h + Algorithms/GibbsTracking/mitkParticle.h + Algorithms/GibbsTracking/mitkParticleGrid.h + Algorithms/GibbsTracking/mitkMetropolisHastingsSampler.h + Algorithms/GibbsTracking/mitkSimpSamp.h + Algorithms/GibbsTracking/mitkEnergyComputer.h + Algorithms/GibbsTracking/mitkGibbsEnergyComputer.h + Algorithms/GibbsTracking/mitkSphereInterpolator.h + Algorithms/GibbsTracking/mitkFiberBuilder.h + + # Signal Models + 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 +) \ No newline at end of file diff --git a/Modules/DiffusionImaging/Reconstruction/itkRegularizedIVIMLocalVariationImageFilter.h b/Modules/DiffusionImaging/Quantification/Algorithms/itkRegularizedIVIMLocalVariationImageFilter.h similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/itkRegularizedIVIMLocalVariationImageFilter.h rename to Modules/DiffusionImaging/Quantification/Algorithms/itkRegularizedIVIMLocalVariationImageFilter.h diff --git a/Modules/DiffusionImaging/Reconstruction/itkRegularizedIVIMLocalVariationImageFilter.txx b/Modules/DiffusionImaging/Quantification/Algorithms/itkRegularizedIVIMLocalVariationImageFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/itkRegularizedIVIMLocalVariationImageFilter.txx rename to Modules/DiffusionImaging/Quantification/Algorithms/itkRegularizedIVIMLocalVariationImageFilter.txx diff --git a/Modules/DiffusionImaging/Reconstruction/itkRegularizedIVIMReconstructionFilter.h b/Modules/DiffusionImaging/Quantification/Algorithms/itkRegularizedIVIMReconstructionFilter.h similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/itkRegularizedIVIMReconstructionFilter.h rename to Modules/DiffusionImaging/Quantification/Algorithms/itkRegularizedIVIMReconstructionFilter.h diff --git a/Modules/DiffusionImaging/Reconstruction/itkRegularizedIVIMReconstructionFilter.txx b/Modules/DiffusionImaging/Quantification/Algorithms/itkRegularizedIVIMReconstructionFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/itkRegularizedIVIMReconstructionFilter.txx rename to Modules/DiffusionImaging/Quantification/Algorithms/itkRegularizedIVIMReconstructionFilter.txx diff --git a/Modules/DiffusionImaging/Reconstruction/itkRegularizedIVIMReconstructionSingleIteration.h b/Modules/DiffusionImaging/Quantification/Algorithms/itkRegularizedIVIMReconstructionSingleIteration.h similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/itkRegularizedIVIMReconstructionSingleIteration.h rename to Modules/DiffusionImaging/Quantification/Algorithms/itkRegularizedIVIMReconstructionSingleIteration.h diff --git a/Modules/DiffusionImaging/Reconstruction/itkRegularizedIVIMReconstructionSingleIteration.txx b/Modules/DiffusionImaging/Quantification/Algorithms/itkRegularizedIVIMReconstructionSingleIteration.txx similarity index 100% rename from Modules/DiffusionImaging/Reconstruction/itkRegularizedIVIMReconstructionSingleIteration.txx rename to Modules/DiffusionImaging/Quantification/Algorithms/itkRegularizedIVIMReconstructionSingleIteration.txx diff --git a/Modules/DiffusionImaging/Algorithms/itkSkeletonizationFilter.h b/Modules/DiffusionImaging/Quantification/Algorithms/itkSkeletonizationFilter.h similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkSkeletonizationFilter.h rename to Modules/DiffusionImaging/Quantification/Algorithms/itkSkeletonizationFilter.h diff --git a/Modules/DiffusionImaging/Algorithms/itkSkeletonizationFilter.txx b/Modules/DiffusionImaging/Quantification/Algorithms/itkSkeletonizationFilter.txx similarity index 100% rename from Modules/DiffusionImaging/Algorithms/itkSkeletonizationFilter.txx rename to Modules/DiffusionImaging/Quantification/Algorithms/itkSkeletonizationFilter.txx diff --git a/Modules/DiffusionImaging/Quantification/CMakeLists.txt b/Modules/DiffusionImaging/Quantification/CMakeLists.txt new file mode 100644 index 0000000000..76fb5624b4 --- /dev/null +++ b/Modules/DiffusionImaging/Quantification/CMakeLists.txt @@ -0,0 +1,8 @@ +#DiffusionImaging/Quantification +MITK_CREATE_MODULE( Quantification + INCLUDE_DIRS Algorithms IODataStructures IODataStructures/TbssImages Rendering ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS DiffusionCore FiberTracking MitkGraphAlgorithms +) + +add_subdirectory(Testing) + diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageIOFactory.cpp b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageIOFactory.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageIOFactory.cpp rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageIOFactory.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageIOFactory.h b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageIOFactory.h similarity index 94% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageIOFactory.h rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageIOFactory.h index 3d4355ff14..650baa3580 100644 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageIOFactory.h +++ b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageIOFactory.h @@ -1,77 +1,77 @@ /*=================================================================== 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_NRRD_TBSS_VOULMES_IO_FACTORY_H_HEADER__ #define __MITK_NRRD_TBSS_VOULMES_IO_FACTORY_H_HEADER__ #ifdef _MSC_VER #pragma warning ( disable : 4786 ) #endif #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" -#include "MitkDiffusionImagingExports.h" +#include "QuantificationExports.h" namespace mitk { //##Documentation //## @brief Create instances of NrrdDiffusionImageReader objects using an object factory. //## //## @ingroup IO -class MitkDiffusionImaging_EXPORT NrrdTbssImageIOFactory : public itk::ObjectFactoryBase +class Quantification_EXPORT NrrdTbssImageIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ typedef NrrdTbssImageIOFactory Self; typedef itk::ObjectFactoryBase Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); static NrrdTbssImageIOFactory* FactoryNew() { return new NrrdTbssImageIOFactory;} /** Run-time type information (and related methods). */ itkTypeMacro(NrrdTbssImageIOFactory, ObjectFactoryBase); /** Register one factory of this type */ static void RegisterOneFactory(void) { static bool IsRegistered = false; if ( !IsRegistered ) { NrrdTbssImageIOFactory::Pointer fac = NrrdTbssImageIOFactory::New(); ObjectFactoryBase::RegisterFactory( fac ); IsRegistered = true; } } protected: NrrdTbssImageIOFactory(); ~NrrdTbssImageIOFactory(); private: NrrdTbssImageIOFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif // __MITK_NRRD_TBSS_VOULMES_IO_FACTORY_H_HEADER__ diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageReader.cpp b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageReader.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageReader.cpp rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageReader.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageReader.h b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageReader.h similarity index 96% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageReader.h rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageReader.h index 4f92b9187d..257afe1981 100644 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageReader.h +++ b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageReader.h @@ -1,103 +1,103 @@ /*=================================================================== 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 __mitkNrrdTbssImageReader_h #define __mitkNrrdTbssImageReader_h #include "mitkCommon.h" #include "mitkFileReader.h" #include "mitkTbssImageSource.h" #include "itkImage.h" #include "itkVectorImage.h" #include "mitkTbssImage.h" namespace mitk { /** \brief */ - class MitkDiffusionImaging_EXPORT NrrdTbssImageReader : public mitk::TbssImageSource, public FileReader + class Quantification_EXPORT NrrdTbssImageReader : public mitk::TbssImageSource, public FileReader { public: typedef mitk::TbssImage OutputType; typedef itk::VectorImage ImageType; typedef TbssImageSource TbssVolSourceType; mitkClassMacro( NrrdTbssImageReader, TbssVolSourceType ) itkNewMacro(Self) const char* GetFileName() const; void SetFileName(const char* aFileName); const char* GetFilePrefix() const; void SetFilePrefix(const char* aFilePrefix); const char* GetFilePattern() const; void SetFilePattern(const char* aFilePattern); static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern); protected: /** Does the real work. */ virtual void GenerateData(); virtual void GenerateOutputInformation(); std::string m_FileName; std::string m_FilePrefix; std::string m_FilePattern; std::vector< std::pair > m_GroupInfo; OutputType::Pointer m_OutputCache; itk::TimeStamp m_CacheTime; void Tokenize(const std::string& str, std::vector& tokens, const std::string& delimiters = " ") { // Skip delimiters at beginning. std::string::size_type lastPos = str.find_first_not_of(delimiters, 0); // Find first "non-delimiter". std::string::size_type pos = str.find_first_of(delimiters, lastPos); while (std::string::npos != pos || std::string::npos != lastPos) { // Found a token, add it to the vector. tokens.push_back(str.substr(lastPos, pos - lastPos)); // Skip delimiters. Note the "not_of" lastPos = str.find_first_not_of(delimiters, pos); // Find next "non-delimiter" pos = str.find_first_of(delimiters, lastPos); } } private: void operator=(const Self&); //purposely not implemented }; } //namespace MITK //#include "mitkNrrdTbssImageReader.cpp" #endif // __mitkNrrdTbssImageReader_h diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageWriter.cpp b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageWriter.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageWriter.cpp rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageWriter.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageWriter.h b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageWriter.h similarity index 95% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageWriter.h rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageWriter.h index 0172833e7c..9a1fcfdd4b 100644 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageWriter.h +++ b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageWriter.h @@ -1,140 +1,140 @@ /*=================================================================== 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_NRRDTBSSVOL_WRITER__H_ #define _MITK_NRRDTBSSVOL_WRITER__H_ #include #include #include #include -#include "MitkDiffusionImagingExports.h" +#include "QuantificationExports.h" namespace mitk { /** * Writes diffusion volumes to a file * @ingroup Process */ -class MitkDiffusionImaging_EXPORT NrrdTbssImageWriter : public mitk::FileWriterWithInformation +class Quantification_EXPORT NrrdTbssImageWriter : public mitk::FileWriterWithInformation { public: mitkClassMacro( NrrdTbssImageWriter, mitk::FileWriterWithInformation ) mitkWriterMacro itkNewMacro( Self ) typedef mitk::TbssImage InputType; /** * Sets the filename of the file to write. * @param FileName the nameInputType of the file to write. */ itkSetStringMacro( FileName ) /** * @returns the name of the file to be written to disk. */ itkGetStringMacro( FileName ) /** * @warning multiple write not (yet) supported */ itkSetStringMacro( FilePrefix ) /** * @warning multiple write not (yet) supported */ itkGetStringMacro( FilePrefix ) /** * @warning multiple write not (yet) supported */ itkSetStringMacro( FilePattern ) /** * @warning multiple write not (yet) supported */ itkGetStringMacro( FilePattern ) /**image * Sets the input object for the filter. * @param input the diffusion volumes to write to file. */ void SetInput( InputType* input ); /**itk::VectorImage * @returns the 0'th input object of the filter. */ InputType* GetInput(); /** * Returns false if an error happened during writing */ itkGetMacro( Success, bool ) /** * @return possible file extensions for the data type associated with the writer */ virtual std::vector GetPossibleFileExtensions(); // FileWriterWithInformation methods virtual const char * GetDefaultFilename() { return "TbssImage.tbss"; } virtual const char * GetFileDialogPattern() { return "Tbss Images (*.tbss)"; } virtual const char * GetDefaultExtension() { return ".tbss"; } virtual bool CanWriteBaseDataType(BaseData::Pointer data) { return (dynamic_cast(data.GetPointer()) != NULL); } virtual void DoWrite(BaseData::Pointer data) { if (CanWriteBaseDataType(data)) { this->SetInput(dynamic_cast(data.GetPointer())); this->Update(); } } protected: NrrdTbssImageWriter(); virtual ~NrrdTbssImageWriter(); virtual void GenerateData(); std::string m_FileName; std::string m_FilePrefix; std::string m_FilePattern; bool m_Success; std::string RetrieveString(mitk::TbssImage::MetaDataFunction meta); }; } // end of namespace mitk #endif diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageWriterFactory.cpp b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageWriterFactory.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageWriterFactory.cpp rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageWriterFactory.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageWriterFactory.h b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageWriterFactory.h similarity index 90% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageWriterFactory.h rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageWriterFactory.h index 304dbce9a0..c312eb6097 100644 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssImageWriterFactory.h +++ b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssImageWriterFactory.h @@ -1,68 +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. ===================================================================*/ #ifndef NRRDTBSSIMAGE_WRITERFACTORY_H_HEADER_INCLUDED #define NRRDTBSSIMAGE_WRITERFACTORY_H_HEADER_INCLUDED #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" -#include "MitkDiffusionImagingExports.h" -#include "MitkDiffusionImagingExports.h" +#include "QuantificationExports.h" +#include "QuantificationExports.h" namespace mitk { -class MitkDiffusionImaging_EXPORT NrrdTbssImageWriterFactory : public itk::ObjectFactoryBase +class Quantification_EXPORT NrrdTbssImageWriterFactory : public itk::ObjectFactoryBase { public: mitkClassMacro( mitk::NrrdTbssImageWriterFactory, itk::ObjectFactoryBase ) /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); /** Register one factory of this type */ static void RegisterOneFactory(void) { static bool IsRegistered = false; if ( !IsRegistered ) { mitk::NrrdTbssImageWriterFactory::Pointer fac = mitk::NrrdTbssImageWriterFactory::New(); ObjectFactoryBase::RegisterFactory( fac ); IsRegistered = true; } } protected: NrrdTbssImageWriterFactory(); ~NrrdTbssImageWriterFactory(); private: NrrdTbssImageWriterFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif // NRRDTBSSIMAGE_WRITERFACTORY_H_HEADER_INCLUDED diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageIOFactory.cpp b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageIOFactory.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageIOFactory.cpp rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageIOFactory.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageIOFactory.h b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageIOFactory.h similarity index 94% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageIOFactory.h rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageIOFactory.h index 7b2cd6f632..52ca7283bb 100644 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageIOFactory.h +++ b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageIOFactory.h @@ -1,77 +1,77 @@ /*=================================================================== 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_NRRD_TBSSROI_VOLUMES_IO_FACTORY_H_HEADER__ #define __MITK_NRRD_TBSSROI_VOLUMES_IO_FACTORY_H_HEADER__ #ifdef _MSC_VER #pragma warning ( disable : 4786 ) #endif #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" -#include "MitkDiffusionImagingExports.h" +#include "QuantificationExports.h" namespace mitk { //##Documentation //## @brief Create instances of NrrdDiffusionImageReader objects using an object factory. //## //## @ingroup IO -class MitkDiffusionImaging_EXPORT NrrdTbssRoiImageIOFactory : public itk::ObjectFactoryBase +class Quantification_EXPORT NrrdTbssRoiImageIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ typedef NrrdTbssRoiImageIOFactory Self; typedef itk::ObjectFactoryBase Superclass; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self); static NrrdTbssRoiImageIOFactory* FactoryNew() { return new NrrdTbssRoiImageIOFactory;} /** Run-time type information (and related methods). */ itkTypeMacro(NrrdTbssRoiImageIOFactory, ObjectFactoryBase); /** Register one factory of this type */ static void RegisterOneFactory(void) { static bool IsRegistered = false; if ( !IsRegistered ) { NrrdTbssRoiImageIOFactory::Pointer fac = NrrdTbssRoiImageIOFactory::New(); ObjectFactoryBase::RegisterFactory( fac ); IsRegistered = true; } } protected: NrrdTbssRoiImageIOFactory(); ~NrrdTbssRoiImageIOFactory(); private: NrrdTbssRoiImageIOFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif // __MITK_NRRD_TBSS_VOULMES_IO_FACTORY_H_HEADER__ diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageReader.cpp b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageReader.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageReader.cpp rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageReader.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageReader.h b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageReader.h similarity index 94% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageReader.h rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageReader.h index 3701c39c83..dbc59fdfdf 100644 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageReader.h +++ b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageReader.h @@ -1,79 +1,79 @@ /*=================================================================== 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 __mitkNrrdTbssRoiImageReader_h #define __mitkNrrdTbssRoiImageReader_h #include "mitkCommon.h" #include "mitkFileReader.h" #include "mitkTbssRoiImageSource.h" #include "itkImage.h" #include "mitkTbssRoiImage.h" namespace mitk { /** \brief */ - class MitkDiffusionImaging_EXPORT NrrdTbssRoiImageReader : public mitk::TbssRoiImageSource, public FileReader + class Quantification_EXPORT NrrdTbssRoiImageReader : public mitk::TbssRoiImageSource, public FileReader { public: typedef mitk::TbssRoiImage OutputType; typedef itk::Image ImageType; typedef TbssRoiImageSource TbssVolSourceType; mitkClassMacro( NrrdTbssRoiImageReader, TbssVolSourceType ) itkNewMacro(Self) const char* GetFileName() const; void SetFileName(const char* aFileName); const char* GetFilePrefix() const; void SetFilePrefix(const char* aFilePrefix); const char* GetFilePattern() const; void SetFilePattern(const char* aFilePattern); static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern); protected: /** Does the real work. */ virtual void GenerateData(); void ReadRoiInfo(itk::MetaDataDictionary dict); std::string m_FileName; std::string m_FilePrefix; std::string m_FilePattern; OutputType::Pointer m_OutputCache; itk::TimeStamp m_CacheTime; private: void operator=(const Self&); //purposely not implemented }; } //namespace MITK //#include "mitkNrrdTbssRoiImageReader.cpp" #endif // __mitkNrrdTbssImageReader_h diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriter.cpp b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriter.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriter.cpp rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriter.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriter.h b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriter.h similarity index 95% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriter.h rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriter.h index 79bb723a93..589fe0dbcc 100644 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriter.h +++ b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriter.h @@ -1,140 +1,140 @@ /*=================================================================== 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_NRRDTBSSROIVOL_WRITER__H_ #define _MITK_NRRDTBSSROIVOL_WRITER__H_ #include #include #include #include -#include "MitkDiffusionImagingExports.h" +#include "QuantificationExports.h" namespace mitk { /** * Writes diffusion volumes to a file * @ingroup Process */ -class MitkDiffusionImaging_EXPORT NrrdTbssRoiImageWriter : public mitk::FileWriterWithInformation +class Quantification_EXPORT NrrdTbssRoiImageWriter : public mitk::FileWriterWithInformation { public: typedef itk::Image ImageType; mitkClassMacro( NrrdTbssRoiImageWriter, mitk::FileWriterWithInformation ) mitkWriterMacro itkNewMacro( Self ) typedef mitk::TbssRoiImage InputType; /** * Sets the filename of the file to write. * @param FileName the nameInputType of the file to write. */ itkSetStringMacro( FileName ); /** * @returns the name of the file to be written to disk. */ itkGetStringMacro( FileName ); /** * @warning multiple write not (yet) supported */ itkSetStringMacro( FilePrefix ); /** * @warning multiple write not (yet) supported */ itkGetStringMacro( FilePrefix ); /** * @warning multiple write not (yet) supported */ itkSetStringMacro( FilePattern ); /** * @warning multiple write not (yet) supported */ itkGetStringMacro( FilePattern ); /**image * Sets the input object for the filter. * @param input the diffusion volumes to write to file. */ void SetInput( InputType* input ); /** * @returns the 0'th input object of the filter. */ InputType* GetInput(); /** * Returns false if an error happened during writing */ itkGetMacro( Success, bool ); /** * @return possible file extensions for the data type associated with the writer */ virtual std::vector GetPossibleFileExtensions(); // FileWriterWithInformation methods virtual const char * GetDefaultFilename() { return "TbssRoiImage.roi"; } virtual const char * GetFileDialogPattern() { return "Tbss Roi Images (*.roi)"; } virtual const char * GetDefaultExtension() { return ".roi"; } virtual bool CanWriteBaseDataType(BaseData::Pointer data) { return (dynamic_cast(data.GetPointer()) != NULL); } virtual void DoWrite(BaseData::Pointer data) { if (CanWriteBaseDataType(data)) { this->SetInput(dynamic_cast(data.GetPointer())); this->Update(); } } protected: NrrdTbssRoiImageWriter(); virtual ~NrrdTbssRoiImageWriter(); virtual void GenerateData(); std::string m_FileName; std::string m_FilePrefix; std::string m_FilePattern; bool m_Success; }; } // end of namespace mitk //#include "mitkNrrdTbssRoiImageWriter.cpp" #endif diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriterFactory.cpp b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriterFactory.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriterFactory.cpp rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriterFactory.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriterFactory.h b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriterFactory.h similarity index 90% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriterFactory.h rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriterFactory.h index 3829ce35e0..1c85b3072a 100644 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriterFactory.h +++ b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkNrrdTbssRoiImageWriterFactory.h @@ -1,68 +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. ===================================================================*/ #ifndef NRRDTBSSROIIMAGE_WRITERFACTORY_H_HEADER_INCLUDED #define NRRDTBSSROIIMAGE_WRITERFACTORY_H_HEADER_INCLUDED #include "itkObjectFactoryBase.h" #include "mitkBaseData.h" -#include "MitkDiffusionImagingExports.h" -#include "MitkDiffusionImagingExports.h" +#include "QuantificationExports.h" +#include "QuantificationExports.h" namespace mitk { -class MitkDiffusionImaging_EXPORT NrrdTbssRoiImageWriterFactory : public itk::ObjectFactoryBase +class Quantification_EXPORT NrrdTbssRoiImageWriterFactory : public itk::ObjectFactoryBase { public: mitkClassMacro( mitk::NrrdTbssRoiImageWriterFactory, itk::ObjectFactoryBase ) /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; virtual const char* GetDescription(void) const; /** Method for class instantiation. */ itkFactorylessNewMacro(Self) /** Register one factory of this type */ static void RegisterOneFactory(void) { static bool IsRegistered = false; if ( !IsRegistered ) { mitk::NrrdTbssRoiImageWriterFactory::Pointer fac = mitk::NrrdTbssRoiImageWriterFactory::New(); ObjectFactoryBase::RegisterFactory( fac ); IsRegistered = true; } } protected: NrrdTbssRoiImageWriterFactory(); ~NrrdTbssRoiImageWriterFactory(); private: NrrdTbssRoiImageWriterFactory(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace mitk #endif // NRRDTBSSIMAGE_WRITERFACTORY_H_HEADER_INCLUDED diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImage.cpp b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssImage.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImage.cpp rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssImage.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImage.h b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssImage.h similarity index 97% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImage.h rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssImage.h index e55b1713b9..73d79741e3 100644 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImage.h +++ b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssImage.h @@ -1,184 +1,184 @@ /*=================================================================== 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 __mitkTbssImage__h #define __mitkTbssImage__h #include "mitkImage.h" #include "itkVectorImage.h" #include "mitkImageCast.h" -#include "MitkDiffusionImagingExports.h" +#include "QuantificationExports.h" namespace mitk { /** * \brief this class encapsulates diffusion volumes (vectorimages not * yet supported by mitkImage) */ - class MitkDiffusionImaging_EXPORT TbssImage : public Image + class Quantification_EXPORT TbssImage : public Image { public: typedef itk::VectorImage ImageType; typedef itk::Index<3> IndexType; //typedef typename std::vector > RoiType; mitkClassMacro( TbssImage, Image ) itkNewMacro(Self) enum MetaDataFunction { MEAN_FA_SKELETON, MEAN_FA_SKELETON_MASK, GRADIENT_X, GRADIENT_Y, GRADIENT_Z, TUBULAR_STRUCTURE, DISTANCE_MAP, MISC }; //void SetRequestedRegionToLargestPossibleReg tbssRoi->SetTbssType(mitk::TbssImage::ROI);ion(); //bool RequestedRegionIsOutsideOfTheBufferedRegion(); //virtual bool VerifyRequestedRegion(); //void SetRequestedRegion(itk::DataObject *data); ImageType::Pointer GetImage() { return m_Image; } void SetImage(ImageType::Pointer image ) { this->m_Image = image; } void InitializeFromImage() { MITK_INFO << "make an mitk image that can be shown by mitk"; this->InitializeByItk(m_Image.GetPointer(),1,1); } void SetGroupInfo( std::vector< std::pair > info) { m_GroupInfo = info; } std::vector< std::pair > GetGroupInfo() { return m_GroupInfo; } void SetMetaInfo( std::vector< std::pair > info) { m_MetaInfo = info; } std::vector< std::pair > GetMetaInfo() { return m_MetaInfo; } void SetMeasurementInfo(std::string s) { m_MeasurementInfo = s; } std::string GetMeasurementInfo() { return m_MeasurementInfo; } void InitializeFromVectorImage(); void SetDisplayIndexForRendering(int displayIndex); itkGetMacro(IsMeta, bool) itkGetMacro(ContainsGradient, bool) itkGetMacro(ContainsMeanSkeleton, bool) itkGetMacro(ContainsSkeletonMask, bool) itkGetMacro(ContainsDistanceMap, bool) itkSetMacro(IsMeta, bool) itkSetMacro(ContainsGradient, bool) itkSetMacro(ContainsMeanSkeleton, bool) itkSetMacro(ContainsSkeletonMask, bool) itkSetMacro(ContainsDistanceMap, bool) protected: TbssImage(); virtual ~TbssImage(){} ImageType::Pointer m_Image; std::vector< std::pair > m_GroupInfo; std::vector< std::pair > m_MetaInfo; int m_DisplayIndex; std::string m_MeasurementInfo; bool m_IsMeta; bool m_ContainsGradient; bool m_ContainsMeanSkeleton; bool m_ContainsSkeletonMask; bool m_ContainsDistanceMap; }; /* // Does the same es the normal CastToMitkImage, but needed to reimplemented due to the templatet pixeltype template void CastToTbssImage(const ItkOutputImageType* itkimage, itk::SmartPointer< mitk::TbssImage >& tbssoutputimage) { if(tbssoutputimage.IsNull()) { tbssoutputimage = mitk::TbssImage::New(); } tbssoutputimage->InitializeByItk(itkimage); tbssoutputimage->SetChannel(itkimage->GetBufferPointer()); } */ } // namespace mitk //#include "mitkTbssImage.cpp" #endif /* __mitkTbssImage__h */ diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImageSource.cpp b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssImageSource.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImageSource.cpp rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssImageSource.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImageSource.h b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssImageSource.h similarity index 93% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImageSource.h rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssImageSource.h index 0898e982af..2e1379f2a9 100644 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImageSource.h +++ b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssImageSource.h @@ -1,75 +1,75 @@ /*=================================================================== 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_TBSS_IMAGE_DATA_SOURCE_H_HEADER_ #define _MITK_TBSS_IMAGE_DATA_SOURCE_H_HEADER_ // Should be changed in a new type for TBSS #include "mitkImageSource.h" -#include "MitkDiffusionImagingExports.h" +#include "QuantificationExports.h" namespace mitk { class TbssImage; //##Documentation //## @brief Superclass of all classes generating diffusion volumes (instances //## of class DiffusionImage) as output. //## //## @ingroup Process -class MitkDiffusionImaging_EXPORT TbssImageSource : public ImageSource +class Quantification_EXPORT TbssImageSource : public ImageSource { public: mitkClassMacro(TbssImageSource, BaseProcess) itkNewMacro(Self) typedef TbssImage OutputType; typedef itk::DataObject::Pointer DataObjectPointer; virtual DataObjectPointer MakeOutput(unsigned int idx); //OutputType * GetOutput(unsigned int idx); //void SetOutput(OutputType* output); //OutputType* GetOutput() //{return Superclass::GetOutput();} OutputType* GetOutput(unsigned int idx); //virtual void GraftOutput(OutputType* graft); //virtual void GraftNthOutput(unsigned int idx, OutputType *graft); protected: TbssImageSource(); virtual ~TbssImageSource(){} }; } // namespace mitk //#include "mitkTbssImageSource.cpp" #endif /* _MITK_DIFFUSION_IMAGE_DATA_SOURCE_H_HEADER_ */ diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.cpp b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssImporter.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.cpp rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssImporter.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.h b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssImporter.h similarity index 95% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.h rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssImporter.h index 5e005dd688..b5b4930d4d 100644 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.h +++ b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssImporter.h @@ -1,115 +1,115 @@ /*=================================================================== 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 __mitkTbssImporter_h #define __mitkTbssImporter_h #include "mitkCommon.h" #include "mitkFileReader.h" #include "itkImage.h" #include "itkVectorImage.h" #include "itkImageFileReader.h" #include "mitkTbssImage.h" -#include "MitkDiffusionImagingExports.h" +#include "QuantificationExports.h" namespace mitk { //template - class MitkDiffusionImaging_EXPORT TbssImporter : public itk::Object { + class Quantification_EXPORT TbssImporter : public itk::Object { public: // typedef TPixelType PixelType; typedef itk::VectorImage DataImageType; // type of the 3d vector image containing the skeletonized images typedef itk::VectorImage VectorImageType; // Datatype of the tbss gradient images typedef itk::Image FloatImage4DType; typedef itk::ImageFileReader FileReaderType4D; typedef itk::ImageFileReader VectorReaderType; typedef itk::Image FloatImage3DType; typedef itk::ImageFileReader FileReaderType3D; mitkClassMacro( TbssImporter, Object ) itkNewMacro(Self) mitk::TbssImage::Pointer Import(); mitk::TbssImage::Pointer ImportMeta(); void SetGroupInfo(std::vector< std::pair > groups) { m_Groups = groups; } std::vector< std::pair > GetGroupInfo() { return m_Groups; } void SetTbssDatasets(std::vector< std::pair > files) { m_MetaFiles = files; } void SetMeasurementInfo(std::string s) { m_MeasurementInfo = s; } std::string GetMeasurementInfo() { return m_MeasurementInfo; } void SetImportVolume(mitk::Image::Pointer inputVolume) { m_InputVolume = inputVolume; } protected: TbssImporter(){} virtual ~TbssImporter(){} DataImageType::Pointer m_Data; std::vector< std::pair > m_Groups; std::vector< std::pair > m_MetaFiles; std::string m_MeasurementInfo; mitk::Image::Pointer m_InputVolume; mitk::TbssImage::MetaDataFunction RetrieveTbssFunction(std::string s); }; } //#include "mitkTbssImporter.cpp" #endif // __mitkTbssImporter_h diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssRoiImage.cpp b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssRoiImage.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssRoiImage.cpp rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssRoiImage.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssRoiImage.h b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssRoiImage.h similarity index 96% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssRoiImage.h rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssRoiImage.h index f95512efdc..d11743670f 100644 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssRoiImage.h +++ b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssRoiImage.h @@ -1,132 +1,132 @@ /*=================================================================== 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 __mitkTbssRoiImage__h #define __mitkTbssRoiImage__h #include "mitkImage.h" #include "itkImage.h" #include "mitkImageCast.h" -#include "MitkDiffusionImagingExports.h" +#include "QuantificationExports.h" namespace mitk { /** * \brief this class encapsulates diffusion volumes (vectorimages not * yet supported by mitkImage) */ - class MitkDiffusionImaging_EXPORT TbssRoiImage : public Image + class Quantification_EXPORT TbssRoiImage : public Image { public: typedef itk::Image ImageType; typedef itk::Index<3> IndexType; //typedef typename std::vector > RoiType; mitkClassMacro( TbssRoiImage, Image ) itkNewMacro(Self) //void SetRequestedRegionToLargestPossibleRegion(); //bool RequestedRegionIsOutsideOfTheBufferedRegion(); //virtual bool VerifyRequestedRegion(); //void SetRequestedRegion(itk::DataObject *data); ImageType::Pointer GetImage() { return m_Image; } void SetImage(ImageType::Pointer image ) { this->m_Image = image; } itkGetMacro(PreprocessedFA, bool) itkSetMacro(PreprocessedFA, bool) itkGetMacro(PreprocessedFAFile, std::string) itkSetMacro(PreprocessedFAFile, std::string) itkGetMacro(Structure, std::string) itkSetMacro(Structure, std::string) void SetRoi(std::vector< itk::Index<3> > roi) { m_Roi = roi; } // depricated std::vector< itk::Index<3> > GetRoi() { return m_Roi; } void InitializeFromImage() { MITK_INFO << "make an mitk image that can be shown by mitk"; this->InitializeByItk(m_Image.GetPointer()); this->SetChannel(m_Image->GetBufferPointer()); } protected: TbssRoiImage(); virtual ~TbssRoiImage(){} ImageType::Pointer m_Image; std::vector< itk::Index<3> > m_Roi; bool m_PreprocessedFA; std::string m_PreprocessedFAFile; std::string m_Structure; }; // Does the same es the normal CastToMitkImage, but needed to reimplemented due to the templatet pixeltype /* template void CastToTbssImage(const ItkOutputImageType* itkimage, itk::SmartPointer< mitk::TbssRoiImage >& tbssoutputimage) { if(tbssoutputimage.IsNull()) { tbssoutputimage = mitk::TbssRoiImage::New(); } tbssoutputimage->InitializeByItk(itkimage); tbssoutputimage->SetChannel(itkimage->GetBufferPointer()); } */ } // namespace mitk //#include "mitkTbssRoiImage.cpp" #endif /* __mitkTbssRoiImage__h */ diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssRoiImageSource.cpp b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssRoiImageSource.cpp similarity index 100% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssRoiImageSource.cpp rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssRoiImageSource.cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssRoiImageSource.h b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssRoiImageSource.h similarity index 93% rename from Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssRoiImageSource.h rename to Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssRoiImageSource.h index 3ad3f4566d..993fa324fa 100644 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssRoiImageSource.h +++ b/Modules/DiffusionImaging/Quantification/IODataStructures/TbssImages/mitkTbssRoiImageSource.h @@ -1,75 +1,75 @@ /*=================================================================== 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_TBSS_ROI_IMAGE_DATA_SOURCE_H_HEADER_ #define _MITK_TBSS_ROI_IMAGE_DATA_SOURCE_H_HEADER_ // Should be changed in a new type for TBSS #include "mitkImageSource.h" -#include "MitkDiffusionImagingExports.h" +#include "QuantificationExports.h" namespace mitk { class TbssRoiImage; //##Documentation //## @brief Superclass of all classes generating diffusion volumes (instances //## of class DiffusionImage) as output. //## //## @ingroup Process -class MitkDiffusionImaging_EXPORT TbssRoiImageSource : public ImageSource +class Quantification_EXPORT TbssRoiImageSource : public ImageSource { public: mitkClassMacro(TbssRoiImageSource, BaseProcess) itkNewMacro(Self) typedef TbssRoiImage OutputType; typedef itk::DataObject::Pointer DataObjectPointer; virtual DataObjectPointer MakeOutput(unsigned int idx); OutputType * GetOutput(unsigned int idx); //void SetOutput(OutputType* output); OutputType* GetOutput(); //{return Superclass::GetOutput();} //OutputType* GetOutput(unsigned int idx); //virtual void GraftOutput(OutputType* graft); //virtual void GraftNthOutput(unsigned int idx, OutputType *graft); protected: TbssRoiImageSource(); virtual ~TbssRoiImageSource(){} }; } // namespace mitk //#include "mitkTbssRoiImageSource.cpp" #endif /* _MITK_DIFFUSION_IMAGE_DATA_SOURCE_H_HEADER_ */ diff --git a/Modules/DiffusionImaging/Quantification/IODataStructures/mitkQuantificationObjectFactory.cpp b/Modules/DiffusionImaging/Quantification/IODataStructures/mitkQuantificationObjectFactory.cpp new file mode 100644 index 0000000000..12045d0c3e --- /dev/null +++ b/Modules/DiffusionImaging/Quantification/IODataStructures/mitkQuantificationObjectFactory.cpp @@ -0,0 +1,168 @@ +/*=================================================================== + +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 "mitkQuantificationObjectFactory.h" + +#include "mitkTbssImageMapper.h" + +#include "mitkNrrdTbssImageIOFactory.h" +#include "mitkNrrdTbssImageWriterFactory.h" +#include "mitkNrrdTbssImageWriter.h" + +#include "mitkNrrdTbssRoiImageIOFactory.h" +#include "mitkNrrdTbssRoiImageWriterFactory.h" +#include "mitkNrrdTbssRoiImageWriter.h" + +#include "mitkVolumeDataVtkMapper3D.h" +#include "mitkGPUVolumeMapper3D.h" + +typedef char TbssRoiPixelType; +typedef float TbssPixelType; +typedef int TbssGradientPixelType; + +mitk::QuantificationObjectFactory::QuantificationObjectFactory(bool /*registerSelf*/) +:CoreObjectFactoryBase() +{ + + static bool alreadyDone = false; + if (!alreadyDone) + { + MITK_DEBUG << "QuantificationObjectFactory c'tor" << std::endl; + RegisterIOFactories(); + + mitk::NrrdTbssImageIOFactory::RegisterOneFactory(); + mitk::NrrdTbssRoiImageIOFactory::RegisterOneFactory(); + + mitk::NrrdTbssImageWriterFactory::RegisterOneFactory(); + mitk::NrrdTbssRoiImageWriterFactory::RegisterOneFactory(); + + m_FileWriters.push_back( NrrdTbssImageWriter::New().GetPointer() ); + m_FileWriters.push_back( NrrdTbssRoiImageWriter::New().GetPointer() ); + + mitk::CoreObjectFactory::GetInstance()->RegisterExtraFactory(this); + CreateFileExtensionsMap(); + + alreadyDone = true; + } + +} + +mitk::Mapper::Pointer mitk::QuantificationObjectFactory::CreateMapper(mitk::DataNode* node, MapperSlotId id) +{ + mitk::Mapper::Pointer newMapper=NULL; + + if ( id == mitk::BaseRenderer::Standard2D ) + { + std::string classname = "TbssRoiImage"; + if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) + { + newMapper = mitk::ImageVtkMapper2D::New(); + newMapper->SetDataNode(node); + } + + classname = "TbssImage"; + if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) + { + newMapper = mitk::TbssImageMapper::New(); + newMapper->SetDataNode(node); + } + + } + else if ( id == mitk::BaseRenderer::Standard3D ) + { + std::string classname = "TbssRoiImage"; + if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) + { + newMapper = mitk::VolumeDataVtkMapper3D::New(); + newMapper->SetDataNode(node); + } + + classname = "TbssImage"; + if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) + { + newMapper = mitk::TbssImageMapper::New(); + newMapper->SetDataNode(node); + } + + } + + return newMapper; +} + +void mitk::QuantificationObjectFactory::SetDefaultProperties(mitk::DataNode* node) +{ + std::string classname = "TbssRoiImage"; + if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) + { + mitk::ImageVtkMapper2D::SetDefaultProperties(node); + mitk::VolumeDataVtkMapper3D::SetDefaultProperties(node); + } + + classname = "TbssImage"; + if(node->GetData() && classname.compare(node->GetData()->GetNameOfClass())==0) + { + mitk::TbssImageMapper::SetDefaultProperties(node); + mitk::GPUVolumeMapper3D::SetDefaultProperties(node); + } +} + +const char* mitk::QuantificationObjectFactory::GetFileExtensions() +{ + std::string fileExtension; + this->CreateFileExtensions(m_FileExtensionsMap, fileExtension); + return fileExtension.c_str(); +}; + +mitk::CoreObjectFactoryBase::MultimapType mitk::QuantificationObjectFactory::GetFileExtensionsMap() +{ + return m_FileExtensionsMap; +} + +const char* mitk::QuantificationObjectFactory::GetSaveFileExtensions() +{ + std::string fileExtension; + this->CreateFileExtensions(m_SaveFileExtensionsMap, fileExtension); + return fileExtension.c_str(); +}; + +mitk::CoreObjectFactoryBase::MultimapType mitk::QuantificationObjectFactory::GetSaveFileExtensionsMap() +{ + return m_SaveFileExtensionsMap; +} + +void mitk::QuantificationObjectFactory::CreateFileExtensionsMap() +{ + m_FileExtensionsMap.insert(std::pair("*.tbss", "TBSS data")); + m_FileExtensionsMap.insert(std::pair("*.roi", "TBSS ROI data")); + + m_SaveFileExtensionsMap.insert(std::pair("*.tbss", "TBSS data")); + m_SaveFileExtensionsMap.insert(std::pair("*.roi", "TBSS ROI data")); +} + +void mitk::QuantificationObjectFactory::RegisterIOFactories() +{ +} + +void RegisterQuantificationObjectFactory() +{ + static bool oneQuantificationObjectFactoryRegistered = false; + if ( ! oneQuantificationObjectFactoryRegistered ) { + MITK_DEBUG << "Registering QuantificationObjectFactory..." << std::endl; + mitk::CoreObjectFactory::GetInstance()->RegisterExtraFactory(mitk::QuantificationObjectFactory::New()); + + oneQuantificationObjectFactoryRegistered = true; + } +} diff --git a/Modules/DiffusionImaging/Quantification/IODataStructures/mitkQuantificationObjectFactory.h b/Modules/DiffusionImaging/Quantification/IODataStructures/mitkQuantificationObjectFactory.h new file mode 100644 index 0000000000..abd9173869 --- /dev/null +++ b/Modules/DiffusionImaging/Quantification/IODataStructures/mitkQuantificationObjectFactory.h @@ -0,0 +1,39 @@ +#ifndef MITKQUANTIFICATIONOBJECTFACTORY_H +#define MITKQUANTIFICATIONOBJECTFACTORY_H + + +#include "mitkCoreObjectFactory.h" +#include + +namespace mitk { + +class Quantification_EXPORT QuantificationObjectFactory : public CoreObjectFactoryBase +{ + public: + mitkClassMacro(QuantificationObjectFactory,CoreObjectFactoryBase); + itkNewMacro(QuantificationObjectFactory); + + virtual Mapper::Pointer CreateMapper(mitk::DataNode* node, MapperSlotId slotId); + virtual void SetDefaultProperties(mitk::DataNode* node); + virtual const char* GetFileExtensions(); + virtual mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap(); + virtual const char* GetSaveFileExtensions(); + virtual mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap(); + void RegisterIOFactories(); + protected: + QuantificationObjectFactory(bool registerSelf = true); + private: + void CreateFileExtensionsMap(); + std::string m_ExternalFileExtensions; + std::string m_InternalFileExtensions; + std::string m_SaveFileExtensions; + MultimapType m_FileExtensionsMap; + MultimapType m_SaveFileExtensionsMap; +}; + +} +// global declaration for simple call by +// applications +void Quantification_EXPORT RegisterQuantificationObjectFactory(); + +#endif // MITKQUANTIFICATIONOBJECTFACTORY_H diff --git a/Modules/DiffusionImaging/Rendering/mitkTbssImageMapper.cpp b/Modules/DiffusionImaging/Quantification/Rendering/mitkTbssImageMapper.cpp similarity index 100% rename from Modules/DiffusionImaging/Rendering/mitkTbssImageMapper.cpp rename to Modules/DiffusionImaging/Quantification/Rendering/mitkTbssImageMapper.cpp diff --git a/Modules/DiffusionImaging/Rendering/mitkTbssImageMapper.h b/Modules/DiffusionImaging/Quantification/Rendering/mitkTbssImageMapper.h similarity index 90% rename from Modules/DiffusionImaging/Rendering/mitkTbssImageMapper.h rename to Modules/DiffusionImaging/Quantification/Rendering/mitkTbssImageMapper.h index 3ff1e7ad71..71d54f6c96 100644 --- a/Modules/DiffusionImaging/Rendering/mitkTbssImageMapper.h +++ b/Modules/DiffusionImaging/Quantification/Rendering/mitkTbssImageMapper.h @@ -1,54 +1,54 @@ /*=================================================================== 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 TbssImageMapper_H_HEADER_INCLUDED #define TbssImageMapper_H_HEADER_INCLUDED #include "mitkImageVtkMapper2D.h" -#include "MitkDiffusionImagingExports.h" +#include "QuantificationExports.h" namespace mitk { //##Documentation //## @brief Mapper for raw diffusion weighted images //## @ingroup Mapper - class MitkDiffusionImaging_EXPORT TbssImageMapper : public ImageVtkMapper2D + class Quantification_EXPORT TbssImageMapper : public ImageVtkMapper2D { public: mitkClassMacro(TbssImageMapper,ImageVtkMapper2D); itkNewMacro(Self); void GenerateDataForRenderer( mitk::BaseRenderer *renderer ); static void SetDefaultProperties(DataNode* node, BaseRenderer* renderer = NULL, bool overwrite = false ); protected: TbssImageMapper(); virtual ~TbssImageMapper(); }; } // namespace mitk //#include "mitkTbssImageMapper.cpp" #endif /* TbssImageMapper_H_HEADER_INCLUDED */ diff --git a/Modules/DiffusionImaging/Quantification/Testing/CMakeLists.txt b/Modules/DiffusionImaging/Quantification/Testing/CMakeLists.txt new file mode 100644 index 0000000000..ecf8d583bc --- /dev/null +++ b/Modules/DiffusionImaging/Quantification/Testing/CMakeLists.txt @@ -0,0 +1,6 @@ +MITK_CREATE_MODULE_TESTS() + +mitkAddCustomModuleTest(mitkTbssNrrdImageReaderTest mitkTbssNrrdImageReaderTest ${MITK_DATA_DIR}/DiffusionImaging/tbss.tbss) +#mitkAddCustomModuleTest(mitkTbssRoiNrrdImageReaderTest mitkTbssRoiNrrdImageReaderTest ${MITK_DATA_DIR}/DiffusionImaging/bodyfornix.roi) +mitkAddCustomModuleTest(mitkTbssNrrdImageWriterTest mitkTbssNrrdImageWriterTest ${MITK_DATA_DIR}/DiffusionImaging/tbss.tbss ${MITK_DATA_DIR}/DiffusionImaging/tbss2.tbss) + diff --git a/Modules/DiffusionImaging/Quantification/Testing/files.cmake b/Modules/DiffusionImaging/Quantification/Testing/files.cmake new file mode 100644 index 0000000000..8b339f2bd4 --- /dev/null +++ b/Modules/DiffusionImaging/Quantification/Testing/files.cmake @@ -0,0 +1,6 @@ +SET(MODULE_CUSTOM_TESTS + mitkTbssNrrdImageReaderTest.cpp + #mitkTbssRoiNrrdImageReaderTest.cpp + mitkTbssNrrdImageWriterTest.cpp +) + diff --git a/Modules/DiffusionImaging/Testing/mitkTbssNrrdImageReaderTest.cpp b/Modules/DiffusionImaging/Quantification/Testing/mitkTbssNrrdImageReaderTest.cpp similarity index 100% rename from Modules/DiffusionImaging/Testing/mitkTbssNrrdImageReaderTest.cpp rename to Modules/DiffusionImaging/Quantification/Testing/mitkTbssNrrdImageReaderTest.cpp diff --git a/Modules/DiffusionImaging/Testing/mitkTbssNrrdImageWriterTest.cpp b/Modules/DiffusionImaging/Quantification/Testing/mitkTbssNrrdImageWriterTest.cpp similarity index 100% rename from Modules/DiffusionImaging/Testing/mitkTbssNrrdImageWriterTest.cpp rename to Modules/DiffusionImaging/Quantification/Testing/mitkTbssNrrdImageWriterTest.cpp diff --git a/Modules/DiffusionImaging/Testing/mitkTbssRoiNrrdImageReaderTest.cpp b/Modules/DiffusionImaging/Quantification/Testing/mitkTbssRoiNrrdImageReaderTest.cpp similarity index 100% rename from Modules/DiffusionImaging/Testing/mitkTbssRoiNrrdImageReaderTest.cpp rename to Modules/DiffusionImaging/Quantification/Testing/mitkTbssRoiNrrdImageReaderTest.cpp diff --git a/Modules/DiffusionImaging/Quantification/files.cmake b/Modules/DiffusionImaging/Quantification/files.cmake new file mode 100644 index 0000000000..817dd133ab --- /dev/null +++ b/Modules/DiffusionImaging/Quantification/files.cmake @@ -0,0 +1,35 @@ +set(CPP_FILES + + # 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 + IODataStructures/mitkQuantificationObjectFactory.cpp + + # Rendering + Rendering/mitkTbssImageMapper.cpp +) + +set(H_FILES + # DataStructures + IODataStructures/TbssImages/mitkTbssImporter.h + + # Rendering + Rendering/mitkTbssImageMapper.h + + Algorithms/itkRegularizedIVIMLocalVariationImageFilter.h + Algorithms/itkRegularizedIVIMReconstructionFilter.h + Algorithms/itkRegularizedIVIMReconstructionSingleIteration.h +) \ No newline at end of file diff --git a/Modules/DiffusionImaging/Testing/files.cmake b/Modules/DiffusionImaging/Testing/files.cmake deleted file mode 100644 index 58d367ace6..0000000000 --- a/Modules/DiffusionImaging/Testing/files.cmake +++ /dev/null @@ -1,17 +0,0 @@ -SET(MODULE_CUSTOM_TESTS - mitkFiberBundleXReaderWriterTest.cpp - - mitkFiberBundleXTest.cpp - mitkGibbsTrackingTest.cpp - - mitkTbssNrrdImageReaderTest.cpp - #mitkTbssRoiNrrdImageReaderTest.cpp - mitkTbssNrrdImageWriterTest.cpp - -) - -set(MODULE_TESTS - mitkFactoryRegistrationTest.cpp - mitkConnectomicsNetworkTest.cpp -) - diff --git a/Modules/DiffusionImaging/files.cmake b/Modules/DiffusionImaging/files.cmake deleted file mode 100644 index 14bf0c87b7..0000000000 --- a/Modules/DiffusionImaging/files.cmake +++ /dev/null @@ -1,282 +0,0 @@ -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/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 ) diff --git a/Plugins/org.mitk.diffusionimaging/CMakeLists.txt b/Plugins/org.mitk.diffusionimaging/CMakeLists.txt index 10174a592c..ba767e783a 100644 --- a/Plugins/org.mitk.diffusionimaging/CMakeLists.txt +++ b/Plugins/org.mitk.diffusionimaging/CMakeLists.txt @@ -1,7 +1,7 @@ project(org_mitk_diffusionimaging) MACRO_CREATE_MITK_CTK_PLUGIN( EXPORT_DIRECTIVE ORG_MITK_DIFFUSIONIMAGING_EXPORT EXPORTED_INCLUDE_SUFFIXES src - MODULE_DEPENDENCIES MitkDiffusionImaging QmitkExt + MODULE_DEPENDENCIES DiffusionCore Quantification FiberTracking Connectomics QmitkExt ) diff --git a/Plugins/org.mitk.diffusionimaging/src/internal/mitkDiffusionImagingActivator.cpp b/Plugins/org.mitk.diffusionimaging/src/internal/mitkDiffusionImagingActivator.cpp index 9afbffda13..7188e11e8d 100644 --- a/Plugins/org.mitk.diffusionimaging/src/internal/mitkDiffusionImagingActivator.cpp +++ b/Plugins/org.mitk.diffusionimaging/src/internal/mitkDiffusionImagingActivator.cpp @@ -1,62 +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 "mitkDiffusionImagingActivator.h" -#include "mitkDiffusionImagingObjectFactory.h" +#include "mitkDiffusionCoreObjectFactory.h" +#include "mitkConnectomicsObjectFactory.h" +#include "mitkFiberTrackingObjectFactory.h" +#include "mitkQuantificationObjectFactory.h" #include "QmitkNodeDescriptorManager.h" #include "mitkNodePredicateDataType.h" #include void mitk::DiffusionImagingActivator::start(ctkPluginContext* context) { Q_UNUSED(context) - RegisterDiffusionImagingObjectFactory(); + RegisterDiffusionCoreObjectFactory(); + RegisterFiberTrackingObjectFactory(); + RegisterConnectomicsObjectFactory(); + RegisterQuantificationObjectFactory(); QmitkNodeDescriptorManager* manager = QmitkNodeDescriptorManager::GetInstance(); mitk::NodePredicateDataType::Pointer isDiffusionImage = mitk::NodePredicateDataType::New("DiffusionImage"); QmitkNodeDescriptor* desc = new QmitkNodeDescriptor(QObject::tr("DiffusionImage"), QString(":/QmitkDiffusionImaging/QBallData24.png"), isDiffusionImage, manager); manager->AddDescriptor(desc); mitk::NodePredicateDataType::Pointer isTensorImage = mitk::NodePredicateDataType::New("TensorImage"); manager->AddDescriptor(new QmitkNodeDescriptor(QObject::tr("TensorImage"), QString(":/QmitkDiffusionImaging/recontensor.png"), isTensorImage, manager)); mitk::NodePredicateDataType::Pointer isQBallImage = mitk::NodePredicateDataType::New("QBallImage"); manager->AddDescriptor(new QmitkNodeDescriptor(QObject::tr("QBallImage"), QString(":/QmitkDiffusionImaging/reconodf.png"), isQBallImage, manager)); mitk::NodePredicateDataType::Pointer isFiberBundle = mitk::NodePredicateDataType::New("FiberBundle"); manager->AddDescriptor(new QmitkNodeDescriptor(QObject::tr("FiberBundle"), QString(":/QmitkDiffusionImaging/FiberBundle.png"), isFiberBundle, manager)); mitk::NodePredicateDataType::Pointer isFiberBundleX = mitk::NodePredicateDataType::New("FiberBundleX"); manager->AddDescriptor(new QmitkNodeDescriptor(QObject::tr("FiberBundleX"), QString(":/QmitkDiffusionImaging/FiberBundleX.png"), isFiberBundleX, manager)); mitk::NodePredicateDataType::Pointer isConnectomicsNetwork = mitk::NodePredicateDataType::New("ConnectomicsNetwork"); manager->AddDescriptor(new QmitkNodeDescriptor(QObject::tr("ConnectomicsNetwork"), QString(":/QmitkDiffusionImaging/ConnectomicsNetwork.png"), isConnectomicsNetwork, manager)); } void mitk::DiffusionImagingActivator::stop(ctkPluginContext* context) { Q_UNUSED(context) } Q_EXPORT_PLUGIN2(org_mitk_diffusionimaging, mitk::DiffusionImagingActivator) diff --git a/Plugins/org.mitk.gui.qt.diffusionimaging/CMakeLists.txt b/Plugins/org.mitk.gui.qt.diffusionimaging/CMakeLists.txt index 0b6fabcce4..0d9ded573b 100644 --- a/Plugins/org.mitk.gui.qt.diffusionimaging/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.diffusionimaging/CMakeLists.txt @@ -1,7 +1,7 @@ project(org_mitk_gui_qt_diffusionimaging) MACRO_CREATE_MITK_CTK_PLUGIN( EXPORT_DIRECTIVE DIFFUSIONIMAGING_EXPORT EXPORTED_INCLUDE_SUFFIXES src - MODULE_DEPENDENCIES QmitkExt MitkDiffusionImaging + MODULE_DEPENDENCIES QmitkExt Connectomics FiberTracking DiffusionCore Quantification )