17#ifndef __algo_loop_h__
18#define __algo_loop_h__
35 template <
class ImageType>
43 template <
class ImageType>
191 template <
class... ImageType>
194 const std::tuple<ImageType&...>
vox;
203 template <
class... ImageType>
211 template <
class... ImageType>
215 const std::tuple<ImageType&...>
vox;
224 template <
class... ImageType>
233 template <
class... ImageType>
236 const std::tuple<ImageType&...>
vox;
239 FORCE_INLINE Run (
const size_t axis_from,
const size_t axis_to,
const std::tuple<ImageType&...>&
vox) :
241 for (
size_t n =
from; n <
to; ++n)
264 template <
class... ImageType>
273 template <
class... ImageType>
282 template <
class... ImageType>
289 template <
class... ImageType>
295 template <
class... ImageType>
302 const std::initializer_list<size_t>
axes;
304 template <
class... ImageType>
306 const std::initializer_list<size_t>
axes;
307 const std::tuple<ImageType&...>
vox;
336 template <
class... ImageType>
345 template <
class... ImageType>
354 template <
class... ImageType>
363 template <
class... ImageType>
366 const std::tuple<ImageType&...>
vox;
394 template <
class... ImageType>
403 template <
class... ImageType>
412 template <
class... ImageType>
423 Loop (
const std::string& progress_message)
424 {
return { progress_message }; }
431 Loop (
const std::string& progress_message,
size_t axis)
432 {
return { progress_message,
axis }; }
435 Loop (
size_t axis_from,
size_t axis_to)
436 {
return { axis_from, axis_to }; }
439 Loop (
const std::string& progress_message,
size_t axis_from,
size_t axis_to)
440 {
return { progress_message, axis_from, axis_to }; }
443 Loop (std::initializer_list<size_t> axes)
447 Loop (
const std::string& progress_message, std::initializer_list<size_t> axes)
448 {
return { progress_message, axes }; }
456 {
return { progress_message, axes }; }
458 template <
class ImageType>
FORCE_INLINE LoopAlongDynamicAxes
460 size_t axis_from = 0,
461 size_t axis_to = std::numeric_limits<size_t>::max(),
465 template <
class ImageType>
FORCE_INLINE LoopAlongDynamicAxesProgress
466 Loop (
const std::string& progress_message,
467 const ImageType& source,
468 size_t axis_from = 0,
469 size_t axis_to = std::numeric_limits<size_t>::max(),
471 {
return { progress_message,
Stride::order (source, axis_from, axis_to) }; }
implements a progress meter to provide feedback to the user
FORCE_INLINE LoopAlongAxes Loop()
VectorType::Scalar value(const VectorType &coefs, typename VectorType::Scalar cos_elevation, typename VectorType::Scalar cos_azimuth, typename VectorType::Scalar sin_azimuth, int lmax)
vector< size_t > order(const HeaderType &header, size_t from_axis=0, size_t to_axis=std::numeric_limits< size_t >::max())
sort range of axes with respect to their absolute stride.
List get(const HeaderType &header)
return the strides of header as a vector<ssize_t>
void apply(F &&f, T &&t)
invoke f(x) for each entry in t
NOMEMALIGN FORCE_INLINE LoopAlongAxisRange::Run< ImageType... > operator()(ImageType &... images) const
FORCE_INLINE LoopAlongAxisRangeProgress::Run< ImageType... > operator()(ImageType &... images) const
NOMEMALIGN const std::string text
FORCE_INLINE void operator++()
const std::tuple< ImageType &... > vox
NOMEMALIGN const size_t from
FORCE_INLINE void operator++(int)
NOMEMALIGN const size_t to
FORCE_INLINE Run(const size_t axis_from, const size_t axis_to, const std::tuple< ImageType &... > &vox)
NOMEMALIGN const size_t to
NOMEMALIGN const size_t from
FORCE_INLINE Run< ImageType... > operator()(ImageType &... images) const
FORCE_INLINE void operator++()
FORCE_INLINE void operator++(int)
FORCE_INLINE Run(const std::string &text, const size_t from, const size_t to, const std::tuple< ImageType &... > &vox)
NOMEMALIGN MR::ProgressBar progress
LoopAlongAxisRangeProgress(const std::string &text, const size_t from, const size_t to)
FORCE_INLINE Run< ImageType... > operator()(ImageType &... images) const
NOMEMALIGN const std::string text
NOMEMALIGN const vector< size_t > axes
FORCE_INLINE void operator++()
FORCE_INLINE Run(const vector< size_t > &axes, const std::tuple< ImageType &... > &vox)
FORCE_INLINE void operator++(int)
const std::tuple< ImageType &... > vox
FORCE_INLINE Run< ImageType... > operator()(ImageType &... images) const
NOMEMALIGN const vector< size_t > axes
FORCE_INLINE void operator++()
FORCE_INLINE void operator++(int)
NOMEMALIGN MR::ProgressBar progress
FORCE_INLINE Run(const std::string &text, const vector< size_t > &axes, const std::tuple< ImageType &... > &vox)
FORCE_INLINE Run< ImageType... > operator()(ImageType &... images) const
NOMEMALIGN const std::string text
LoopAlongDynamicAxesProgress(const std::string &text, const vector< size_t > &axes)
const std::tuple< ImageType &... > vox
FORCE_INLINE void operator++(int) const
FORCE_INLINE void operator++() const
FORCE_INLINE Run(const size_t axis, const std::tuple< ImageType &... > &vox)
NOMEMALIGN const size_t axis
FORCE_INLINE Run< ImageType... > operator()(ImageType &... images) const
NOMEMALIGN const size_t axis
NOMEMALIGN MR::ProgressBar progress
const std::tuple< ImageType &... > vox
FORCE_INLINE void operator++()
FORCE_INLINE Run(const std::string &text, const size_t axis, const std::tuple< ImageType &... > &vox)
FORCE_INLINE void operator++(int)
NOMEMALIGN const std::string text
FORCE_INLINE Run< ImageType... > operator()(ImageType &... images) const
const std::tuple< ImageType &... > vox
FORCE_INLINE void operator++(int)
FORCE_INLINE void operator++()
NOMEMALIGN const std::initializer_list< size_t > axes
FORCE_INLINE Run(const std::initializer_list< size_t > axes, const std::tuple< ImageType &... > &vox)
FORCE_INLINE Run< ImageType... > operator()(ImageType &... images) const
NOMEMALIGN const std::initializer_list< size_t > axes
FORCE_INLINE void operator++()
FORCE_INLINE Run(const std::string &text, const std::initializer_list< size_t > axes, const std::tuple< ImageType &... > &vox)
FORCE_INLINE void operator++(int)
NOMEMALIGN MR::ProgressBar progress
FORCE_INLINE Run< ImageType... > operator()(ImageType &... images) const
NOMEMALIGN const std::string text
LoopAlongStaticAxesProgress(const std::string &text, const std::initializer_list< size_t > axes)