17 #ifndef MITKDWIHEADMOTIONCORRECTIONFILTER_H
18 #define MITKDWIHEADMOTIONCORRECTIONFILTER_H
22 #include <itkAccumulateImageFilter.h>
23 #include <itkExtractImageFilter.h>
26 #include <itkVectorImage.h>
54 itkFactorylessNewMacro(
Self)
57 itkGetMacro( Steps,
unsigned long )
58 itkGetMacro( CurrentStep,
unsigned long )
59 itkGetMacro( IsInValidState,
bool)
60 itkSetMacro( AbortRegistration,
bool )
61 itkSetMacro( AverageUnweighted,
bool )
71 virtual ~DWIHeadMotionCorrectionFilter() {}
73 virtual void GenerateData()
override;
89 template<
typename TPixel,
unsigned int VDimensions>
91 const itk::Image< TPixel, VDimensions>* image,
95 typedef itk::Image< TPixel, 4> InputItkType;
96 typedef itk::Image< TPixel, 3> OutputItkType;
98 typedef typename itk::AccumulateImageFilter< InputItkType, InputItkType > FilterType;
101 filter->SetInput( image );
102 filter->SetAccumulateDimension( 3 );
103 filter->SetAverage(
true );
106 typedef typename itk::ExtractImageFilter< InputItkType, OutputItkType > ExtractFilterType;
108 extractor->SetInput( filter->GetOutput() );
109 extractor->SetDirectionCollapseToIdentity();
111 typename InputItkType::RegionType extractRegion = image->GetLargestPossibleRegion();
113 extractRegion.SetSize( 3, 0);
114 extractor->SetExtractionRegion( extractRegion );
120 catch(
const itk::ExceptionObject& e)
122 mitkThrow() <<
" Exception while averaging: " << e.what();
131 #endif // MITKDWIHEADMOTIONCORRECTIONFILTER_H
itk::SmartPointer< Self > Pointer
Superclass of all classes generating some kind of mitk::BaseData.
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKDIFFUSIONCORE_EXPORT
Image::Pointer GrabItkImageMemory(itk::SmartPointer< ItkOutputImageType > &itkimage, mitk::Image *mitkImage=nullptr, const BaseGeometry *geometry=nullptr, bool update=true)
Grabs the memory of an itk::Image (with a specific type) and puts it into an mitk::Image.The memory is managed by the mitk::Image after calling this function. The itk::Image remains valid until the mitk::Image decides to free the memory.
#define mitkClassMacro(className, SuperClassName)
Image class for storing images.
unsigned long m_CurrentStep
Superclass of all classes having one or more Images as input and generating Images as output...
bool m_AbortRegistration
set flag to abort
Performs standard head-motion correction by using affine registration of the gradient images...
bool m_IsInValidState
Whether the filter is in a valid state, false if error occured.
itk::VectorImage< DiffusionPixelType, 3 > ITKDiffusionImageType
itk::ProcessObject Superclass
static void ItkAccumulateFilter(const itk::Image< TPixel, VDimensions > *image, mitk::Image::Pointer &output)
Averages an 3d+t image along the time axis.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.