Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
itkKspaceImageFilter.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 /*===================================================================
18 
19 This file is based heavily on a corresponding ITK filter.
20 
21 ===================================================================*/
22 #ifndef __itkKspaceImageFilter_h_
23 #define __itkKspaceImageFilter_h_
24 
25 #include <MitkFiberTrackingExports.h>
26 #include <itkImageSource.h>
27 #include <vcl_complex.h>
28 #include <vector>
29 #include <itkMersenneTwisterRandomVariateGenerator.h>
30 #include <mitkFiberfoxParameters.h>
31 #include <mitkFiberBundle.h>
32 #include <mitkAcquisitionType.h>
33 
34 using namespace std;
35 
36 namespace itk{
37 
51  template< class TPixelType >
53  public ImageSource< Image< vcl_complex< TPixelType >, 2 > >
54  {
55 
56  public:
57 
62 
64  itkFactorylessNewMacro(Self)
65  itkCloneMacro(Self)
66 
69 
70  typedef typename itk::Image< double, 2 > InputImageType;
71  typedef typename InputImageType::Pointer InputImagePointerType;
72  typedef typename Superclass::OutputImageType OutputImageType;
73  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
74  typedef itk::Matrix<double, 3, 3> MatrixType;
75  typedef itk::Point<double,2> Point2D;
76  typedef itk::Vector< double,3> DoubleVectorType;
77  typedef itk::Image<double, 3> ItkDoubleImgType;
78 
79  itkSetMacro( SpikesPerSlice, unsigned int )
80  itkSetMacro( Z, double )
81  itkSetMacro( UseConstantRandSeed, bool )
82  itkSetMacro( Rotation, DoubleVectorType )
83  itkSetMacro( Translation, DoubleVectorType )
84  itkSetMacro( Zidx, int )
85  itkSetMacro( FiberBundle, FiberBundle::Pointer )
86  itkSetMacro( CoilPosition, DoubleVectorType )
87  itkGetMacro( KSpaceImage, typename InputImageType::Pointer )
88  itkGetMacro( SpikeLog, std::string )
89 
90  void SetParameters( FiberfoxParameters<double>* param ){ m_Parameters = param; }
91 
92  void SetCompartmentImages( std::vector< InputImagePointerType > cImgs ) { m_CompartmentImages=cImgs; }
93  void SetT2( std::vector< double > t2Vector ) { m_T2=t2Vector; }
94  void SetT1( std::vector< double > t1Vector ) { m_T1=t1Vector; }
95  void SetDiffusionGradientDirection(itk::Vector<double,3> g) { m_DiffusionGradientDirection=g; }
96 
97  protected:
100 
101  double CoilSensitivity(DoubleVectorType& pos);
102 
103  void BeforeThreadedGenerateData();
104  void ThreadedGenerateData( const OutputImageRegionType &outputRegionForThread, ThreadIdType threadID);
105  void AfterThreadedGenerateData();
106  double InterpolateFmapValue(itk::Point<float, 3> itkP);
107 
110  vector< double > m_T2;
111  vector< double > m_T1;
112  vector< InputImagePointerType > m_CompartmentImages;
113  itk::Vector<double,3> m_DiffusionGradientDirection;
114  double m_Z;
115  int m_Zidx;
117  unsigned int m_SpikesPerSlice;
119  double m_Gamma;
122 
124  vcl_complex<double> m_Spike;
126  std::string m_SpikeLog;
127 
133 
134  private:
135 
136  };
137 
138 }
139 
140 #ifndef ITK_MANUAL_INSTANTIATION
141 #include "itkKspaceImageFilter.cpp"
142 #endif
143 
144 #endif //__itkKspaceImageFilter_h_
145 
Superclass of all classes generating Images (instances of class Image) as output. ...
void SetT1(std::vector< double > t1Vector)
One T1 relaxation constant per compartment image.
itk::SmartPointer< Self > Pointer
InputImageType::Pointer m_ReadoutTimeImage
FiberfoxParameters< double > * m_Parameters
itk::Image< double, 3 > ItkDoubleImgType
InputImageType::Pointer InputImagePointerType
STL namespace.
AcquisitionType * m_ReadoutScheme
void SetT2(std::vector< double > t2Vector)
One T2 relaxation constant per compartment image.
vcl_complex< double > m_Spike
SmartPointer< const Self > ConstPointer
itk::Point< double, 2 > Point2D
DoubleVectorType m_Rotation
used to find correct point in frequency map (head motion)
vector< InputImagePointerType > m_CompartmentImages
SmartPointer< Self > Pointer
itk::Matrix< double, 3, 3 > MatrixType
itk::Vector< double, 3 > m_DiffusionGradientDirection
DoubleVectorType m_CoilPosition
Superclass::OutputImageRegionType OutputImageRegionType
InputImageType::Pointer m_TimeFromEchoImage
Datastructure to manage the Fiberfox signal generation parameters.
Image class for storing images.
Definition: mitkImage.h:76
itk::Vector< double, 3 > DoubleVectorType
Base Class for Fiber Bundles;.
DoubleVectorType m_Translation
used to find correct point in frequency map (head motion)
Superclass of all classes having one or more Images as input and generating Images as output...
ImageSource< Image< vcl_complex< TPixelType >, 2 > > Superclass
itk::Image< double, 2 > InputImageType
void SetCompartmentImages(std::vector< InputImagePointerType > cImgs)
One signal image per compartment.
Simulates k-space acquisition of one slice with a single shot EPI sequence. Enables the simulation of...
void SetDiffusionGradientDirection(itk::Vector< double, 3 > g)
Gradient direction is needed for eddy current simulation.
FiberBundle::Pointer m_FiberBundle
InputImageType::Pointer m_KSpaceImage
Abstract class for k-space acquisiton type (k-space trajectory and echo placement) ...