Usage¶
Information on how to combine one or more anonapi commands to do things like resetting jobs, working with multiple jobs. For more detailed step-by-step instructions on performing a specific task, see Tutorials
Starting a command prompt¶
Anonapi commands are given from a command line or command prompt:
Windows¶
To start a command prompt: press the windows start menu
-> type cmd
press enter
To start a command prompt in a specific folder: find the folder in windows explorer, then shift + right-click
on
that folder -> Open command prompt here
(Dutch: Opdrachtvenster hier openen).
- Linux
This varies between distributions. Common ways are pressing Meta+t,
Konsole
on ubuntu, orTerminal
. For more info see here
Getting info on commands¶
All CLI commands have the following form:
$ anon <command-group> <command> <arguments> # General form
$ anon job info 1234 # Example: get info for job '1234'
$ anon server activate server2 # Example: Activate the server named 'server2'
A list of commands for any command group can be printed this way:
$ anon job # Shows all commands for command group 'job'
$ anon settings # Shows all commands for command group 'settings'
$ anon <command-group> # General form. Shows all commands for any command group
Detailed help on commands is often available directly from the command line by adding --help
to any command. For example:
$ anon job info --help # Shows detailed help for job info
$ anon server activate --help # Shows detailed help for server activate
Information about jobs¶
$ anon server jobs # shows last 100 jobs on server
$ anon job info 123 # shows details for job with id 123
Tip
see Job status codes for more information on job status
Cancel or restart jobs¶
$ anon job reset 123 # reset job with id 123
$ anon job cancel 123 # cancel job with id 123
Multiple jobs at once (batch)¶
More information on job batches: batch
$ cd C:/myfolder # any folder you want. One folder can only contain one batch.
$ anon batch init # initialises an empty batch
$ anon batch add 10 11 13 # add three job ids to this batch
$ anon batch add 20-35 # add fifteen job ids: 20 through to 35
$ anon batch status # print info for all jobs in batch
$ anon batch # see other commands including reset and cancel all
Creating jobs¶
The general procedure for creating a jobs is as follows:
edit the mapping to suit your needs. Most commands for this are in the map command group
based on the mapping, run the create from-mapping command
monitor your jobs progress with the batch status command
Two specific cases are shown below:
Anonymize files from PACS¶
In this example we want to retrieve and anonymize studies from PACS
Quick example¶
Create a folder for your project (will hold a record of jobs created)
Open a command prompt in this folder
Then type the following:
$ anon map init # create a mapping at the source of the data
$ anon map edit # set correct paths, add studyUIDs or accession numbers
$ anon create from-mapping # create jobs on anonymization server
$ anon batch status # monitor the progress of your jobs
Detailed example¶
For this example we want to retrieve and anonymize the following studies from PACS:
A study with AccessionNumber 123456.1234567
A study with AccessionNumber 123456.2234568
A study with StudyInstanceUID 123.1232.23.24
To do this, follow these steps:
$ anon map init
> Initialised example mapping in anon_mapping.csv
$ anon map edit # opens mapping for editing
Now edit the mapping until it looks like this:
## Description ##
Mapping created February 12 2020
## Options ##
project, Wetenschap-Algemeen
destination_path, \\server\share\myoutput
## Mapping ##
source, patient_id, patient_name, description
accession_number:123456.1234567, 001, Patient2, Test PACS project
accession_number:123456.2234568, 002, Patient2, Test PACS project
study_instance_uid:123.1232.23.24, 003, Patient3, Test PACS project
Now close the editor and run anon create from-mapping:
$ anon create from-mapping
> This will create 3 jobs on p01, for projects '['Wetenschap-Algemeen']' etc..
> Done
To monitor the status of your created jobs, use anon batch status:
$ anon batch status