-
- Downloads
refactored ValueHolder, ImageStateImpl and FFT
Changed in detail: ------------------ - removed DEPRECATED and unused code (slice and row pointers) in value holder - switched from new allocatd array to std::vector - removed explicit data initialization loop - using size_t instead of unsigned int for memory allocation - removed padding code - removed try catch(...) statements - added overflow check for big volumes - optimized 3D index to linear index calculation - removed physical extent for spatial domain (identical to logical extend not that padding is gone) - switched FFT to out of place transforms Benefits -------- - memory for large images is correctly allocated - if the memory can't be allocated an exception is thrown instead of crashing the program - speed increase for FFT ca. 12% and for algorithms using direct value access (e.g. Stat) ca. 7% Issues ----- - FFTs are not out of place, leading to increased memory usage for c2c DFT backtransform and hc2r FFT/DFT backtransform (3x image size instead of 2x image size). If necessary it would be possible to add a fallback for these cases (i.e. catch bad_alloc for the tmp state) and do them in place in low memory conditions. Padding for the in-place transform could be added to the std::vector either at construction time or otherwise using reserve().
Showing
- modules/img/alg/src/fft.cc 49 additions, 113 deletionsmodules/img/alg/src/fft.cc
- modules/img/alg/src/fractional_shift.hh 1 addition, 1 deletionmodules/img/alg/src/fractional_shift.hh
- modules/img/alg/src/histogram.cc 1 addition, 1 deletionmodules/img/alg/src/histogram.cc
- modules/img/alg/src/transcendentals.hh 6 additions, 6 deletionsmodules/img/alg/src/transcendentals.hh
- modules/img/alg/tests/test_fft.cc 1 addition, 1 deletionmodules/img/alg/tests/test_fft.cc
- modules/img/base/src/image_state/image_state_base.hh 1 addition, 1 deletionmodules/img/base/src/image_state/image_state_base.hh
- modules/img/base/src/image_state/image_state_impl.cc 6 additions, 6 deletionsmodules/img/base/src/image_state/image_state_impl.cc
- modules/img/base/src/image_state/image_state_impl.hh 3 additions, 16 deletionsmodules/img/base/src/image_state/image_state_impl.hh
- modules/img/base/src/image_state/image_state_spatial_domain.hh 5 additions, 22 deletions...es/img/base/src/image_state/image_state_spatial_domain.hh
- modules/img/base/src/image_state/value_holder.cc 75 additions, 190 deletionsmodules/img/base/src/image_state/value_holder.cc
- modules/img/base/src/image_state/value_holder.hh 21 additions, 111 deletionsmodules/img/base/src/image_state/value_holder.hh
- modules/img/base/tests/test_domains.cc 8 additions, 17 deletionsmodules/img/base/tests/test_domains.cc
- modules/img/base/tests/test_value_holder.cc 3 additions, 14 deletionsmodules/img/base/tests/test_value_holder.cc
- modules/io/src/img/map_io_mrc_handler.cc 1 addition, 1 deletionmodules/io/src/img/map_io_mrc_handler.cc
Loading
Please register or sign in to comment