diff --git a/atlas/tasks.py b/atlas/tasks.py index 18f43b90..6255c6d8 100644 --- a/atlas/tasks.py +++ b/atlas/tasks.py @@ -190,7 +190,6 @@ def series_reconstruct_task( volume = np.stack([item[2] for item in sorted_items], axis=0) template_ds = sorted_items[0][1] - source_positions_mm = geom["source_positions_mm"] origin_ipp = geom["origin_ipp"] row_dir = geom["row_dir"] col_dir = geom["col_dir"] @@ -302,22 +301,23 @@ def series_reconstruct_task( axis_positions_mm = np.arange(axis_length, dtype=float) * float(axis_spacing) end_pos = axis_positions_mm[-1] if axis_positions_mm.size else 0.0 - centers_mm = np.arange(0.0, end_pos + (output_spacing * 0.5), output_spacing, dtype=float) - if centers_mm.size == 0: - centers_mm = np.array([0.0], dtype=float) + start_positions_mm = np.arange(0.0, end_pos + 1e-6, output_spacing, dtype=float) + if start_positions_mm.size == 0: + start_positions_mm = np.array([0.0], dtype=float) - half = slab_thickness / 2.0 slabs = [] centers_idx = [] - for center_mm in centers_mm: - mask = np.abs(axis_positions_mm - center_mm) <= (half + 1e-6) + for start_mm in start_positions_mm: + end_mm = start_mm + slab_thickness + mask = (axis_positions_mm >= (start_mm - 1e-6)) & (axis_positions_mm < (end_mm - 1e-6)) if not mask.any(): - nearest = int(np.argmin(np.abs(axis_positions_mm - center_mm))) + nearest = int(np.argmin(np.abs(axis_positions_mm - start_mm))) idxs = np.array([nearest], dtype=int) else: idxs = np.where(mask)[0].astype(int) slabs.append(idxs) + center_mm = start_mm + (slab_thickness / 2.0) centers_idx.append(float(center_mm / axis_spacing) if axis_spacing > 0 else float(idxs[0])) return slabs, centers_idx diff --git a/atlas/templates/atlas/task_overview.html b/atlas/templates/atlas/task_overview.html index 48162281..393a8a9f 100644 --- a/atlas/templates/atlas/task_overview.html +++ b/atlas/templates/atlas/task_overview.html @@ -7,7 +7,29 @@ Atlas Task Overview {% endblock title %} {% block content %} -
| - | Task | +Task | Status | -Generated Series | +Generated Series | Queue | Enqueued | Started | Finished | Worker | -Error | -Actions | +Error | +Actions | - | + |
{{ task.task_path }}
{{ task.id }}
|
@@ -106,7 +128,7 @@ Atlas Task Overview
{{ task.status }}
{% endif %}
- + | {% if task.generated_series %} {% for series in task.generated_series %} {{ series.description }} @@ -120,8 +142,8 @@ Atlas Task Overview | {{ task.started_at|date:"Y-m-d H:i:s" }} | {{ task.finished_at|date:"Y-m-d H:i:s" }} | {{ task.worker_ids }} | -{{ task.exception_class_path|default:"" }} | -+ | {{ task.exception_class_path|default:"" }} | +{% if task.traceback %} |
|---|