4 #include <itkObjectFactory.h> 5 #include <itkImageRegionIterator.h> 6 #include <itkImageRegionConstIterator.h> 11 template<
class TImage>
14 this->SetNumberOfRequiredInputs(3);
17 template<
class TImage>
20 SetInput(0, const_cast<TImage*>(T1));
23 template<
class TImage>
26 SetInput(1, const_cast<TImage*>(T2s));
29 template<
class TImage>
32 SetInput(2, const_cast<TImage*>(M0));
35 template<
class TImage>
38 SetInput(3, const_cast<TImage*>(T2));
41 template<
class TImage>
46 typename TImage::ConstPointer T1 = this->GetInput(0);
47 typename TImage::ConstPointer T2s = this->GetInput(1);
48 typename TImage::ConstPointer M0 = this->GetInput(2);
49 typename TImage::ConstPointer T2 = this->GetInput(3);
51 itk::ImageRegionIterator<TImage> outputIterator(this->GetOutput(), outputRegionForThread);
52 itk::ImageRegionConstIterator<TImage> inputIteratorT1(T1, outputRegionForThread);
53 itk::ImageRegionConstIterator<TImage> inputIteratorT2s(T2s, outputRegionForThread);
54 itk::ImageRegionConstIterator<TImage> inputIteratorM0(M0, outputRegionForThread);
55 itk::ImageRegionConstIterator<TImage> inputIteratorT2(T2, outputRegionForThread);
57 double sinFA= sin(M_PI * m_FA / 180);
58 double cosFA = cos(M_PI * m_FA / 180);
61 while(!outputIterator.IsAtEnd())
63 if ( (inputIteratorT1.Get() <= 0) || ( inputIteratorT2s.Get() <=0) || ( inputIteratorT2.Get() <=0))
65 outputIterator.Set(0);
70 outputIterator.Set(inputIteratorM0.Get() * sinFA / (1 + inputIteratorT1.Get() / inputIteratorT2.Get() - cosFA * ( inputIteratorT1.Get()/ inputIteratorT2.Get() -1 ) ) * exp(- m_TE / inputIteratorT2s.Get()) );
Superclass::OutputImageRegionType OutputImageRegionType
virtual void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) ITK_OVERRIDE
void SetInputT1(const TImage *T1)
void SetInputT2(const TImage *T2)
void SetInputT2s(const TImage *T2s)
void SetInputM0(const TImage *M0)