Syntax
SGbatchdelete(cmd)
Input Parameter
Examples
SGbatchdelete
job=SGbatchjob('VMreadnifti(''/Volumes/LUETH-WIN/WIN AIM Matlab Libraries/Medical Data/004MITK - Klinikum Sud/004Lumbal vertebral body 1.nii'');');
job=SGbatchjob('[rand(1e3,1e3)*rand(1e3,1e3)]');
wait(job) % Not required
SGbatchresult(job); whos ans
Copyright 2019-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This function, SGbatchdelete
, is designed to manage and delete jobs from a global table, SGBatchIDtable
, which is used in batch processing within the SolidGeometry library. The function can either delete all jobs or a specific job based on the input parameters.
Input Parameters
- varargin: This is a variable-length input argument list. It allows the function to accept a flexible number of input arguments.
Algorithm Steps
- The function begins by declaring a global variable
SGBatchIDtable
, which stores information about batch jobs.
- It calculates the number of entries in
SGBatchIDtable
using the size
function.
- The function retrieves the job ID from the input arguments using
getfuncparams
. If no ID is provided, it defaults to an empty array.
- If the ID is empty, the function assumes that all jobs should be deleted:
- It creates a local parallel cluster object using
parcluster('local')
.
- All jobs in this cluster are deleted using
delete(myCluster.Jobs)
.
- The
SGBatchIDtable
is cleared by setting it to an empty cell array.
- If an ID is provided, the function deletes the specific job:
- A local parallel cluster object is created again using
parcluster('local')
.
- The specific job is found using
findJob(c,'ID',ID)
.
- The job is deleted using
delete(job)
.
- The corresponding entry in
SGBatchIDtable
is cleared by setting it to an array of empty cells.
Example Usage
The function can be used in conjunction with other batch processing functions such as SGbatchjob
, wait
, and SGbatchresult
. An example is provided where a job is created, potentially waited on, and then the result is fetched. The SGbatchdelete
function can be used to clean up the job afterwards.
Algorithm explaination created using ChatGPT on 2025-08-19 00:22. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21