30 #ifndef MIRTK_ForEachUnaryVoxelFunction_H 31 #define MIRTK_ForEachUnaryVoxelFunction_H 33 #include "mirtk/Stream.h" 34 #include "mirtk/VoxelFunction.h" 40 inline void _foreachunaryvoxelfunction_must_not_be_reduction()
42 cerr <<
"(Parallel)ForEachVoxel(If): Voxel reductions must be passed by reference!" 43 " Pass voxel functor object(s) as last argument(s) instead of first." << endl;
56 template <
class T1,
class VoxelFunc>
85 const int T = (attr.
_dt ? attr.
_t : 1);
87 for (
int l = 0; l < T; ++l)
88 for (
int k = 0; k < attr.
_z; ++k)
89 for (
int j = 0; j < attr.
_y; ++j)
90 for (
int i = 0; i < attr.
_x; ++i, ++p1) {
102 for (
int idx = re.begin(); idx < re.end(); ++idx, p1 += 1) {
112 const int bi = re.cols().begin();
113 const int bj = re.rows().begin();
114 const int ei = re.cols().end();
115 const int ej = re.rows().end();
117 const int s1 = im1.
GetX() - (ei - bi);
121 for (
int j = bj; j < ej; ++j, p1 += s1)
122 for (
int i = bi; i < ei; ++i, p1 += 1) {
132 const int bi = re.cols ().begin();
133 const int bj = re.rows ().begin();
134 const int bk = re.pages().begin();
135 const int ei = re.cols ().end();
136 const int ej = re.rows ().end();
137 const int ek = re.pages().end();
139 const int s1 = im1.
GetX() - (ei - bi);
140 const int s2 = (im1.
GetY() - (ej - bj)) * im1.
GetX();
144 for (
int k = bk; k < ek; ++k, p1 += s2)
145 for (
int j = bj; j < ej; ++j, p1 += s1)
146 for (
int i = bi; i < ei; ++i, p1 += 1) {
167 VoxelFunc &vf, OutsideFunc &of)
189 const int T = (attr.
_dt ? attr.
_t : 1);
191 for (
int l = 0; l < T; ++l)
192 for (
int k = 0; k < attr.
_z; ++k)
193 for (
int j = 0; j < attr.
_y; ++j)
194 for (
int i = 0; i < attr.
_x; ++i, ++p1) {
195 if (Domain::IsInside(im1, i, j, k, l, p1)) {
208 for (
int idx = re.begin(); idx < re.end(); ++idx, p1 += 1) {
209 if (Domain::IsInside(im1, idx, p1)) {
220 const int bi = re.cols().begin();
221 const int bj = re.rows().begin();
222 const int ei = re.cols().end();
223 const int ej = re.rows().end();
225 const int s1 = im1.
GetX() - (ei - bi);
229 for (
int j = bj; j < ej; ++j, p1 += s1)
230 for (
int i = bi; i < ei; ++i, p1 += 1) {
231 if (Domain::IsInside(im1, i, j, this->_k, this->
_l, p1)) {
242 const int bi = re.cols ().begin();
243 const int bj = re.rows ().begin();
244 const int bk = re.pages().begin();
245 const int ei = re.cols ().end();
246 const int ej = re.rows ().end();
247 const int ek = re.pages().end();
249 const int s1 = im1.
GetX() - (ei - bi);
250 const int s2 = (im1.
GetY() - (ej - bj)) * im1.
GetX();
254 for (
int k = bk; k < ek; ++k, p1 += s2)
255 for (
int j = bj; j < ej; ++j, p1 += s1)
256 for (
int i = bi; i < ei; ++i, p1 += 1) {
257 if (Domain::IsInside(im1, i, j, k, this->
_l, p1)) {
275 template <
class T1,
class VoxelFunc>
281 vf.join(body._VoxelFunc);
285 template <
class T1,
class VoxelFunc>
288 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
289 ForEachScalar(*im1, vf);
293 template <
class T1,
class VoxelFunc>
297 ForEachScalar(*im1, vf);
302 vf.join(body._VoxelFunc);
307 template <
class T1,
class VoxelFunc>
310 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
311 ForEachVoxel(*im1, vf);
315 template <
class T1,
class VoxelFunc>
324 template <
class T1,
class VoxelFunc>
327 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
328 ForEachVoxel(attr, *im1, vf);
332 template <
class T1,
class VoxelFunc>
341 template <
class T1,
class VoxelFunc>
344 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
345 ForEachVoxel(re, *im1, vf);
349 template <
class T1,
class VoxelFunc>
358 template <
class T1,
class VoxelFunc>
361 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
362 ForEachVoxel(re, *im1, vf);
366 template <
class T1,
class VoxelFunc>
375 template <
class T1,
class VoxelFunc>
378 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
379 ForEachVoxel(re, *im1, vf);
387 template <
class T1,
class VoxelFunc>
393 vf.join(body._VoxelFunc);
397 template <
class T1,
class VoxelFunc>
400 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
401 ForEachScalar(im1, vf);
405 template <
class T1,
class VoxelFunc>
409 ForEachScalar(im1, vf);
414 vf.join(body._VoxelFunc);
419 template <
class T1,
class VoxelFunc>
422 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
423 ForEachVoxel(im1, vf);
427 template <
class T1,
class VoxelFunc>
436 template <
class T1,
class VoxelFunc>
439 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
440 ForEachVoxel(attr, im1, vf);
444 template <
class T1,
class VoxelFunc>
453 template <
class T1,
class VoxelFunc>
456 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
457 ForEachVoxel(re, im1, vf);
461 template <
class T1,
class VoxelFunc>
470 template <
class T1,
class VoxelFunc>
473 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
474 ForEachVoxel(re, im1, vf);
478 template <
class T1,
class VoxelFunc>
487 template <
class T1,
class VoxelFunc>
490 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
491 ForEachVoxel(re, im1, vf);
503 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
504 void ForEachScalarIf(
const GenericImage<T1> *im1, VoxelFunc &vf, OutsideFunc &of)
509 vf.join(body._VoxelFunc);
510 of.join(body._OutsideFunc);
514 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
515 void ForEachScalarIf(VoxelFunc vf, OutsideFunc of,
const GenericImage<T1> *im1)
517 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
518 ForEachScalarIf<Domain>(*im1, vf, of);
522 template <
class Domain,
class T1,
class VoxelFunc>
526 ForEachScalarIf<Domain>(*im1, vf, of);
530 template <
class Domain,
class T1,
class VoxelFunc>
533 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
534 ForEachScalarIf<Domain>(*im1, vf);
538 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
539 void ForEachVoxelIf(
const GenericImage<T1> *im1, VoxelFunc &vf, OutsideFunc &of)
542 ForEachScalarIf<Domain>(*im1, vf, of);
547 vf.join(body._VoxelFunc);
548 of.join(body._OutsideFunc);
553 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
554 void ForEachVoxelIf(VoxelFunc vf, OutsideFunc of,
const GenericImage<T1> *im1)
556 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
557 ForEachVoxelIf<Domain>(*im1, vf, of);
561 template <
class Domain,
class T1,
class VoxelFunc>
565 ForEachVoxelIf<Domain>(*im1, vf, of);
569 template <
class Domain,
class T1,
class VoxelFunc>
572 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
573 ForEachVoxelIf<Domain>(*im1, vf);
577 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
587 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
590 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
591 ForEachVoxelIf<Domain>(attr, *im1, vf, of);
595 template <
class Domain,
class T1,
class VoxelFunc>
599 ForEachVoxelIf<Domain>(attr, *im1, vf, of);
603 template <
class Domain,
class T1,
class VoxelFunc>
606 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
607 ForEachVoxelIf<Domain>(attr, *im1, vf);
611 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
621 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
624 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
625 ForEachVoxelIf<Domain>(re, *im1, vf, of);
629 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
639 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
642 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
643 ForEachVoxelIf<Domain>(re, *im1, vf, of);
647 template <
class Domain,
class T1,
class VoxelFunc>
651 ForEachVoxelIf<Domain>(re, *im1, vf, of);
655 template <
class Domain,
class T1,
class VoxelFunc>
658 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
659 ForEachVoxelIf<Domain>(re, *im1, vf);
663 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
673 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
676 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
677 ForEachVoxelIf<Domain>(*im1, vf, of);
681 template <
class Domain,
class T1,
class VoxelFunc>
685 ForEachVoxelIf<Domain>(re, *im1, vf, of);
689 template <
class Domain,
class T1,
class VoxelFunc>
692 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
693 ForEachVoxelIf<Domain>(re, *im1, vf);
701 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
702 void ForEachScalarIf(
const GenericImage<T1> &im1, VoxelFunc &vf, OutsideFunc &of)
707 vf.join(body._VoxelFunc);
708 of.join(body._OutsideFunc);
712 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
713 void ForEachScalarIf(VoxelFunc vf, OutsideFunc of,
const GenericImage<T1> &im1)
715 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
716 ForEachScalarIf<Domain>(im1, vf, of);
720 template <
class Domain,
class T1,
class VoxelFunc>
724 ForEachScalarIf<Domain>(im1, vf, of);
728 template <
class Domain,
class T1,
class VoxelFunc>
731 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
732 ForEachScalarIf<Domain>(im1, vf);
736 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
737 void ForEachVoxelIf(
const GenericImage<T1> &im1, VoxelFunc &vf, OutsideFunc &of)
740 ForEachVoxelIf<Domain>(im1, vf, of);
745 vf.join(body._VoxelFunc);
746 of.join(body._OutsideFunc);
751 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
752 void ForEachVoxelIf(VoxelFunc vf, OutsideFunc of,
const GenericImage<T1> &im1)
754 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
755 ForEachVoxelIf<Domain>(im1, vf, of);
759 template <
class Domain,
class T1,
class VoxelFunc>
763 ForEachVoxelIf<Domain>(im1, vf, of);
767 template <
class Domain,
class T1,
class VoxelFunc>
770 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
771 ForEachVoxelIf<Domain>(im1, vf);
775 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
785 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
788 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
789 ForEachVoxelIf<Domain>(attr, im1, vf, of);
793 template <
class Domain,
class T1,
class VoxelFunc>
797 ForEachVoxelIf<Domain>(attr, im1, vf, of);
801 template <
class Domain,
class T1,
class VoxelFunc>
804 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
805 ForEachVoxelIf<Domain>(attr, im1, vf);
809 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
819 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
822 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
823 ForEachVoxelIf<Domain>(re, im1, vf, of);
827 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
837 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
840 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
841 ForEachVoxelIf<Domain>(re, im1, vf, of);
845 template <
class Domain,
class T1,
class VoxelFunc>
849 ForEachVoxelIf<Domain>(re, im1, vf, of);
853 template <
class Domain,
class T1,
class VoxelFunc>
856 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
857 ForEachVoxelIf<Domain>(re, im1, vf);
861 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
871 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
874 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
875 ForEachVoxelIf<Domain>(re, im1, vf, of);
879 template <
class Domain,
class T1,
class VoxelFunc>
883 ForEachVoxelIf<Domain>(re, im1, vf, of);
887 template <
class Domain,
class T1,
class VoxelFunc>
890 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
891 ForEachVoxelIf<Domain>(re, im1, vf);
903 template <
class T1,
class VoxelFunc>
913 template <
class T1,
class VoxelFunc>
916 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
917 ParallelForEachScalar(*im1, vf);
921 template <
class T1,
class VoxelFunc>
925 ParallelForEachScalar(*im1, vf);
935 template <
class T1,
class VoxelFunc>
938 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
939 ParallelForEachVoxel(*im1, vf);
943 template <
class T1,
class VoxelFunc>
948 if (VoxelFunc::IsReduction()) {
965 template <
class T1,
class VoxelFunc>
968 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
969 ParallelForEachVoxel(attr, *im1, vf);
973 template <
class T1,
class VoxelFunc>
982 template <
class T1,
class VoxelFunc>
985 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
986 ParallelForEachVoxel(re, *im1, vf);
990 template <
class T1,
class VoxelFunc>
999 template <
class T1,
class VoxelFunc>
1002 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1003 ParallelForEachVoxel(re, *im1, vf);
1007 template <
class T1,
class VoxelFunc>
1016 template <
class T1,
class VoxelFunc>
1019 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1020 ParallelForEachVoxel(re, *im1, vf);
1028 template <
class T1,
class VoxelFunc>
1038 template <
class T1,
class VoxelFunc>
1041 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1042 ParallelForEachScalar(im1, vf);
1046 template <
class T1,
class VoxelFunc>
1050 ParallelForEachScalar(im1, vf);
1060 template <
class T1,
class VoxelFunc>
1063 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1064 ParallelForEachVoxel(im1, vf);
1068 template <
class T1,
class VoxelFunc>
1073 if (VoxelFunc::IsReduction()) {
1090 template <
class T1,
class VoxelFunc>
1093 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1094 ParallelForEachVoxel(attr, im1, vf);
1098 template <
class T1,
class VoxelFunc>
1107 template <
class T1,
class VoxelFunc>
1110 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1111 ParallelForEachVoxel(re, im1, vf);
1115 template <
class T1,
class VoxelFunc>
1124 template <
class T1,
class VoxelFunc>
1127 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1128 ParallelForEachVoxel(re, im1, vf);
1132 template <
class T1,
class VoxelFunc>
1141 template <
class T1,
class VoxelFunc>
1144 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1145 ParallelForEachVoxel(re, im1, vf);
1157 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1158 void ParallelForEachScalarIf(
const GenericImage<T1> *im1, VoxelFunc &vf, OutsideFunc &of)
1162 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
1172 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1173 void ParallelForEachScalarIf(VoxelFunc vf, OutsideFunc of,
const GenericImage<T1> *im1)
1175 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1176 ParallelForEachScalarIf<Domain>(*im1, vf, of);
1180 template <
class Domain,
class T1,
class VoxelFunc>
1184 ParallelForEachScalarIf<Domain>(*im1, vf, of);
1188 template <
class Domain,
class T1,
class VoxelFunc>
1191 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1192 ParallelForEachScalarIf<Domain>(*im1, vf);
1196 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1197 void ParallelForEachVoxelIf(
const GenericImage<T1> *im1, VoxelFunc &vf, OutsideFunc &of)
1200 ParallelForEachVoxelIf<Domain>(*im1, vf, of);
1204 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
1215 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1216 void ParallelForEachVoxelIf(VoxelFunc vf, OutsideFunc of,
const GenericImage<T1> *im1)
1218 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1219 ParallelForEachVoxelIf<Domain>(*im1, vf, of);
1223 template <
class Domain,
class T1,
class VoxelFunc>
1227 ParallelForEachVoxelIf<Domain>(*im1, vf, of);
1231 template <
class Domain,
class T1,
class VoxelFunc>
1234 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1235 ParallelForEachVoxelIf<Domain>(*im1, vf);
1239 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1244 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
1262 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1265 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1266 ParallelForEachVoxelIf<Domain>(attr, *im1, vf, of);
1270 template <
class Domain,
class T1,
class VoxelFunc>
1274 ParallelForEachVoxelIf<Domain>(attr, *im1, vf, of);
1278 template <
class Domain,
class T1,
class VoxelFunc>
1281 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1282 ParallelForEachVoxelIf<Domain>(attr, *im1, vf);
1286 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1290 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
1300 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1303 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1304 ParallelForEachVoxelIf<Domain>(re, *im1, vf, of);
1308 template <
class Domain,
class T1,
class VoxelFunc>
1312 ParallelForEachVoxelIf<Domain>(re, *im1, vf, of);
1316 template <
class Domain,
class T1,
class VoxelFunc>
1319 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1320 ParallelForEachVoxelIf<Domain>(re, *im1, vf);
1324 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1328 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
1338 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1341 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1342 ParallelForEachVoxelIf<Domain>(re, *im1, vf, of);
1346 template <
class Domain,
class T1,
class VoxelFunc>
1350 ParallelForEachVoxelIf<Domain>(re, *im1, vf, of);
1354 template <
class Domain,
class T1,
class VoxelFunc>
1357 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1358 ParallelForEachVoxelIf<Domain>(re, *im1, vf);
1362 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1366 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
1376 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1379 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1380 ParallelForEachVoxelIf<Domain>(re, *im1, vf, of);
1384 template <
class Domain,
class T1,
class VoxelFunc>
1388 ParallelForEachVoxelIf<Domain>(re, *im1, vf, of);
1392 template <
class Domain,
class T1,
class VoxelFunc>
1395 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1396 ParallelForEachVoxelIf<Domain>(re, *im1, vf);
1404 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1405 void ParallelForEachScalarIf(
const GenericImage<T1> &im1, VoxelFunc &vf, OutsideFunc &of)
1409 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
1419 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1420 void ParallelForEachScalarIf(VoxelFunc vf, OutsideFunc of,
const GenericImage<T1> &im1)
1422 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1423 ParallelForEachScalarIf<Domain>(im1, vf, of);
1427 template <
class Domain,
class T1,
class VoxelFunc>
1431 ParallelForEachScalarIf<Domain>(im1, vf, of);
1435 template <
class Domain,
class T1,
class VoxelFunc>
1438 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1439 ParallelForEachScalarIf<Domain>(im1, vf);
1443 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1444 void ParallelForEachVoxelIf(
const GenericImage<T1> &im1, VoxelFunc &vf, OutsideFunc &of)
1447 ParallelForEachVoxelIf<Domain>(im1, vf, of);
1451 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
1462 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1463 void ParallelForEachVoxelIf(VoxelFunc vf, OutsideFunc of,
const GenericImage<T1> &im1)
1465 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1466 ParallelForEachVoxelIf<Domain>(im1, vf, of);
1470 template <
class Domain,
class T1,
class VoxelFunc>
1474 ParallelForEachVoxelIf<Domain>(im1, vf, of);
1478 template <
class Domain,
class T1,
class VoxelFunc>
1481 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1482 ParallelForEachVoxelIf<Domain>(im1, vf);
1486 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1491 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
1509 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1512 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1513 ParallelForEachVoxelIf<Domain>(attr, im1, vf, of);
1517 template <
class Domain,
class T1,
class VoxelFunc>
1521 ParallelForEachVoxelIf<Domain>(attr, im1, vf, of);
1525 template <
class Domain,
class T1,
class VoxelFunc>
1528 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1529 ParallelForEachVoxelIf<Domain>(attr, im1, vf);
1533 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1537 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
1547 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1550 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1551 ParallelForEachVoxelIf<Domain>(re, im1, vf, of);
1555 template <
class Domain,
class T1,
class VoxelFunc>
1559 ParallelForEachVoxelIf<Domain>(re, im1, vf, of);
1563 template <
class Domain,
class T1,
class VoxelFunc>
1566 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1567 ParallelForEachVoxelIf<Domain>(re, im1, vf);
1571 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1575 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
1585 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1588 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1589 ParallelForEachVoxelIf<Domain>(re, im1, vf, of);
1593 template <
class Domain,
class T1,
class VoxelFunc>
1597 ParallelForEachVoxelIf<Domain>(re, im1, vf, of);
1601 template <
class Domain,
class T1,
class VoxelFunc>
1604 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1605 ParallelForEachVoxelIf<Domain>(re, im1, vf);
1609 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1613 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
1623 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
1626 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1627 ParallelForEachVoxelIf<Domain>(re, im1, vf, of);
1631 template <
class Domain,
class T1,
class VoxelFunc>
1635 ParallelForEachVoxelIf<Domain>(re, im1, vf, of);
1639 template <
class Domain,
class T1,
class VoxelFunc>
1642 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1643 ParallelForEachVoxelIf<Domain>(re, im1, vf);
1654 template <
class T1,
class VoxelFunc>
1683 const int T = (attr.
_dt ? attr.
_t : 1);
1685 for (
int l = 0; l < T; ++l)
1686 for (
int k = 0; k < attr.
_z; ++k)
1687 for (
int j = 0; j < attr.
_y; ++j)
1688 for (
int i = 0; i < attr.
_x; ++i, ++p1) {
1700 for (
int idx = re.begin(); idx < re.end(); ++idx, p1 += 1) {
1710 const int bi = re.cols().begin();
1711 const int bj = re.rows().begin();
1712 const int ei = re.cols().end();
1713 const int ej = re.rows().end();
1715 const int s1 = im1.
GetX() - (ei - bi);
1719 for (
int j = bj; j < ej; ++j, p1 += s1)
1720 for (
int i = bi; i < ei; ++i, p1 += 1) {
1730 const int bi = re.cols ().begin();
1731 const int bj = re.rows ().begin();
1732 const int bk = re.pages().begin();
1733 const int ei = re.cols ().end();
1734 const int ej = re.rows ().end();
1735 const int ek = re.pages().end();
1737 const int s1 = im1.
GetX() - (ei - bi);
1738 const int s2 = (im1.
GetY() - (ej - bj)) * im1.
GetX();
1742 for (
int k = bk; k < ek; ++k, p1 += s2)
1743 for (
int j = bj; j < ej; ++j, p1 += s1)
1744 for (
int i = bi; i < ei; ++i, p1 += 1) {
1765 VoxelFunc &vf, OutsideFunc &of)
1787 const int T = (attr.
_dt ? attr.
_t : 1);
1789 for (
int l = 0; l < T; ++l)
1790 for (
int k = 0; k < attr.
_z; ++k)
1791 for (
int j = 0; j < attr.
_y; ++j)
1792 for (
int i = 0; i < attr.
_x; ++i, ++p1) {
1793 if (Domain::IsInside(im1, i, j, k, l, p1)) {
1806 for (
int idx = re.begin(); idx < re.end(); ++idx, p1 += 1) {
1807 if (Domain::IsInside(im1, idx, p1)) {
1818 const int bi = re.cols().begin();
1819 const int bj = re.rows().begin();
1820 const int ei = re.cols().end();
1821 const int ej = re.rows().end();
1823 const int s1 = im1.
GetX() - (ei - bi);
1827 for (
int j = bj; j < ej; ++j, p1 += s1)
1828 for (
int i = bi; i < ei; ++i, p1 += 1) {
1829 if (Domain::IsInside(im1, i, j, this->_k, this->
_l, p1)) {
1840 const int bi = re.cols ().begin();
1841 const int bj = re.rows ().begin();
1842 const int bk = re.pages().begin();
1843 const int ei = re.cols ().end();
1844 const int ej = re.rows ().end();
1845 const int ek = re.pages().end();
1847 const int s1 = im1.
GetX() - (ei - bi);
1848 const int s2 = (im1.
GetY() - (ej - bj)) * im1.
GetX();
1852 for (
int k = bk; k < ek; ++k, p1 += s2)
1853 for (
int j = bj; j < ej; ++j, p1 += s1)
1854 for (
int i = bi; i < ei; ++i, p1 += 1) {
1855 if (Domain::IsInside(im1, i, j, k, this->
_l, p1)) {
1873 template <
class T1,
class VoxelFunc>
1879 vf.join(body._VoxelFunc);
1883 template <
class T1,
class VoxelFunc>
1886 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1887 ForEachScalar(*im1, vf);
1891 template <
class T1,
class VoxelFunc>
1895 ForEachScalar(*im1, vf);
1900 vf.join(body._VoxelFunc);
1905 template <
class T1,
class VoxelFunc>
1908 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1909 ForEachVoxel(*im1, vf);
1913 template <
class T1,
class VoxelFunc>
1922 template <
class T1,
class VoxelFunc>
1925 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1926 ForEachVoxel(attr, *im1, vf);
1930 template <
class T1,
class VoxelFunc>
1939 template <
class T1,
class VoxelFunc>
1942 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1943 ForEachVoxel(re, *im1, vf);
1947 template <
class T1,
class VoxelFunc>
1956 template <
class T1,
class VoxelFunc>
1959 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1960 ForEachVoxel(re, *im1, vf);
1964 template <
class T1,
class VoxelFunc>
1973 template <
class T1,
class VoxelFunc>
1976 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1977 ForEachVoxel(re, *im1, vf);
1985 template <
class T1,
class VoxelFunc>
1991 vf.join(body._VoxelFunc);
1995 template <
class T1,
class VoxelFunc>
1998 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
1999 ForEachScalar(im1, vf);
2003 template <
class T1,
class VoxelFunc>
2007 ForEachScalar(im1, vf);
2012 vf.join(body._VoxelFunc);
2017 template <
class T1,
class VoxelFunc>
2020 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2021 ForEachVoxel(im1, vf);
2025 template <
class T1,
class VoxelFunc>
2034 template <
class T1,
class VoxelFunc>
2037 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2038 ForEachVoxel(attr, im1, vf);
2042 template <
class T1,
class VoxelFunc>
2051 template <
class T1,
class VoxelFunc>
2054 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2055 ForEachVoxel(re, im1, vf);
2059 template <
class T1,
class VoxelFunc>
2068 template <
class T1,
class VoxelFunc>
2071 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2072 ForEachVoxel(re, im1, vf);
2076 template <
class T1,
class VoxelFunc>
2085 template <
class T1,
class VoxelFunc>
2088 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2089 ForEachVoxel(re, im1, vf);
2101 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2102 void ForEachScalarIf(
GenericImage<T1> *im1, VoxelFunc &vf, OutsideFunc &of)
2107 vf.join(body._VoxelFunc);
2108 of.join(body._OutsideFunc);
2112 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2115 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2116 ForEachScalarIf<Domain>(*im1, vf, of);
2120 template <
class Domain,
class T1,
class VoxelFunc>
2124 ForEachScalarIf<Domain>(*im1, vf, of);
2128 template <
class Domain,
class T1,
class VoxelFunc>
2131 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2132 ForEachScalarIf<Domain>(*im1, vf);
2136 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2140 ForEachScalarIf<Domain>(*im1, vf, of);
2145 vf.join(body._VoxelFunc);
2146 of.join(body._OutsideFunc);
2151 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2154 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2155 ForEachVoxelIf<Domain>(*im1, vf, of);
2159 template <
class Domain,
class T1,
class VoxelFunc>
2163 ForEachVoxelIf<Domain>(*im1, vf, of);
2167 template <
class Domain,
class T1,
class VoxelFunc>
2170 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2171 ForEachVoxelIf<Domain>(*im1, vf);
2175 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2185 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2188 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2189 ForEachVoxelIf<Domain>(attr, *im1, vf, of);
2193 template <
class Domain,
class T1,
class VoxelFunc>
2197 ForEachVoxelIf<Domain>(attr, *im1, vf, of);
2201 template <
class Domain,
class T1,
class VoxelFunc>
2204 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2205 ForEachVoxelIf<Domain>(attr, *im1, vf);
2209 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2219 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2222 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2223 ForEachVoxelIf<Domain>(re, *im1, vf, of);
2227 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2237 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2240 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2241 ForEachVoxelIf<Domain>(re, *im1, vf, of);
2245 template <
class Domain,
class T1,
class VoxelFunc>
2249 ForEachVoxelIf<Domain>(re, *im1, vf, of);
2253 template <
class Domain,
class T1,
class VoxelFunc>
2256 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2257 ForEachVoxelIf<Domain>(re, *im1, vf);
2261 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2271 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2274 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2275 ForEachVoxelIf<Domain>(*im1, vf, of);
2279 template <
class Domain,
class T1,
class VoxelFunc>
2283 ForEachVoxelIf<Domain>(re, *im1, vf, of);
2287 template <
class Domain,
class T1,
class VoxelFunc>
2290 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2291 ForEachVoxelIf<Domain>(re, *im1, vf);
2299 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2300 void ForEachScalarIf(
GenericImage<T1> &im1, VoxelFunc &vf, OutsideFunc &of)
2305 vf.join(body._VoxelFunc);
2306 of.join(body._OutsideFunc);
2310 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2313 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2314 ForEachScalarIf<Domain>(im1, vf, of);
2318 template <
class Domain,
class T1,
class VoxelFunc>
2322 ForEachScalarIf<Domain>(im1, vf, of);
2326 template <
class Domain,
class T1,
class VoxelFunc>
2329 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2330 ForEachScalarIf<Domain>(im1, vf);
2334 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2338 ForEachVoxelIf<Domain>(im1, vf, of);
2343 vf.join(body._VoxelFunc);
2344 of.join(body._OutsideFunc);
2349 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2352 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2353 ForEachVoxelIf<Domain>(im1, vf, of);
2357 template <
class Domain,
class T1,
class VoxelFunc>
2361 ForEachVoxelIf<Domain>(im1, vf, of);
2365 template <
class Domain,
class T1,
class VoxelFunc>
2368 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2369 ForEachVoxelIf<Domain>(im1, vf);
2373 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2383 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2386 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2387 ForEachVoxelIf<Domain>(attr, im1, vf, of);
2391 template <
class Domain,
class T1,
class VoxelFunc>
2395 ForEachVoxelIf<Domain>(attr, im1, vf, of);
2399 template <
class Domain,
class T1,
class VoxelFunc>
2402 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2403 ForEachVoxelIf<Domain>(attr, im1, vf);
2407 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2417 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2420 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2421 ForEachVoxelIf<Domain>(re, im1, vf, of);
2425 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2435 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2438 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2439 ForEachVoxelIf<Domain>(re, im1, vf, of);
2443 template <
class Domain,
class T1,
class VoxelFunc>
2447 ForEachVoxelIf<Domain>(re, im1, vf, of);
2451 template <
class Domain,
class T1,
class VoxelFunc>
2454 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2455 ForEachVoxelIf<Domain>(re, im1, vf);
2459 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2469 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2472 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2473 ForEachVoxelIf<Domain>(re, im1, vf, of);
2477 template <
class Domain,
class T1,
class VoxelFunc>
2481 ForEachVoxelIf<Domain>(re, im1, vf, of);
2485 template <
class Domain,
class T1,
class VoxelFunc>
2488 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2489 ForEachVoxelIf<Domain>(re, im1, vf);
2501 template <
class T1,
class VoxelFunc>
2511 template <
class T1,
class VoxelFunc>
2514 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2515 ParallelForEachScalar(*im1, vf);
2519 template <
class T1,
class VoxelFunc>
2523 ParallelForEachScalar(*im1, vf);
2533 template <
class T1,
class VoxelFunc>
2536 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2537 ParallelForEachVoxel(*im1, vf);
2541 template <
class T1,
class VoxelFunc>
2546 if (VoxelFunc::IsReduction()) {
2563 template <
class T1,
class VoxelFunc>
2566 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2567 ParallelForEachVoxel(attr, *im1, vf);
2571 template <
class T1,
class VoxelFunc>
2580 template <
class T1,
class VoxelFunc>
2583 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2584 ParallelForEachVoxel(re, *im1, vf);
2588 template <
class T1,
class VoxelFunc>
2597 template <
class T1,
class VoxelFunc>
2600 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2601 ParallelForEachVoxel(re, *im1, vf);
2605 template <
class T1,
class VoxelFunc>
2614 template <
class T1,
class VoxelFunc>
2617 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2618 ParallelForEachVoxel(re, *im1, vf);
2626 template <
class T1,
class VoxelFunc>
2636 template <
class T1,
class VoxelFunc>
2639 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2640 ParallelForEachScalar(im1, vf);
2644 template <
class T1,
class VoxelFunc>
2648 ParallelForEachScalar(im1, vf);
2658 template <
class T1,
class VoxelFunc>
2661 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2662 ParallelForEachVoxel(im1, vf);
2666 template <
class T1,
class VoxelFunc>
2671 if (VoxelFunc::IsReduction()) {
2688 template <
class T1,
class VoxelFunc>
2691 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2692 ParallelForEachVoxel(attr, im1, vf);
2696 template <
class T1,
class VoxelFunc>
2705 template <
class T1,
class VoxelFunc>
2708 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2709 ParallelForEachVoxel(re, im1, vf);
2713 template <
class T1,
class VoxelFunc>
2722 template <
class T1,
class VoxelFunc>
2725 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2726 ParallelForEachVoxel(re, im1, vf);
2730 template <
class T1,
class VoxelFunc>
2739 template <
class T1,
class VoxelFunc>
2742 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2743 ParallelForEachVoxel(re, im1, vf);
2755 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2756 void ParallelForEachScalarIf(
GenericImage<T1> *im1, VoxelFunc &vf, OutsideFunc &of)
2760 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
2770 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2771 void ParallelForEachScalarIf(VoxelFunc vf, OutsideFunc of,
GenericImage<T1> *im1)
2773 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2774 ParallelForEachScalarIf<Domain>(*im1, vf, of);
2778 template <
class Domain,
class T1,
class VoxelFunc>
2782 ParallelForEachScalarIf<Domain>(*im1, vf, of);
2786 template <
class Domain,
class T1,
class VoxelFunc>
2789 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2790 ParallelForEachScalarIf<Domain>(*im1, vf);
2794 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2795 void ParallelForEachVoxelIf(
GenericImage<T1> *im1, VoxelFunc &vf, OutsideFunc &of)
2798 ParallelForEachVoxelIf<Domain>(*im1, vf, of);
2802 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
2813 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2814 void ParallelForEachVoxelIf(VoxelFunc vf, OutsideFunc of,
GenericImage<T1> *im1)
2816 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2817 ParallelForEachVoxelIf<Domain>(*im1, vf, of);
2821 template <
class Domain,
class T1,
class VoxelFunc>
2825 ParallelForEachVoxelIf<Domain>(*im1, vf, of);
2829 template <
class Domain,
class T1,
class VoxelFunc>
2832 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2833 ParallelForEachVoxelIf<Domain>(*im1, vf);
2837 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2842 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
2860 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2863 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2864 ParallelForEachVoxelIf<Domain>(attr, *im1, vf, of);
2868 template <
class Domain,
class T1,
class VoxelFunc>
2872 ParallelForEachVoxelIf<Domain>(attr, *im1, vf, of);
2876 template <
class Domain,
class T1,
class VoxelFunc>
2879 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2880 ParallelForEachVoxelIf<Domain>(attr, *im1, vf);
2884 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2888 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
2898 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2901 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2902 ParallelForEachVoxelIf<Domain>(re, *im1, vf, of);
2906 template <
class Domain,
class T1,
class VoxelFunc>
2910 ParallelForEachVoxelIf<Domain>(re, *im1, vf, of);
2914 template <
class Domain,
class T1,
class VoxelFunc>
2917 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2918 ParallelForEachVoxelIf<Domain>(re, *im1, vf);
2922 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2926 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
2936 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2939 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2940 ParallelForEachVoxelIf<Domain>(re, *im1, vf, of);
2944 template <
class Domain,
class T1,
class VoxelFunc>
2948 ParallelForEachVoxelIf<Domain>(re, *im1, vf, of);
2952 template <
class Domain,
class T1,
class VoxelFunc>
2955 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2956 ParallelForEachVoxelIf<Domain>(re, *im1, vf);
2960 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2964 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
2974 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
2977 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2978 ParallelForEachVoxelIf<Domain>(re, *im1, vf, of);
2982 template <
class Domain,
class T1,
class VoxelFunc>
2986 ParallelForEachVoxelIf<Domain>(re, *im1, vf, of);
2990 template <
class Domain,
class T1,
class VoxelFunc>
2993 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
2994 ParallelForEachVoxelIf<Domain>(re, *im1, vf);
3002 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
3003 void ParallelForEachScalarIf(
GenericImage<T1> &im1, VoxelFunc &vf, OutsideFunc &of)
3007 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
3017 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
3018 void ParallelForEachScalarIf(VoxelFunc vf, OutsideFunc of,
GenericImage<T1> &im1)
3020 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
3021 ParallelForEachScalarIf<Domain>(im1, vf, of);
3025 template <
class Domain,
class T1,
class VoxelFunc>
3029 ParallelForEachScalarIf<Domain>(im1, vf, of);
3033 template <
class Domain,
class T1,
class VoxelFunc>
3036 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
3037 ParallelForEachScalarIf<Domain>(im1, vf);
3041 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
3042 void ParallelForEachVoxelIf(
GenericImage<T1> &im1, VoxelFunc &vf, OutsideFunc &of)
3045 ParallelForEachVoxelIf<Domain>(im1, vf, of);
3049 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
3060 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
3061 void ParallelForEachVoxelIf(VoxelFunc vf, OutsideFunc of,
GenericImage<T1> &im1)
3063 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
3064 ParallelForEachVoxelIf<Domain>(im1, vf, of);
3068 template <
class Domain,
class T1,
class VoxelFunc>
3072 ParallelForEachVoxelIf<Domain>(im1, vf, of);
3076 template <
class Domain,
class T1,
class VoxelFunc>
3079 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
3080 ParallelForEachVoxelIf<Domain>(im1, vf);
3084 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
3089 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
3107 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
3110 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
3111 ParallelForEachVoxelIf<Domain>(attr, im1, vf, of);
3115 template <
class Domain,
class T1,
class VoxelFunc>
3119 ParallelForEachVoxelIf<Domain>(attr, im1, vf, of);
3123 template <
class Domain,
class T1,
class VoxelFunc>
3126 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
3127 ParallelForEachVoxelIf<Domain>(attr, im1, vf);
3131 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
3135 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
3145 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
3148 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
3149 ParallelForEachVoxelIf<Domain>(re, im1, vf, of);
3153 template <
class Domain,
class T1,
class VoxelFunc>
3157 ParallelForEachVoxelIf<Domain>(re, im1, vf, of);
3161 template <
class Domain,
class T1,
class VoxelFunc>
3164 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
3165 ParallelForEachVoxelIf<Domain>(re, im1, vf);
3169 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
3173 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
3183 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
3186 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
3187 ParallelForEachVoxelIf<Domain>(re, im1, vf, of);
3191 template <
class Domain,
class T1,
class VoxelFunc>
3195 ParallelForEachVoxelIf<Domain>(re, im1, vf, of);
3199 template <
class Domain,
class T1,
class VoxelFunc>
3202 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
3203 ParallelForEachVoxelIf<Domain>(re, im1, vf);
3207 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
3211 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) {
3221 template <
class Domain,
class T1,
class VoxelFunc,
class Outs
ideFunc>
3224 if (VoxelFunc::IsReduction() || OutsideFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
3225 ParallelForEachVoxelIf<Domain>(re, im1, vf, of);
3229 template <
class Domain,
class T1,
class VoxelFunc>
3233 ParallelForEachVoxelIf<Domain>(re, im1, vf, of);
3237 template <
class Domain,
class T1,
class VoxelFunc>
3240 if (VoxelFunc::IsReduction()) _foreachunaryvoxelfunction_must_not_be_reduction();
3241 ParallelForEachVoxelIf<Domain>(re, im1, vf);
double _dt
Voxel t-dimensions (in ms)
Dummy type used to distinguish split constructor from copy constructor.
UnaryForEachVoxelIfBody(UnaryForEachVoxelIfBody &o, split s)
Split constructor.
bool IsEmpty() const
Whether image is uninitialized.
UnaryForEachVoxelBody_Const(const UnaryForEachVoxelBody_Const &o)
Copy constructor.
int _y
Image y-dimension (in voxels)
UnaryForEachVoxelIfBody_Const(const UnaryForEachVoxelIfBody_Const &o)
Copy constructor.
VoxelFunc _VoxelFunc
Functor executed for each voxel.
void operator()(const ImageAttributes &attr) const
Process entire image.
UnaryForEachVoxelBody_Const(const GenericImage< T1 > &im1, VoxelFunc &vf)
Constructor.
UnaryForEachVoxelBody(GenericImage< T1 > &im1, VoxelFunc &vf)
Constructor.
UnaryForEachVoxelIfBody_Const(const GenericImage< T1 > &im1, VoxelFunc &vf, OutsideFunc &of)
Constructor.
VoxelType * GetPointerToVoxels(int=0, int=0, int=0, int=0)
int GetX() const
Returns the number of voxels in the x-direction.
int _z
Image z-dimension (in voxels)
int _l
Indices for fixed dimensions.
int _t
Image t-dimension (in voxels)
int GetT() const
Returns the number of voxels in the t-direction.
int GetY() const
Returns the number of voxels in the y-direction.
int GetNumberOfVoxels() const
OutsideFunc _OutsideFunc
Functor executed for each background voxel.
UnaryForEachVoxelIfBody_Const(UnaryForEachVoxelIfBody_Const &o, split s)
Split constructor.
UnaryForEachVoxelBody_Const(UnaryForEachVoxelBody_Const &o, split s)
Split constructor.
double GetTSize() const
Returns the size of a voxel in the t-direction.
int _x
Image x-dimension (in voxels)
UnaryForEachVoxelIfBody(GenericImage< T1 > &im1, VoxelFunc &vf, OutsideFunc &of)
Constructor.
UnaryForEachVoxelBody(UnaryForEachVoxelBody &o, split s)
Split constructor.
void parallel_reduce(const Range &range, Body &body)
parallel_reduce dummy template function which executes the body serially
UnaryForEachVoxelBody(const UnaryForEachVoxelBody &o)
Copy constructor.
void parallel_for(const Range &range, const Body &body)
parallel_for dummy template function which executes the body serially
UnaryForEachVoxelIfBody(const UnaryForEachVoxelIfBody &o)
Copy constructor.