diff --git a/Modules/DiffusionImaging/DiffusionCore/Algorithms/Registration/mitkPyramidImageRegistrationMethod.cpp b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Registration/mitkPyramidImageRegistrationMethod.cpp new file mode 100644 index 0000000000..1c7332ead3 --- /dev/null +++ b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Registration/mitkPyramidImageRegistrationMethod.cpp @@ -0,0 +1,97 @@ +/*=================================================================== + +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 "mitkPyramidImageRegistrationMethod.h" + +#include "mitkException.h" +#include "mitkImageAccessByItk.h" + +mitk::PyramidImageRegistrationMethod::PyramidImageRegistrationMethod() + : m_FixedImage(NULL), + m_MovingImage(NULL), + m_CrossModalityRegistration(true), + m_UseAffineTransform(true), + m_EstimatedParameters(NULL), + m_Verbose(false) +{ + +} + +mitk::PyramidImageRegistrationMethod::~PyramidImageRegistrationMethod() +{ + if( m_EstimatedParameters != NULL) + { + delete [] m_EstimatedParameters; + } +} + +void mitk::PyramidImageRegistrationMethod::SetFixedImage(mitk::Image::Pointer fixed) +{ + if( fixed.IsNotNull() ) + { + m_FixedImage = fixed; + } +} + +void mitk::PyramidImageRegistrationMethod::SetMovingImage(mitk::Image::Pointer moving) +{ + if( moving.IsNotNull() ) + { + m_MovingImage = moving; + } +} + +void mitk::PyramidImageRegistrationMethod::Update() +{ + if( m_MovingImage.IsNull() ) + { + mitkThrow() << " Moving image is null"; + } + + if( m_FixedImage.IsNull() ) + { + mitkThrow() << " Moving image is null"; + } + + unsigned int allowedDimension = 3; + + if( m_FixedImage->GetDimension() != allowedDimension || + m_MovingImage->GetDimension() != allowedDimension ) + { + mitkThrow() << " Only 3D Images supported."; + } + + // + // One possibility: use the FixedDimesnionByItk, but this instantiates ALL possible + // pixel type combinations! + // AccessTwoImagesFixedDimensionByItk( m_FixedImage, m_MovingImage, RegisterTwoImages, 3); + // in helper: TypeSubset : short, float + AccessTwoImagesFixedDimensionTypeSubsetByItk( m_FixedImage, m_MovingImage, RegisterTwoImages, 3); + +} + +mitk::Image::Pointer mitk::PyramidImageRegistrationMethod +::GetResampledMovingImage() +{ + + mitk::Image::Pointer output = mitk::Image::New(); + //output->Initialize( this->m_FixedImage ); + + AccessFixedDimensionByItk_1( this->m_MovingImage, ResampleMitkImage, 3, output ); + + return output; + +} diff --git a/Modules/DiffusionImaging/DiffusionCore/Algorithms/Registration/mitkPyramidImageRegistrationMethod.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Registration/mitkPyramidImageRegistrationMethod.h new file mode 100644 index 0000000000..d14d19420d --- /dev/null +++ b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Registration/mitkPyramidImageRegistrationMethod.h @@ -0,0 +1,413 @@ +/*=================================================================== + +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 MITKPYRAMIDIMAGEREGISTRATION_H +#define MITKPYRAMIDIMAGEREGISTRATION_H + +#include + +#include + +#include "mitkImage.h" +#include "mitkBaseProcess.h" + +#include "mitkPyramidRegistrationMethodHelper.h" + +#include "mitkImageToItk.h" +#include "mitkITKImageImport.h" + + +namespace mitk +{ + +/** + * @brief The PyramidImageRegistration class implements a multi-scale registration method + * + * The PyramidImageRegistration class is suitable for aligning (f.e.) brain MR images. The method offers two + * transform types + * - Rigid: optimizing translation and rotation only and + * - Affine ( default ): with scaling in addition ( 12 DOF ) + * + * The error metric is internally chosen based on the selected task type ( @sa SetCrossModalityOn ) + * It uses + * - MattesMutualInformation for CrossModality=on ( default ) and + * - NormalizedCorrelation for CrossModality=off. + */ +class DiffusionCore_EXPORT PyramidImageRegistrationMethod : + public itk::Object +{ +public: + + /** Typedefs */ + mitkClassMacro(PyramidImageRegistrationMethod, itk::Object) + + /** Smart pointer support */ + itkNewMacro(Self) + + /** Registration is between modalities - will take MattesMutualInformation as error metric */ + void SetCrossModalityOn() + { + m_CrossModalityRegistration = true; + } + + /** Registration is between modalities - will take NormalizedCorrelation as error metric */ + void SetCrossModalityOff() + { + m_CrossModalityRegistration = false; + } + + /** Turn the cross-modality on/off */ + void SetCrossModality(bool flag) + { + if( flag ) + this->SetCrossModalityOn(); + else + this->SetCrossModalityOff(); + } + + /** Controll the verbosity of the registration output + * + * for true, each iteration step of the optimizer is watched and passed to the std::cout + */ + void SetVerbose(bool flag) + { + if( flag ) + this->SetCrossModalityOn(); + else + this->SetCrossModalityOff(); + } + + /** Turn verbosity on, \sa SetVerbose */ + void SetVerboseOn() + { + m_Verbose = true; + } + + /** Turn verbosity off, \sa SetVerbose */ + void SetVerboseOff() + { + m_Verbose = false; + } + + /** A rigid ( 6dof : translation + rotation ) transform is optimized */ + void SetTransformToRigid() + { + m_UseAffineTransform = false; + } + + /** An affine ( 12dof : Rigid + scale + skew ) transform is optimized */ + void SetTransformToAffine() + { + m_UseAffineTransform = true; + } + + /** Input image, the reference one */ + void SetFixedImage( mitk::Image::Pointer ); + + /** Input image, the one to be transformed */ + void SetMovingImage( mitk::Image::Pointer ); + + void Update(); + + /** + * @brief Get the number of parameters optimized ( 12 or 6 ) + * + * @return number of paramters + */ + unsigned int GetNumberOfParameters() + { + unsigned int retValue = 12; + if(!m_UseAffineTransform) + retValue = 6; + + return retValue; + } + + /** + * @brief Copies the estimated parameters to the given array + * @param paramArray, target array for copy, make sure to allocate enough space + */ + void GetParameters( double* paramArray) + { + if( m_EstimatedParameters == NULL ) + { + mitkThrow() << "No parameters were estimated yet, call Update() first."; + } + + unsigned int dim = 12; + if( !m_UseAffineTransform ) + dim = 6; + + for( unsigned int i=0; i + void RegisterTwoImages(itk::Image* itkImage1, itk::Image* itkImage2) + { + typedef typename itk::Image< TPixel1, VImageDimension1> FixedImageType; + typedef typename itk::Image< TPixel2, VImageDimension2> MovingImageType; + typedef typename itk::MultiResolutionImageRegistrationMethod< FixedImageType, MovingImageType > RegistrationType; + typedef itk::RegularStepGradientDescentOptimizer OptimizerType; + + typedef itk::AffineTransform< double > AffineTransformType; + typedef itk::Euler3DTransform< double > RigidTransformType; + typedef itk::MatrixOffsetTransformBase< double, VImageDimension1, VImageDimension2 > BaseTransformType; + + typedef typename itk::MattesMutualInformationImageToImageMetric< FixedImageType, MovingImageType > MMIMetricType; + typedef typename itk::NormalizedCorrelationImageToImageMetric< FixedImageType, MovingImageType > NCMetricType; + typedef typename itk::ImageToImageMetric< FixedImageType, MovingImageType> BaseMetricType; + + typename itk::LinearInterpolateImageFunction::Pointer interpolator = + itk::LinearInterpolateImageFunction::New(); + + + typename BaseMetricType::Pointer metric; + + if( m_CrossModalityRegistration ) + { + metric = MMIMetricType::New(); + } + else + { + metric = NCMetricType::New(); + } + + + + // initial parameter dimension ( affine = default ) + unsigned int paramDim = 12; + typename BaseTransformType::Pointer transform; + if( m_UseAffineTransform ) + { + transform = AffineTransformType::New(); + } + else + { + transform = RigidTransformType::New(); + paramDim = 6; + } + + typename BaseTransformType::ParametersType initialParams(paramDim); + + initialParams.Fill(0); + if( m_UseAffineTransform ) + { + initialParams[0] = initialParams[4] = initialParams[8] = 1; + } + + + typename FixedImageType::Pointer referenceImage = itkImage1; + typename MovingImageType::Pointer movingImage = itkImage2; + typename FixedImageType::RegionType maskedRegion = referenceImage->GetLargestPossibleRegion(); + + typename RegistrationType::Pointer registration = RegistrationType::New(); + unsigned int max_pyramid_lvl = 3; + unsigned int max_schedule_val = 4; + typename FixedImageType::RegionType::SizeType image_size = referenceImage->GetLargestPossibleRegion().GetSize(); + unsigned int min_value = std::min( image_size[0], std::min( image_size[1], image_size[2])); + + // condition for the top level pyramid image + float optmaxstep = 12; + float optminstep = 0.1f; + unsigned int iterations = 40; + if( min_value / max_schedule_val < 16 ) + { + //max_pyramid_lvl--; + max_schedule_val /= 2; + optmaxstep *= 0.5f; + optminstep *= 0.2f; + iterations *= 1.5; + + //std::cout << "Changed default pyramid: lvl " << max_pyramid_lvl << std::endl; + } + + typename RegistrationType::ScheduleType fixedSchedule(max_pyramid_lvl,3); + fixedSchedule.Fill(1); + + fixedSchedule[0][0] = max_schedule_val; + fixedSchedule[0][1] = max_schedule_val; + fixedSchedule[0][2] = max_schedule_val; + + for( unsigned int i=1; iSetScales( optScales ); + optimizer->SetInitialPosition( initialParams ); + optimizer->SetNumberOfIterations( iterations ); + optimizer->SetGradientMagnitudeTolerance( 1e-4 ); + optimizer->SetRelaxationFactor( 0.7 ); + optimizer->SetMaximumStepLength( optmaxstep ); + optimizer->SetMinimumStepLength( optminstep ); + + OptimizerIterationCommand< OptimizerType >::Pointer iterationObserver = + OptimizerIterationCommand::New(); + + // add observer tag if verbose */ + unsigned long vopt_tag = 0; + if(m_Verbose) + { + vopt_tag = optimizer->AddObserver( itk::IterationEvent(), iterationObserver ); + } + + + // INPUT IMAGES + registration->SetFixedImage( referenceImage ); + registration->SetFixedImageRegion( maskedRegion ); + registration->SetMovingImage( movingImage ); + registration->SetSchedules( fixedSchedule, fixedSchedule); + // OTHER INPUTS + registration->SetMetric( metric ); + registration->SetOptimizer( optimizer ); + registration->SetTransform( transform.GetPointer() ); + registration->SetInterpolator( interpolator ); + registration->SetInitialTransformParameters( initialParams ); + + typename PyramidOptControlCommand::Pointer pyramid_observer = + PyramidOptControlCommand::New(); + + registration->AddObserver( itk::IterationEvent(), pyramid_observer ); + + try + { + registration->Update(); + } + catch (itk::ExceptionObject &e) + { + MITK_ERROR << "[Registration Update] Caught ITK exception: "; + mitkThrow() << "Registration failed with exception: " << e.what(); + } + + if( m_EstimatedParameters != NULL) + { + delete [] m_EstimatedParameters; + } + + m_EstimatedParameters = new double[paramDim]; + + typename BaseTransformType::ParametersType finalParameters = registration->GetLastTransformParameters(); + for( unsigned int i=0; iRemoveObserver( vopt_tag ); + } + + + } + + template< typename TPixel, unsigned int VDimension> + void ResampleMitkImage( itk::Image* itkImage, + mitk::Image::Pointer& outputImage ) + { + typedef typename itk::Image< TPixel, VDimension> ImageType; + typedef typename itk::ResampleImageFilter< ImageType, ImageType, double> ResampleImageFilterType; + + typedef itk::LinearInterpolateImageFunction< ImageType, double > InterpolatorType; + typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); + + typename mitk::ImageToItk< ImageType >::Pointer reference_image = mitk::ImageToItk< ImageType >::New(); + reference_image->SetInput( this->m_FixedImage ); + reference_image->Update(); + + typedef itk::MatrixOffsetTransformBase< double, 3, 3> BaseTransformType; + BaseTransformType::Pointer base_transform = BaseTransformType::New(); + + if( this->m_UseAffineTransform ) + { + typedef itk::AffineTransform< double > TransformType; + TransformType::Pointer transform = TransformType::New(); + + TransformType::ParametersType affine_params( TransformType::ParametersDimension ); + this->GetParameters( &affine_params[0] ); + + transform->SetParameters( affine_params ); + + base_transform = transform; + } + // Rigid + else + { + typedef itk::Euler3DTransform< double > RigidTransformType; + RigidTransformType::Pointer rtransform = RigidTransformType::New(); + + RigidTransformType::ParametersType rigid_params( RigidTransformType::ParametersDimension ); + this->GetParameters( &rigid_params[0] ); + + rtransform->SetParameters( rigid_params ); + + base_transform = rtransform; + } + + typename ResampleImageFilterType::Pointer resampler = ResampleImageFilterType::New(); + resampler->SetInput( itkImage ); + resampler->SetTransform( base_transform ); + resampler->SetReferenceImage( reference_image->GetOutput() ); + resampler->UseReferenceImageOn(); + + resampler->Update(); + + + mitk::GrabItkImageMemory( resampler->GetOutput(), outputImage); + + } + +}; + +} // end namespace + +#endif // MITKPYRAMIDIMAGEREGISTRATION_H diff --git a/Modules/DiffusionImaging/DiffusionCore/Algorithms/Registration/mitkPyramidRegistrationMethodHelper.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Registration/mitkPyramidRegistrationMethodHelper.h new file mode 100644 index 0000000000..543d492452 --- /dev/null +++ b/Modules/DiffusionImaging/DiffusionCore/Algorithms/Registration/mitkPyramidRegistrationMethodHelper.h @@ -0,0 +1,122 @@ +/*=================================================================== + +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 MITKPYRAMIDREGISTRATIONMETHODHELPER_H +#define MITKPYRAMIDREGISTRATIONMETHODHELPER_H + +#include + +#include + +#include +#include +#include + +#include +#include + +#include +#include + +#include "mitkImageAccessByItk.h" + +/** + * @brief Provides same functionality as \a AccessTwoImagesFixedDimensionByItk for a subset of types + * + * For now, the subset defined is only short and float. + */ +#define AccessTwoImagesFixedDimensionTypeSubsetByItk(mitkImage1, mitkImage2, itkImageTypeFunction, dimension) \ +{ \ + const mitk::PixelType& pixelType1 = mitkImage1->GetPixelType(); \ + const mitk::PixelType& pixelType2 = mitkImage2->GetPixelType(); \ + const mitk::Image* constImage1 = mitkImage1; \ + const mitk::Image* constImage2 = mitkImage2; \ + mitk::Image* nonConstImage1 = const_cast(constImage1); \ + mitk::Image* nonConstImage2 = const_cast(constImage2); \ + nonConstImage1->Update(); \ + nonConstImage2->Update(); \ + _checkSpecificDimension(mitkImage1, (dimension)); \ + _checkSpecificDimension(mitkImage2, (dimension)); \ + _accessTwoImagesByItkForEach(itkImageTypeFunction, ((short, dimension))((float, dimension)), ((short, dimension))((float, dimension)) ) \ + { \ + std::string msg("Pixel type "); \ + msg.append(pixelType1.GetComponentTypeAsString() ); \ + msg.append(" or pixel type "); \ + msg.append(pixelType2.GetComponentTypeAsString() ); \ + msg.append(" is not in " MITK_PP_STRINGIZE(MITK_ACCESSBYITK_TYPES_DIMN_SEQ(dimension))); \ + throw mitk::AccessByItkException(msg); \ + } \ +} + + +/** + * @brief The PyramidOptControlCommand class stears the step lenght of the + * gradient descent optimizer in multi-scale registration methods + */ +template +class PyramidOptControlCommand : public itk::Command +{ +public: + + typedef itk::RegularStepGradientDescentOptimizer OptimizerType; + + itkNewMacro( PyramidOptControlCommand ) + + void Execute(itk::Object *caller, const itk::EventObject & /*event*/) + { + RegistrationType* registration = dynamic_cast< RegistrationType* >( caller ); + + MITK_DEBUG << "\t - Pyramid level " << registration->GetCurrentLevel(); + if( registration->GetCurrentLevel() == 0 ) + return; + + OptimizerType* optimizer = dynamic_cast< OptimizerType* >(registration->GetOptimizer()); + + MITK_DEBUG << optimizer->GetStopConditionDescription() << "\n" + << optimizer->GetValue() << " : " << optimizer->GetCurrentPosition(); + + optimizer->SetMaximumStepLength( optimizer->GetMaximumStepLength() * 0.5f ); + optimizer->SetMinimumStepLength( optimizer->GetMinimumStepLength() * 0.1f ); + optimizer->SetNumberOfIterations( optimizer->GetNumberOfIterations() * 1.5f ); + } + + void Execute(const itk::Object * /*object*/, const itk::EventObject & /*event*/){} +}; + + +template +class OptimizerIterationCommand : public itk::Command +{ +public: + itkNewMacro( OptimizerIterationCommand ) + + void Execute(itk::Object *caller, const itk::EventObject & event) + { + OptimizerType* optimizer = dynamic_cast< OptimizerType* >( caller ); + + unsigned int currentIter = optimizer->GetCurrentIteration(); + MITK_DEBUG << "[" << currentIter << "] : " << optimizer->GetValue() << " : " << optimizer->GetCurrentPosition(); + + } + + void Execute(const itk::Object * object, const itk::EventObject & event) + { + + } +}; + + +#endif // MITKPYRAMIDREGISTRATIONMETHODHELPER_H diff --git a/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkSplitDWImageFilter.h b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkSplitDWImageFilter.h new file mode 100644 index 0000000000..9a97fb2e1f --- /dev/null +++ b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkSplitDWImageFilter.h @@ -0,0 +1,118 @@ +/*=================================================================== + +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 ITKSPLITDWIMAGEFILTER_H +#define ITKSPLITDWIMAGEFILTER_H + +#include "itkImageToImageFilter.h" +#include + +namespace itk +{ + +/** \class SplitDWImageFilter + * + * \brief Splits a DW-Image passed in as input into a 3D-t image where each volume coresponds to a + * gradient image ( or the unweighted b0 ) + * + * Several applications require to get the gradient images as a separate volume, f.e. the registration for + * head-motion correction. Also a reduction of the DW Image is possible when combined with its counterpart filter, + * the \sa mitkImageToDiffusionImageSource, which can reinterpret a 3d+t (scalar) image into a diffusion weighted image. + */ + +template< class TInputImagePixelType, + class TOutputImagePixelType > +class SplitDWImageFilter : + public ImageToImageFilter< VectorImage, + Image< TOutputImagePixelType, 4 > > +{ +public: + + typedef SplitDWImageFilter Self; + typedef SmartPointer Pointer; + typedef SmartPointer ConstPointer; + + typedef TInputImagePixelType InputPixelType; + typedef TOutputImagePixelType OutputPixelType; + + typedef ImageToImageFilter< VectorImage, + Image< TOutputImagePixelType, 4 > > Superclass; + + /** typedefs from superclass */ + typedef typename Superclass::InputImageType InputImageType; + //typedef typename Superclass::OutputImageType OutputImageType; + typedef Image< TOutputImagePixelType, 4 > OutputImageType; + typedef typename OutputImageType::RegionType OutputImageRegionType; + + typedef std::vector< unsigned int > IndexListType; + + + /** Method for creation through the object factory. */ + itkNewMacro(Self); + + /** Runtime information support. */ + itkTypeMacro(SplitDWImageFilter, ImageToImageFilter); + + /** + * @brief Set the indices of the images to be extracted. + * + * + */ + void SetExtractIndices( IndexListType list) + { + m_IndexList = list; + } + + /** + * @brief Extract all images + * + * The same as setting SetExtractIndices( ) with [0,1,2,...,N] + */ + void SetExtractAll() + { + m_ExtractAllImages = true; + } + +protected: + + SplitDWImageFilter(); + virtual ~SplitDWImageFilter(){}; + + void GenerateData(); + + /** The dimension of the output does not match the dimension of the input + hence we need to re-implement the CopyInformation method to avoid + executing the default implementation which tries to copy the input information to the + output + */ + virtual void CopyInformation( const DataObject *data); + + /** Override of the ProcessObject::GenerateOutputInformation() because of different + dimensionality of the input and the output + */ + virtual void GenerateOutputInformation(); + + IndexListType m_IndexList; + bool m_ExtractAllImages; +}; + +} //end namespace itk + +#ifndef ITK_MANUAL_INSTANTIATION +#include "itkSplitDWImageFilter.txx" +#endif + +#endif // ITKSPLITDWIMAGEFILTER_H diff --git a/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkSplitDWImageFilter.txx b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkSplitDWImageFilter.txx new file mode 100644 index 0000000000..64764f726e --- /dev/null +++ b/Modules/DiffusionImaging/DiffusionCore/Algorithms/itkSplitDWImageFilter.txx @@ -0,0 +1,159 @@ +/*=================================================================== + +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 __itkSplitDWImageFilter_txx +#define __itkSplitDWImageFilter_txx + +#include "itkSplitDWImageFilter.h" + +#include +#include + +template< class TInputImagePixelType, + class TOutputImagePixelType> +itk::SplitDWImageFilter< TInputImagePixelType, TOutputImagePixelType > +::SplitDWImageFilter() + : m_IndexList(0), + m_ExtractAllImages(true) +{ + this->SetNumberOfRequiredInputs(1); +} + +template< class TInputImagePixelType, + class TOutputImagePixelType> +void itk::SplitDWImageFilter< TInputImagePixelType, TOutputImagePixelType > +::CopyInformation( const DataObject* /*data*/) +{ + +} + +template< class TInputImagePixelType, + class TOutputImagePixelType> +void itk::SplitDWImageFilter< +TInputImagePixelType, TOutputImagePixelType >::GenerateOutputInformation() +{ + +} + +template< class TInputImagePixelType, + class TOutputImagePixelType> +void itk::SplitDWImageFilter< +TInputImagePixelType, TOutputImagePixelType >::GenerateData() +{ + + if( m_IndexList.empty() && !m_ExtractAllImages ) + { + itkExceptionMacro(<<"The index list is empty and the option to extract all images is disabled. "); + } + + // construct the index list (for each component) + if( m_ExtractAllImages ) + { + m_IndexList.clear(); + + for( unsigned int i=0; i< this->GetInput()->GetNumberOfComponentsPerPixel(); i++) + m_IndexList.push_back(i); + } + + // declare the output image + // this will have the b0 images stored as timesteps + typename OutputImageType::Pointer outputImage = this->GetOutput(); + //OutputImageType::New(); + + // allocate image with + // - dimension: [DimX, DimY, DimZ, size(IndexList) ] + // - spacing: old one, 1.0 time + + typename OutputImageType::SpacingType spacing; + spacing.Fill(1); + + typename OutputImageType::PointType origin; + origin.Fill(0); + + OutputImageRegionType outputRegion; + + // the spacing and origin corresponds to the respective values in the input image (3D) + // the same for the region + for (unsigned int i=0; i< 3; i++) + { + spacing[i] = (this->GetInput()->GetSpacing())[i]; + origin[i] = (this->GetInput()->GetOrigin())[i]; + outputRegion.SetSize(i, this->GetInput()->GetLargestPossibleRegion().GetSize()[i]); + outputRegion.SetIndex(i, this->GetInput()->GetLargestPossibleRegion().GetIndex()[i]); + } + + // number of timesteps = number of b0 images + outputRegion.SetSize(3, m_IndexList.size()); + outputRegion.SetIndex( 3, 0 ); + + // output image direction (4x4) + typename OutputImageType::DirectionType outputDirection; + //initialize to identity + outputDirection.SetIdentity(); + // get the input image direction ( 3x3 matrix ) + typename InputImageType::DirectionType inputDirection = this->GetInput()->GetDirection(); + + for( unsigned int i=0; i< 3; i++) + { + outputDirection(0,i) = inputDirection(0,i); + outputDirection(1,i) = inputDirection(1,i); + outputDirection(2,i) = inputDirection(2,i); + } + + outputImage->SetSpacing( spacing ); + outputImage->SetOrigin( origin ); + outputImage->SetDirection( outputDirection ); + outputImage->SetRegions( outputRegion ); + outputImage->Allocate(); + + // input iterator + itk::ImageRegionConstIterator inputIt( this->GetInput(), + this->GetInput()->GetLargestPossibleRegion() ); + + + // we want to iterate separately over each 3D volume of the output image + // so reset the regions last dimension + outputRegion.SetSize(3,1); + unsigned int currentTimeStep = 0; + + // for each index in the iterator list, extract the image and insert it as a new time step + for(IndexListType::const_iterator indexIt = m_IndexList.begin(); + indexIt != m_IndexList.end(); + indexIt++) + { + // set the time step + outputRegion.SetIndex(3, currentTimeStep); + itk::ImageRegionIterator< OutputImageType> outputIt( outputImage.GetPointer(), outputRegion ); + + // iterate over the current b0 image and store it to corresponding place + outputIt.GoToBegin(); + inputIt.GoToBegin(); + while( !outputIt.IsAtEnd() && !inputIt.IsAtEnd() ) + { + // the input vector + typename InputImageType::PixelType vec = inputIt.Get(); + + outputIt.Set( vec[*indexIt]); + ++outputIt; + ++inputIt; + } + + // increase time step + currentTimeStep++; + } +} + + +#endif // __itkSplitDWImageFilter_txx diff --git a/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkImageToDiffusionImageSource.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkImageToDiffusionImageSource.cpp new file mode 100644 index 0000000000..0699334210 --- /dev/null +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkImageToDiffusionImageSource.cpp @@ -0,0 +1,144 @@ +/*=================================================================== + +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_ImageToDiffusionImageSource_txx +#define __mitk_ImageToDiffusionImageSource_txx + +#include "mitkImageToDiffusionImageSource.h" + +#include +#include + +#include "mitkImageTimeSelector.h" + +#include +#include + +#include "mitkImageCast.h" + +#include "mitkException.h" + +template< typename TPixelType> +mitk::ImageToDiffusionImageSource::ImageToDiffusionImageSource() + : m_SourceImage(0), + m_GradientDirections(0) +{ + +} + +template< typename TPixelType> +void mitk::ImageToDiffusionImageSource +::GenerateOutputInformation() +{ + // sanity checks ( input not null, timesteps corresponds to number of directions specified ) + if( m_GradientDirections->empty() ) + { + mitkThrow() << "No gradient directions were set. Cannot proceed."; + } + + if( m_SourceImage.IsNull() ) + { + mitkThrow() << "No input image was set. Cannot proceed."; + } + + if( m_GradientDirections->size() != m_SourceImage->GetTimeSteps() ) + { + mitkThrow() << "Size mismatch between container size " << m_GradientDirections->size() << + "and image volumes."<< m_SourceImage->GetTimeSteps() <<" Cannot proceed."; + } + + + // already pass in the meta-data + typename OutputType::Pointer metaImage = OutputType::New(); + + // set directions and bvalue + metaImage->SetDirections(this->m_GradientDirections); + metaImage->SetB_Value(this->m_BValue); + + // set identity as measurement frame + vnl_matrix_fixed< double, 3, 3 > measurement_frame; + measurement_frame.set_identity(); + metaImage->SetMeasurementFrame( measurement_frame ); + + + m_OutputCache = metaImage; + m_CacheTime.Modified(); + +} + +template< typename TPixelType> +void mitk::ImageToDiffusionImageSource +::GenerateData() +{ + if ( ( ! m_OutputCache ) || ( this->GetMTime( ) > m_CacheTime.GetMTime( ) ) ) + { + this->GenerateOutputInformation(); + itkWarningMacro("Cache regenerated!"); + } + + // now cast the mitk image to the vector image and pass in as volume + typedef itk::Image< TPixelType, 4 > InputItkType; + typedef itk::Image< TPixelType, 3> SingleVolumeType; + typedef itk::VectorImage< TPixelType, 3> VectorImageType; + + typedef itk::ComposeImageFilter< SingleVolumeType > ComposeFilterType; + typename ComposeFilterType::Pointer vec_composer = ComposeFilterType::New(); + + mitk::ImageTimeSelector::Pointer t_selector = + mitk::ImageTimeSelector::New(); + + t_selector->SetInput( m_SourceImage ); + + for( unsigned int i=0; i< m_SourceImage->GetTimeSteps(); i++) + { + t_selector->SetTimeNr(i); + t_selector->Update(); + + typename SingleVolumeType::Pointer singleImageItk; + mitk::CastToItkImage( t_selector->GetOutput(), singleImageItk ); + + vec_composer->SetInput( i, singleImageItk ); + + } + + try + { + vec_composer->Update(); + } + catch( const itk::ExceptionObject& e) + { + MITK_ERROR << "Caugt exception while updating compose filter: " << e.what(); + } + + + m_OutputCache->SetVectorImage( vec_composer->GetOutput() ); + + // transfer to the output image + static_cast(this->GetOutput()) + ->SetVectorImage(m_OutputCache->GetVectorImage()); + static_cast(this->GetOutput()) + ->SetB_Value(m_OutputCache->GetB_Value()); + static_cast(this->GetOutput()) + ->SetDirections(m_OutputCache->GetDirections()); + static_cast(this->GetOutput()) + ->SetMeasurementFrame(m_OutputCache->GetMeasurementFrame()); + static_cast(this->GetOutput()) + ->InitializeFromVectorImage(); + + +} + +#endif //__mitk_ImageToDiffusionImageSource_txx diff --git a/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkImageToDiffusionImageSource.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkImageToDiffusionImageSource.h new file mode 100644 index 0000000000..0b31f3c261 --- /dev/null +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkImageToDiffusionImageSource.h @@ -0,0 +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 MITKIMAGETODIFFUSIONIMAGESOURCE_H +#define MITKIMAGETODIFFUSIONIMAGESOURCE_H + +#include "mitkDiffusionImageSource.h" + +namespace mitk +{ +/** + * @class ImageToDiffusionImageSource + * @brief The class requires a 3d+t image, list of gradient directions and a corresponding b-value + * and reinterprets the input image as a diffusion-weighted image. + * + * The filter throws an mitk::Exception if + * - no gradient list was set + * - no input image was set + * - the size of the gradient list and the count of timesteps do not match + */ +template< typename TPixelType > +class ImageToDiffusionImageSource + : public DiffusionImageSource< TPixelType > +{ +public: + + typedef vnl_vector_fixed< double, 3 > GradientDirectionType; + typedef vnl_matrix_fixed< double, 3, 3 > MeasurementFrameType; + typedef itk::VectorContainer< unsigned int, + GradientDirectionType >::Pointer GradientDirectionContainerType; + + mitkClassMacro( ImageToDiffusionImageSource, + DiffusionImageSource ) + + itkSimpleNewMacro(Self) + + typedef typename Superclass::OutputType OutputType; + typedef itk::VectorImage ImageType; + + /** + * @brief Set the mitk image ( a 3d+t image ) which is to be reinterpreted as dw image + * @param mitkImage + */ + void SetImage( mitk::Image::Pointer mitkImage ) + { + m_SourceImage = mitkImage; + } + + /** + * @brief Set the gradient directions corresponding to the volumes of the input image + * @param container the container with the gradient directions + * + * @note The gradient directions must correspond to the volumes stored in the 3d+t input + */ + void SetGradientDirections( GradientDirectionContainerType container ) + { + m_GradientDirections = container; + } + + /** + * @brief Set the b-value + * @param bvalue the b-value associated with the gradient list + */ + void SetBValue( float bvalue ) + { + this->m_BValue = bvalue; + } + + +protected: + ImageToDiffusionImageSource(); + virtual ~ImageToDiffusionImageSource(){} + + virtual void GenerateData(); + + virtual void GenerateOutputInformation(); + + mitk::Image::Pointer m_SourceImage; + GradientDirectionContainerType m_GradientDirections; + + typename OutputType::Pointer m_OutputCache; + itk::TimeStamp m_CacheTime; + + float m_BValue; +}; + + +} + +#include "mitkImageToDiffusionImageSource.cpp" +#endif // MITKIMAGETODIFFUSIONIMAGESOURCE_H diff --git a/Modules/DiffusionImaging/DiffusionCore/IODataStructures/mitkRegistrationObject.cpp b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/mitkRegistrationObject.cpp new file mode 100644 index 0000000000..8276d95253 --- /dev/null +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/mitkRegistrationObject.cpp @@ -0,0 +1,45 @@ +/*=================================================================== + +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 "mitkRegistrationObject.h" + +mitk::RegistrationObject::RegistrationObject() + : m_ReferenceGeometry(0), + m_Transformation(0) +{ + +} + +void mitk::RegistrationObject::SetReferenceGeometry(mitk::Geometry3D::Pointer geom) +{ + if( m_ReferenceGeometry.IsNull() ) + m_ReferenceGeometry = mitk::Geometry3D::New(); + + m_ReferenceGeometry = geom->Clone(); +} + +void mitk::RegistrationObject::SetReferenceImage(mitk::Image::Pointer image) +{ + this->SetReferenceGeometry( image->GetTimeSlicedGeometry()->GetGeometry() ); +} + +void mitk::RegistrationObject::SetTransformation(itk::AffineGeometryFrame::Pointer transform) +{ + if( m_Transformation.IsNull() ) + m_Transformation = mitk::AffineGeometryFrame3D::New(); + + m_Transformation = transform; +} diff --git a/Modules/DiffusionImaging/DiffusionCore/IODataStructures/mitkRegistrationObject.h b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/mitkRegistrationObject.h new file mode 100644 index 0000000000..68ba030c63 --- /dev/null +++ b/Modules/DiffusionImaging/DiffusionCore/IODataStructures/mitkRegistrationObject.h @@ -0,0 +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 MITKREGISTRATIONOBJECT_H +#define MITKREGISTRATIONOBJECT_H + +#include + +#include "mitkBaseData.h" +#include "mitkGeometry3D.h" + +#include "mitkImage.h" + +namespace mitk +{ +/** + * @brief The RegistrationObject class stores all necessary information for image registration. + * + * + */ + +class DiffusionCore_EXPORT RegistrationObject : public BaseData +{ +public: + + mitkClassMacro( RegistrationObject, BaseData ); + itkNewMacro( Self ); + + void SetReferenceGeometry( mitk::Geometry3D::Pointer ); + + void SetReferenceImage( mitk::Image::Pointer ); + + void SetTransformation( mitk::AffineGeometryFrame3D::Pointer ); + + mitk::Geometry3D::Pointer GetReferenceGeometry() const + { + return m_ReferenceGeometry; + } + + mitk::AffineGeometryFrame3D::Pointer GetTransformation() const + { + return m_Transformation; + } + +protected: + RegistrationObject(); + virtual ~RegistrationObject(){} + + /** + * @brief Reference geometry of the fixed image used for registration computation + */ + mitk::Geometry3D::Pointer m_ReferenceGeometry; + + mitk::AffineGeometryFrame3D::Pointer m_Transformation; + + +}; + +} +#endif // MITKREGISTRATIONOBJECT_H diff --git a/Modules/DiffusionImaging/DiffusionCore/Testing/files.cmake b/Modules/DiffusionImaging/DiffusionCore/Testing/files.cmake index ad622dfcbb..bfd17c86db 100644 --- a/Modules/DiffusionImaging/DiffusionCore/Testing/files.cmake +++ b/Modules/DiffusionImaging/DiffusionCore/Testing/files.cmake @@ -1,4 +1,8 @@ set(MODULE_TESTS mitkFactoryRegistrationTest.cpp ) +set(MODULE_CUSTOM_TESTS + mitkPyramidImageRegistrationMethodTest.cpp +) + diff --git a/Modules/DiffusionImaging/DiffusionCore/Testing/mitkPyramidImageRegistrationMethodTest.cpp b/Modules/DiffusionImaging/DiffusionCore/Testing/mitkPyramidImageRegistrationMethodTest.cpp new file mode 100644 index 0000000000..f12f9ccf12 --- /dev/null +++ b/Modules/DiffusionImaging/DiffusionCore/Testing/mitkPyramidImageRegistrationMethodTest.cpp @@ -0,0 +1,156 @@ +/*=================================================================== + +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 "mitkIOUtil.h" + +#include "Registration/mitkPyramidImageRegistrationMethod.h" + +#include + + +int mitkPyramidImageRegistrationMethodTest( int argc, char* argv[] ) +{ + if( argc < 4 ) + { + MITK_ERROR << "Not enough input \n Usage: fixed moving type [output_image [output_transform]]" + << "\n \t fixed : the path to the fixed image \n" + << " \t moving : path to the image to be registered" + << " \t type : Affine or Rigid defining the type of the transformation" + << " \t output_image : output file optional, (full) path, and optionally output_transform : also (full)path to file"; + return EXIT_FAILURE; + } + + MITK_TEST_BEGIN("PyramidImageRegistrationMethodTest"); + + mitk::Image::Pointer fixedImage = mitk::IOUtil::LoadImage( argv[1] ); + mitk::Image::Pointer movingImage = mitk::IOUtil::LoadImage( argv[2] ); + + std::string type_flag( argv[3] ); + + mitk::PyramidImageRegistrationMethod::Pointer registrationMethod = mitk::PyramidImageRegistrationMethod::New(); + registrationMethod->SetFixedImage( fixedImage ); + registrationMethod->SetMovingImage( movingImage ); + + if( type_flag == "Rigid" ) + { + registrationMethod->SetTransformToRigid(); + } + else if( type_flag == "Affine" ) + { + registrationMethod->SetTransformToAffine(); + } + else + { + MITK_WARN << " No type specified, using 'Affine' ."; + } + + registrationMethod->Update(); + + bool imageOutput = false; + bool transformOutput = false; + + std::string image_out_filename, transform_out_filename; + + std::string first_output( argv[4] ); + // check for txt, otherwise suppose it is an image + if( first_output.find(".txt") != std::string::npos ) + { + transformOutput = true; + transform_out_filename = first_output; + } + else + { + imageOutput = true; + image_out_filename = first_output; + } + + if( argc > 4 ) + { + std::string second_output( argv[5] ); + if( second_output.find(".txt") != std::string::npos ) + { + transformOutput = true; + transform_out_filename = second_output; + } + } + + MITK_INFO << " Selected output: " << transform_out_filename << " " << image_out_filename; + + try{ + + unsigned int paramCount = registrationMethod->GetNumberOfParameters(); + double* params = new double[ paramCount ]; + registrationMethod->GetParameters( ¶ms[0] ); + + std::cout << "Parameters: "; + for( unsigned int i=0; i< paramCount; i++) + { + std::cout << params[ i ] << " "; + } + std::cout << std::endl; + + if( imageOutput ) + { + mitk::IOUtil::SaveImage( registrationMethod->GetResampledMovingImage(), image_out_filename.c_str() ); + } + + + if( transformOutput ) + { + + itk::TransformFileWriter::Pointer writer = itk::TransformFileWriter::New(); + + // Get transform parameter for resampling / saving + // Affine + if( paramCount == 12 ) + { + typedef itk::AffineTransform< double > TransformType; + TransformType::Pointer transform = TransformType::New(); + + TransformType::ParametersType affine_params( paramCount ); + registrationMethod->GetParameters( &affine_params[0] ); + + transform->SetParameters( affine_params ); + writer->SetInput( transform ); + } + // Rigid + else + { + typedef itk::Euler3DTransform< double > RigidTransformType; + RigidTransformType::Pointer rtransform = RigidTransformType::New(); + + RigidTransformType::ParametersType rigid_params( paramCount ); + registrationMethod->GetParameters( &rigid_params[0] ); + + rtransform->SetParameters( rigid_params ); + writer->SetInput( rtransform ); + } + + writer->SetFileName( transform_out_filename ); + writer->Update(); + } + + } + catch( const std::exception &e) + { + MITK_ERROR << "Caught exception: " << e.what(); + } + + + MITK_TEST_END(); +} diff --git a/Modules/DiffusionImaging/DiffusionCore/files.cmake b/Modules/DiffusionImaging/DiffusionCore/files.cmake index 0a47620934..971532ea80 100644 --- a/Modules/DiffusionImaging/DiffusionCore/files.cmake +++ b/Modules/DiffusionImaging/DiffusionCore/files.cmake @@ -1,121 +1,130 @@ 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 + IODataStructures/DiffusionWeightedImages/mitkImageToDiffusionImageSource.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 + #IODataStructures/mitkRegistrationObject.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 Algorithms/itkDwiGradientLengthCorrectionFilter.cpp + # Registration Algorithms & Co. + Algorithms/Registration/mitkPyramidImageRegistrationMethod.cpp + Algorithms/Registration/mitkDWIHeadMotionCorrectionFilter.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 Algorithms/Reconstruction/itkMultiShellAdcAverageReconstructionImageFilter.h Algorithms/Reconstruction/itkMultiShellRadialAdcKurtosisImageFilter.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/itkShCoefficientImageImporter.h Algorithms/itkOdfMaximaExtractionFilter.h Algorithms/itkResampleDwiImageFilter.h Algorithms/itkDwiGradientLengthCorrectionFilter.h Algorithms/itkAdcImageFilter.h + Algorithms/itkSplitDWImageFilter.h + ) set( TOOL_FILES )