Batch analysis¶
Run one analysis strategy over many acquisition files.
File-level work uses a ThreadPoolExecutor. Each file is independent;
inner analysis code may also use multiprocessing or threads as configured by
the concrete strategy. This preserves the same scientific analysis path used
by one-file GUI and scripting workflows while reducing wall-clock time for
large file collections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
Sequence['AcqImage']
|
Acquisition images to process. |
required |
strategy
|
BatchAnalysisStrategy
|
Per-file analysis strategy. |
required |
max_parallel_files
|
int
|
Maximum concurrent file workers. Values smaller than one are clamped to one. |
4
|
Source code in src/acqstore/acq_image/analysis/batch/acq_analysis_batch.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
run ¶
run(
*,
cancel_event: Event | None = None,
on_file_result: Callable[[BatchFileResult], None]
| None = None,
) -> list[BatchFileResult]
Run the batch and return results in input order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cancel_event
|
Event | None
|
Optional shared cancellation event. If omitted, a new unset event is used. |
None
|
on_file_result
|
Callable[[BatchFileResult], None] | None
|
Optional callback invoked as each file completes. |
None
|
Returns:
| Type | Description |
|---|---|
list[BatchFileResult]
|
Per-file results in the same order as input files. |
Source code in src/acqstore/acq_image/analysis/batch/acq_analysis_batch.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
Run the same Radon velocity analysis over a list of files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
int
|
Explicit channel index used for every file. |
required |
roi_mode
|
RoiBatchMode
|
How each file's target ROI is selected. |
required |
roi_id
|
int | None
|
Required ROI identifier for |
required |
detection_params
|
dict[str, object]
|
Detection parameters passed to each new analysis. |
required |
use_multiprocessing
|
bool
|
Whether the per-file Radon analysis may use
multiprocessing. This parameter is stored for API clarity; the
current wrapper uses |
True
|
processes
|
int | None
|
Optional number of worker processes for the per-file Radon
algorithm. |
None
|
Source code in src/acqstore/acq_image/analysis/batch/radon_velocity_batch_strategy.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
process_file ¶
process_file(
acq_image: 'AcqImage', *, cancel_event: Event
) -> BatchFileResult
Run Radon velocity analysis for one file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
acq_image
|
'AcqImage'
|
Acquisition image to analyze. |
required |
cancel_event
|
Event
|
Shared cancellation event. |
required |
Returns:
| Type | Description |
|---|---|
BatchFileResult
|
Per-file batch result. The |
BatchFileResult
|
it is not saved. |
Source code in src/acqstore/acq_image/analysis/batch/radon_velocity_batch_strategy.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
Run diameter analysis over one file at a time for AcqAnalysisBatch.
The strategy intentionally uses the same AcqAnalysisSet.create and
AcqAnalysisSet.run_analysis path as single-file GUI analysis. It only
chooses the target ROI, configures runtime execution options, and converts
exceptions/cancellation into per-file batch results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
int
|
Explicit channel index used for every file. |
required |
roi_mode
|
RoiBatchMode
|
How each file's target ROI is selected. |
required |
roi_id
|
int | None
|
Required ROI identifier for |
required |
detection_params
|
dict[str, object]
|
Detection parameters passed to each new analysis. |
required |
use_threads
|
bool
|
Whether each per-file diameter analysis may use threads. |
True
|
max_workers
|
int | None
|
Optional worker count for each per-file diameter analysis. |
None
|
Source code in src/acqstore/acq_image/analysis/batch/diameter_batch_strategy.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | |
process_file ¶
process_file(
acq_image: AcqImage, *, cancel_event: Event
) -> BatchFileResult
Run diameter analysis for one file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
acq_image
|
AcqImage
|
Acquisition image to analyze. |
required |
cancel_event
|
Event
|
Shared cancellation event. |
required |
Returns:
| Type | Description |
|---|---|
BatchFileResult
|
Per-file batch result. The |
BatchFileResult
|
it is not saved. |
Source code in src/acqstore/acq_image/analysis/batch/diameter_batch_strategy.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |