17#ifndef __algo_threaded_copy_h__
18#define __algo_threaded_copy_h__
29 template <
class InputImageType,
class OutputImageType>
30 FORCE_INLINE void operator() (InputImageType& in, OutputImageType& out)
const {
31 out.value() = in.value();
42 template <
class InputImageType,
class OutputImageType>
44 InputImageType& source,
45 OutputImageType& destination,
47 size_t num_axes_in_thread = 1)
50 .run (__copy_func(), source, destination);
53 template <
class InputImageType,
class OutputImageType>
55 InputImageType& source,
56 OutputImageType& destination,
58 size_t to_axis = std::numeric_limits<size_t>::max(),
59 size_t num_axes_in_thread = 1)
61 ThreadedLoop (source, from_axis, to_axis, num_axes_in_thread)
62 .run (__copy_func(), source, destination);
68 template <
class InputImageType,
class OutputImageType>
70 const std::string& message,
71 InputImageType& source,
72 OutputImageType& destination,
74 size_t num_axes_in_thread = 1)
77 .run (__copy_func(), source, destination);
80 template <
class InputImageType,
class OutputImageType>
82 const std::string& message,
83 InputImageType& source,
84 OutputImageType& destination,
86 size_t to_axis = std::numeric_limits<size_t>::max(),
87 size_t num_axes_in_thread = 1)
89 ThreadedLoop (message, source, from_axis, to_axis, num_axes_in_thread)
90 .run (__copy_func(), source, destination);
94 template <
class InputImageType,
class OutputImageType>
96 InputImageType& source,
97 OutputImageType& destination,
99 size_t num_axes_in_thread = 1)
102 source, destination, axes, num_axes_in_thread);
105 template <
class InputImageType,
class OutputImageType>
107 InputImageType& source,
108 OutputImageType& destination,
109 size_t from_axis = 0,
110 size_t to_axis = std::numeric_limits<size_t>::max(),
111 size_t num_axes_in_thread = 1)
114 source, destination, from_axis, to_axis, num_axes_in_thread);
void threaded_copy_with_progress(InputImageType &source, OutputImageType &destination, const vector< size_t > &axes, size_t num_axes_in_thread=1)
ThreadedLoopRunOuter< decltype(Loop(vector< size_t >()))> ThreadedLoop(const HeaderType &source, const vector< size_t > &outer_axes, const vector< size_t > &inner_axes)
Multi-threaded loop object.
std::string shorten(const std::string &text, size_t longest=40, size_t prefix=10)
convert a long string to 'beginningofstring...endofstring' for display
void threaded_copy(InputImageType &source, OutputImageType &destination, const vector< size_t > &axes, size_t num_axes_in_thread=1)
void threaded_copy_with_progress_message(const std::string &message, InputImageType &source, OutputImageType &destination, const vector< size_t > &axes, size_t num_axes_in_thread=1)