public class SerialProcessingTask extends AbstractProcessingTask implements IExplicitProcessingTask
1...n items
sequentially.SwingWorker.StateValue| Modifier and Type | Field and Description |
|---|---|
private Class<?> |
caller |
private static org.apache.log4j.Logger |
logger |
(package private) int |
nStackItems
The number of items to be processed.
|
(package private) File |
virtDir
A file object representing the virtual directory.
|
childTask, duration, headless, operator, operatorGUI, parentTask, startTime, virtual, workPackage| Constructor and Description |
|---|
SerialProcessingTask()
A default constructor.
|
SerialProcessingTask(IWorkPackage wp,
boolean virtual)
This is the constructor.
|
SerialProcessingTask(IWorkPackage wp,
IOperatorGUI opGUI,
boolean virtual)
This is the constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private List<ArrayList<IqmDataBox>> |
addResultsToList(Result singleResult,
List<ArrayList<IqmDataBox>> resultList)
A helper method for filling the final result list from an operator and
for optional writing of the processed items to the hard disk.
|
protected List<ArrayList<IqmDataBox>> |
doInBackground()
This method must be implemented by all subclasses.
|
protected void |
done()
Display the results using the
ResultVisualizer class. |
private List<ArrayList<IqmDataBox>> |
executeDefaultRoutine()
This method executes the operator of this task on each element
separately.
|
private List<ArrayList<IqmDataBox>> |
executeMultiStackEvenRoutine()
This method executes the operator of this task in a serial manner across
two parallel item stacks of the same size.
|
private List<ArrayList<IqmDataBox>> |
executeMultiStackOddRoutine()
This method executes the operator of this task in a serial manner across
one item stack and a single item.
|
private List<ArrayList<IqmDataBox>> |
executeSingleStackSequentialRoutine()
This method executes the operator of this task in a serial manner within
a single stack.
|
List<ArrayList<IqmDataBox>> |
processExplicit()
This method returns an object that can be cast to any other class.
|
getChildTask, getOperator, getOperatorGUI, getParentTask, getWorkPackage, isHeadless, isVirtual, process, setChildTask, setHeadless, setOperator, setOperatorGUI, setParentTask, setVirtual, setWorkPackageaddPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, publish, removePropertyChangeListener, run, setProgressprivate Class<?> caller
private static final org.apache.log4j.Logger logger
int nStackItems
File virtDir
public SerialProcessingTask(IWorkPackage wp, boolean virtual)
headless will be set to true.
This constructor shall be used when no GUI is needed to be updated.
Hint: Use this in scripts.
wp - the work package for this taskvirtual - a flag for virtual processingpublic SerialProcessingTask(IWorkPackage wp, IOperatorGUI opGUI, boolean virtual)
headless will be set to false.
This constructor shall be used when a GUI is needed to be updated.wp - the work package for this taskvirtual - a flag for virtual processingopGUI - the calling operator guipublic SerialProcessingTask()
headless will be set to
true.protected List<ArrayList<IqmDataBox>> doInBackground() throws Exception
AbstractProcessingTaskdoInBackground in class AbstractProcessingTaskget().ExceptionSwingWorker.doInBackground()protected void done()
ResultVisualizer class.done in class AbstractProcessingTaskprivate List<ArrayList<IqmDataBox>> executeDefaultRoutine() throws Exception
The number of total output elements is equal to the number of source
elements but an operator may produce more than one result. Thus, a
List<ArrayList<IqmDataBox>> is generated.
Exception - if anything goes wrong during processingprivate List<ArrayList<IqmDataBox>> executeSingleStackSequentialRoutine() throws Exception
The number of processed elements is equal to the number of source
elements, but the items are about to be combined pairwise. Each pair
consists of subsequent items, e.g. [0,1] --> new_1,
[new_1, 2] --> new_2, and so forth. The first element at
position [0] remains unchanged and is also added as first
element in the result list.
Note: Operators implementing
StackProcessingType.SINGLE_STACK_SEQUENTIAL cannot be executed by
any parallel AbstractProcessingTask!
Exception - if anything goes wrong during processingprivate List<ArrayList<IqmDataBox>> executeMultiStackEvenRoutine() throws Exception
The number of processed elements is equal to the number of source elements, but the items are about to be combined pairwise. Each pair consists of parallel items in the left and right manager list, respectively. The first source item at index 0 is taken from the currently selected manager, and the corresponding second item is taken from the opposite manager list.
For instance: [left_0, right_0] --> new_0,
[left_1, right_1] --> new_1, and so forth.
Exception - if anything goes wrong during processingprivate List<ArrayList<IqmDataBox>> executeMultiStackOddRoutine() throws Exception
The number of processed elements is equal to the number of source elements, but the items are about to be combined pairwise. Each pair consists of one item in the left and right manager list, respectively. The stack is processed using the single item for each calculation.
The first source item at index 0 is taken from the currently selected manager, and the corresponding second item is taken from the opposite manager list.
For instance: [left_0, right_0] --> new_0,
[left_1, right_0] --> new_1,
[left_2, right_0] --> new_2, and so forth.
Exception - if anything goes wrong during processingprivate List<ArrayList<IqmDataBox>> addResultsToList(Result singleResult, List<ArrayList<IqmDataBox>> resultList) throws Exception
The resultList will contain image results in sequential order at
public List<ArrayList<IqmDataBox>> processExplicit() throws Exception
IExplicitProcessingTaskIResult, others use some kind
of List interface as container.processExplicit in interface IExplicitProcessingTaskObjectExceptionCopyright © 2009–2017 Helmut Ahammer, Philipp Kainz. All rights reserved.