4 #include <itkImageRegionConstIterator.h> 5 #include <itkImageRegionIterator.h> 12 template <
class PixelScalarType>
14 FDRCorrectImageFilter <PixelScalarType>
17 this->AllocateOutputs();
21 this->CreateFullMask();
22 this->GetOutput()->SetRequestedRegion(this->GetInput()->GetLargestPossibleRegion());
25 typedef itk::ImageRegionConstIterator <TInputImage> InputImageIteratorType;
26 typedef itk::ImageRegionConstIterator <MaskImageType> MaskIteratorType;
27 typedef itk::ImageRegionIterator <TOutputImage> OutputImageIteratorType;
29 MaskIteratorType maskItr(m_MaskImage, this->GetOutput()->GetRequestedRegion());
30 InputImageIteratorType inItr(this->GetInput(), this->GetOutput()->GetRequestedRegion());
31 OutputImageIteratorType outItr(this->GetOutput(), this->GetOutput()->GetRequestedRegion());
33 std::vector <double> pvalues;
35 while (!maskItr.IsAtEnd())
37 if (maskItr.Get() == 0)
44 pvalues.push_back(inItr.Get());
58 while (!maskItr.IsAtEnd())
60 if (maskItr.Get() == 0)
68 outItr.Set(pvalues[pos]);
76 template <
class PixelScalarType>
84 m_MaskImage = MaskImageType::New();
85 m_MaskImage->Initialize();
86 m_MaskImage->SetRegions(this->GetInput()->GetLargestPossibleRegion());
87 m_MaskImage->SetOrigin(this->GetInput()->GetOrigin());
88 m_MaskImage->SetDirection(this->GetInput()->GetDirection());
89 m_MaskImage->SetSpacing(this->GetInput()->GetSpacing());
91 m_MaskImage->Allocate();
93 m_MaskImage->FillBuffer(1);
void BHCorrection(std::vector< double > &pvalues, double qValue)
void BYCorrection(std::vector< double > &pvalues, double qValue)