18 #ifndef itkFrequencyFFTLayoutImageRegionConstIteratorWithIndex_h
19 #define itkFrequencyFFTLayoutImageRegionConstIteratorWithIndex_h
114 template <
typename TImage>
174 for (
unsigned int dim = 0; dim < TImage::ImageDimension; ++dim)
176 if (this->m_PositionIndex[dim] <= m_LargestPositiveFrequencyIndex[dim])
178 freqInd[dim] = this->m_PositionIndex[dim] - this->m_MinIndex[dim];
182 freqInd[dim] = this->m_PositionIndex[dim] - (this->m_MaxIndex[dim] + 1);
211 IndexType freqInd = this->GetFrequencyBin();
214 for (
unsigned int dim = 0; dim < TImage::ImageDimension; ++dim)
216 freq[dim] = this->m_FrequencyOrigin[dim] + this->m_FrequencySpacing[dim] * freqInd[dim];
227 for (
unsigned int dim = 0; dim < TImage::ImageDimension; ++dim)
229 w2 += w[dim] * w[dim];
243 itkGetConstReferenceMacro(LargestPositiveFrequencyIndex,
IndexType);
246 itkGetConstReferenceMacro(MinIndex,
IndexType);
249 itkGetConstReferenceMacro(MaxIndex,
IndexType);
252 itkGetConstReferenceMacro(FrequencyOrigin, FrequencyType);
260 itkGetConstReferenceMacro(FrequencySpacing, FrequencyType);
267 this->m_ActualXDimensionIsOdd = value;
269 itkGetMacro(ActualXDimensionIsOdd,
bool);
270 itkBooleanMacro(ActualXDimensionIsOdd);
280 SizeType sizeImage = this->m_Image->GetLargestPossibleRegion().GetSize();
281 this->m_MinIndex = this->m_Image->GetLargestPossibleRegion().GetIndex();
282 this->m_MaxIndex = this->m_Image->GetLargestPossibleRegion().GetUpperIndex();
283 for (
unsigned int dim = 0; dim < ImageType::ImageDimension; ++dim)
285 this->m_LargestPositiveFrequencyIndex[dim] =
286 static_cast<FrequencyValueType>(this->m_MinIndex[dim] + std::floor(sizeImage[dim] / 2.0));
289 this->m_FrequencyOrigin[dim] = 0.0;
292 this->m_FrequencySpacing[dim] = 1.0 / (this->m_Image->GetSpacing()[dim] * sizeImage[dim]);