18 #ifndef itkFrequencyFFTLayoutImageRegionConstIteratorWithIndex_h
19 #define itkFrequencyFFTLayoutImageRegionConstIteratorWithIndex_h
114 template <
typename TImage>
176 for (
unsigned int dim = 0; dim < TImage::ImageDimension; ++dim)
178 if (this->m_PositionIndex[dim] <= m_LargestPositiveFrequencyIndex[dim])
180 freqInd[dim] = this->m_PositionIndex[dim] - this->m_MinIndex[dim];
184 freqInd[dim] = this->m_PositionIndex[dim] - (this->m_MaxIndex[dim] + 1);
213 IndexType freqInd = this->GetFrequencyBin();
216 for (
unsigned int dim = 0; dim < TImage::ImageDimension; ++dim)
218 freq[dim] = this->m_FrequencyOrigin[dim] + this->m_FrequencySpacing[dim] * freqInd[dim];
229 for (
unsigned int dim = 0; dim < TImage::ImageDimension; ++dim)
231 w2 += w[dim] * w[dim];
245 itkGetConstReferenceMacro(LargestPositiveFrequencyIndex,
IndexType);
248 itkGetConstReferenceMacro(MinIndex,
IndexType);
251 itkGetConstReferenceMacro(MaxIndex,
IndexType);
254 itkGetConstReferenceMacro(FrequencyOrigin, FrequencyType);
262 itkGetConstReferenceMacro(FrequencySpacing, FrequencyType);
269 this->m_ActualXDimensionIsOdd = value;
271 itkGetMacro(ActualXDimensionIsOdd,
bool);
272 itkBooleanMacro(ActualXDimensionIsOdd);
282 SizeType sizeImage = this->m_Image->GetLargestPossibleRegion().GetSize();
283 this->m_MinIndex = this->m_Image->GetLargestPossibleRegion().GetIndex();
284 this->m_MaxIndex = this->m_Image->GetLargestPossibleRegion().GetUpperIndex();
285 for (
unsigned int dim = 0; dim < ImageType::ImageDimension; ++dim)
287 this->m_LargestPositiveFrequencyIndex[dim] =
288 static_cast<FrequencyValueType>(this->m_MinIndex[dim] + std::floor(sizeImage[dim] / 2.0));
291 this->m_FrequencyOrigin[dim] = 0.0;
294 this->m_FrequencySpacing[dim] = 1.0 / (this->m_Image->GetSpacing()[dim] * sizeImage[dim]);