Xmipp  v3.23.11-Nereus
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
RecFourierBufferData Struct Reference

#include <reconstruct_fourier_buffer_data.h>

Inheritance diagram for RecFourierBufferData:
Inheritance graph
[legend]
Collaboration diagram for RecFourierBufferData:
Collaboration graph
[legend]

Public Member Functions

 RecFourierBufferData (bool hasFFTs, bool hasCTFs, int fftSizeX, int fftSizeY, int paddedImgSize, int maxNoOfImages, int noOfSymmetries)
 
 ~RecFourierBufferData ()
 
int getPaddedImgSize ()
 
int getPaddedImgByteSize ()
 
int getFFTsByteSize ()
 
float * getNthItem (float *array, int itemIndex)
 
int getNoOfElements (float *array)
 
int getNoOfElements (RecFourierProjectionTraverseSpace *array)
 
int getMaxByteSize (float *array)
 
int getMaxByteSize (RecFourierProjectionTraverseSpace *array)
 
void invalidate ()
 

Public Attributes

float * FFTs
 
float * CTFs
 
float * modulators
 
float * paddedImages
 
RecFourierProjectionTraverseSpacespaces
 
int fftSizeX
 
int fftSizeY
 
int paddedImgSize
 
int noOfImages
 
int maxNoOfImages
 
int noOfSymmetries
 
bool hasFFTs
 
bool hasCTFs
 

Protected Member Functions

 RecFourierBufferData ()
 

Detailed Description

Struct holding data for calculating Fourier Reconstruction

Contract: 'FFTs' holds 'right side of the centered FFT', i.e. only unique values, with high frequencies in the corners if 'hasFFTs', 'FFTs' contains 'noOfImages' of size 'fftSizeX' * 'fftSizeY' if not 'hasFFTs', 'paddedImages' contains 'noOfImages' of size 'paddedImgSize' * 'paddedImgSize' 'spaces' holds 'noOfImages' * 'noOfSymmetries', which are 'describing' the FFTs/paddedImages 'noOfImages' <= 'maxNoOfImages'

Definition at line 42 of file reconstruct_fourier_buffer_data.h.

Constructor & Destructor Documentation

◆ RecFourierBufferData() [1/2]

RecFourierBufferData::RecFourierBufferData ( bool  hasFFTs,
bool  hasCTFs,
int  fftSizeX,
int  fftSizeY,
int  paddedImgSize,
int  maxNoOfImages,
int  noOfSymmetries 
)
inline

Buffer object constructor. If 'hasFFTs' is true, 'FFTs' array is allocated If 'hasCTFs' is true, 'CTFs' and 'modulators' arrays are allocated

Definition at line 49 of file reconstruct_fourier_buffer_data.h.

51  :
55  spaces = memoryUtils::page_aligned_alloc<RecFourierProjectionTraverseSpace>(maxNoOfImages * noOfSymmetries, false);
56  if (hasFFTs) {
57  paddedImages = nullptr;
58  FFTs = memoryUtils::page_aligned_alloc<float>(fftSizeX * fftSizeY * maxNoOfImages * 2, true); // *2 since it's complex
59  } else {
60  FFTs = nullptr;
61  paddedImages = memoryUtils::page_aligned_alloc<float>(paddedImgSize * paddedImgSize * maxNoOfImages, true);
62  }
63 
64  if (hasCTFs) {
65  CTFs = memoryUtils::page_aligned_alloc<float>(fftSizeX * fftSizeY * maxNoOfImages, true);
66  modulators = memoryUtils::page_aligned_alloc<float>(fftSizeX * fftSizeY * maxNoOfImages, true);
67  } else {
68  CTFs = modulators = nullptr;
69  }
70  };
RecFourierProjectionTraverseSpace * spaces

◆ ~RecFourierBufferData()

RecFourierBufferData::~RecFourierBufferData ( )
inline

Definition at line 72 of file reconstruct_fourier_buffer_data.h.

72  {
73  free(FFTs);
74  free(CTFs);
77  FFTs = CTFs = paddedImages = modulators = nullptr;
78 
79  free(spaces);
80  spaces = nullptr;
81  }
free((char *) ob)
RecFourierProjectionTraverseSpace * spaces

◆ RecFourierBufferData() [2/2]

RecFourierBufferData::RecFourierBufferData ( )
inlineprotected

Member Function Documentation

◆ getFFTsByteSize()

int RecFourierBufferData::getFFTsByteSize ( )
inline

returns size of one FFT in bytes

Definition at line 100 of file reconstruct_fourier_buffer_data.h.

100  {
101  return getNoOfElements(FFTs) * sizeof(float);
102  }

◆ getMaxByteSize() [1/2]

int RecFourierBufferData::getMaxByteSize ( float *  array)
inline

returns max size of the 'array' in bytes OR -1 if 'array' is not from this buffer

Definition at line 141 of file reconstruct_fourier_buffer_data.h.

141  {
142  if (array == FFTs) return (fftSizeX * fftSizeY * maxNoOfImages * 2 * sizeof(float)); // *2 since it's complex
143  if (array == CTFs) return (fftSizeX * fftSizeY * maxNoOfImages * sizeof(float));
144  if (array == modulators) return (fftSizeX * fftSizeY * maxNoOfImages * sizeof(float));
145  if (array == paddedImages) return (paddedImgSize * paddedImgSize * maxNoOfImages * sizeof(float));
146  return -1; // undefined
147  }

◆ getMaxByteSize() [2/2]

int RecFourierBufferData::getMaxByteSize ( RecFourierProjectionTraverseSpace array)
inline

returns max size of the 'array' in bytes OR -1 if 'array' is not from this buffer

Definition at line 153 of file reconstruct_fourier_buffer_data.h.

◆ getNoOfElements() [1/2]

int RecFourierBufferData::getNoOfElements ( float *  array)
inline

returns no of objects currently stored in the array OR -1 if 'array' is not from this buffer

Definition at line 121 of file reconstruct_fourier_buffer_data.h.

121  {
122  if (array == FFTs) return (fftSizeX * fftSizeY * noOfImages * 2); // *2 since it's complex
123  if (array == CTFs) return (fftSizeX * fftSizeY * noOfImages);
124  if (array == modulators) return (fftSizeX * fftSizeY * noOfImages);
125  if (array == paddedImages) return (paddedImgSize * paddedImgSize * noOfImages);
126  return -1; // undefined
127  }

◆ getNoOfElements() [2/2]

int RecFourierBufferData::getNoOfElements ( RecFourierProjectionTraverseSpace array)
inline

returns no of objects currently stored in the array OR -1 if 'array' is not from this buffer

Definition at line 133 of file reconstruct_fourier_buffer_data.h.

◆ getNthItem()

float* RecFourierBufferData::getNthItem ( float *  array,
int  itemIndex 
)
inline

returns pointer to the beginning of data for Nth image data in the array OR NULL if 'array' is not from this buffer no boundaries check

Definition at line 109 of file reconstruct_fourier_buffer_data.h.

109  {
110  if (array == FFTs) return array + (fftSizeX * fftSizeY * itemIndex * 2); // *2 since it's complex
111  if (array == CTFs) return array + (fftSizeX * fftSizeY * itemIndex);
112  if (array == modulators) return array + (fftSizeX * fftSizeY * itemIndex);
113  if (array == paddedImages) return array + (paddedImgSize * paddedImgSize * itemIndex);
114  return nullptr; // undefined
115  }

◆ getPaddedImgByteSize()

int RecFourierBufferData::getPaddedImgByteSize ( )
inline

returns size of one image in bytes

Definition at line 93 of file reconstruct_fourier_buffer_data.h.

93  {
94  return getPaddedImgSize() * sizeof(float);
95  }

◆ getPaddedImgSize()

int RecFourierBufferData::getPaddedImgSize ( )
inline

returns no of pixels in one image

Definition at line 86 of file reconstruct_fourier_buffer_data.h.

◆ invalidate()

void RecFourierBufferData::invalidate ( )
inline

set values to default (invalid) values does not allocate does not release allocated memory

Definition at line 190 of file reconstruct_fourier_buffer_data.h.

190  {
191  hasCTFs = hasFFTs = false;
193  = maxNoOfImages = noOfSymmetries = -1;
194 
195  FFTs = CTFs = paddedImages = modulators = nullptr;
196  spaces = nullptr;
197  }
RecFourierProjectionTraverseSpace * spaces

Member Data Documentation

◆ CTFs

float* RecFourierBufferData::CTFs

Definition at line 161 of file reconstruct_fourier_buffer_data.h.

◆ FFTs

float* RecFourierBufferData::FFTs

Definition at line 159 of file reconstruct_fourier_buffer_data.h.

◆ fftSizeX

int RecFourierBufferData::fftSizeX

Definition at line 172 of file reconstruct_fourier_buffer_data.h.

◆ fftSizeY

int RecFourierBufferData::fftSizeY

Definition at line 173 of file reconstruct_fourier_buffer_data.h.

◆ hasCTFs

bool RecFourierBufferData::hasCTFs

Definition at line 183 of file reconstruct_fourier_buffer_data.h.

◆ hasFFTs

bool RecFourierBufferData::hasFFTs

if 'true', 'FFTs' contains 'noOfImages' of size 'fftSizeX' x 'fftSizeY' otherwise 'paddedImages' contains 'noOfImages' of size 'paddedImgSize' * 'paddedImgSize'

Definition at line 182 of file reconstruct_fourier_buffer_data.h.

◆ maxNoOfImages

int RecFourierBufferData::maxNoOfImages

Definition at line 176 of file reconstruct_fourier_buffer_data.h.

◆ modulators

float* RecFourierBufferData::modulators

Definition at line 163 of file reconstruct_fourier_buffer_data.h.

◆ noOfImages

int RecFourierBufferData::noOfImages

Definition at line 175 of file reconstruct_fourier_buffer_data.h.

◆ noOfSymmetries

int RecFourierBufferData::noOfSymmetries

Definition at line 177 of file reconstruct_fourier_buffer_data.h.

◆ paddedImages

float* RecFourierBufferData::paddedImages

holds pictures that need to be converted to FFT. Images are padded, with data shifted to corners (i.e there is 'empty' cross in the middle

Definition at line 168 of file reconstruct_fourier_buffer_data.h.

◆ paddedImgSize

int RecFourierBufferData::paddedImgSize

Definition at line 174 of file reconstruct_fourier_buffer_data.h.

◆ spaces

RecFourierProjectionTraverseSpace* RecFourierBufferData::spaces

Definition at line 170 of file reconstruct_fourier_buffer_data.h.


The documentation for this struct was generated from the following file: