You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# We first recall the algorithms we defined for OurRadonreco. We will use iterative methods to reconstruct the first three images from our time series. For more information, refer to the AbstractImageReconstruction documentation.
22
22
# We first prepare our parameters. For this example we will use the Conjugate Gradient Normal Residual solver with 20 iterations and a L2 regularization of 0.001. Furthermore, we will project the final result to positive values:
23
23
pre =RadonPreprocessingParameters(frames =collect(1:3))
# Additionally, listeners can be attached across workers using the Observable interface on a `DaggerRecoPlan`:
71
73
using Observables
72
74
localVariable =3
73
-
fun =on(plan_iter.parameter.pre, :frames) do newval
75
+
plan_iter_remote = plan_dagger.parameter.algo
76
+
fun =on(plan_iter_remote.parameter.pre, :frames) do newval
74
77
@info"Number of frames was updated to: $(length(newval))"
75
78
localVariable =length(newval)
76
79
end
77
-
setAll!(plan_iter, :frames, collect(1:42))
80
+
setAll!(plan_iter_remote, :frames, collect(1:42))
78
81
79
82
# Note: We retain the observable function in the variable `fun` to allow for later removal of the listener. The anonymous function cannot be used directly due to internal listener management in **DaggerImageReconstruction**.
80
-
off(plan_iter.parameter.pre, :frames, fun)
81
-
setAll!(plan_iter, :frames, collect(1:32))
83
+
off(plan_iter_remote.parameter.pre, :frames, fun)
84
+
setAll!(plan_iter_remote, :frames, collect(1:32))
82
85
83
86
# Since the listener executes on the local worker, updated data must be transferred between workers. If this involves large data, a preprocessing function can be provided to the Observable:
84
-
fun =on(plan_iter.parameter.pre, :frames; preprocessing = length) do newval
87
+
fun =on(plan_iter_remote.parameter.pre, :frames; preprocessing = length) do newval
0 commit comments