Extract
usage: extract [-h] [-m MODEL] [-r RADIUS] [-t THRESHOLD] [-s DOWN_SCALE]
[-x UP_SCALE] [--num-workers NUM_WORKERS] [-j NUM_THREADS]
[--batch-size BATCH_SIZE]
[--assignment-radius ASSIGNMENT_RADIUS]
[--min-radius MIN_RADIUS] [--max-radius MAX_RADIUS]
[--step-radius STEP_RADIUS] [--targets TARGETS]
[--only-validate] [-d DEVICE] [-o OUTPUT] [--per-micrograph]
[--suffix SUFFIX] [--format {coord,csv,star,json,box}]
[paths ...]
Positional Arguments
- paths
paths to image files for processing, can also be streamed from stdin
Named Arguments
- -m, --model
path to trained subimage classifier. uses the pretrained resnet16 model by default. if micrographs have already been segmented (transformed to log-likelihood ratio maps), then this should be set to “none” (default: resnet16)
Default: “resnet16”
- -r, --radius
radius of the regions to extract
- -t, --threshold
log-likelihood score threshold at which to terminate region extraction, -6 is p>=0.0025 (default: -6)
Default: -6
- -s, --down-scale
DOWN-scale coordinates by this factor. output coordinates will be coord_out = (x/s)*coord. (default: 1)
Default: 1
- -x, --up-scale
UP-scale coordinates by this factor. output coordinates will be coord_out = (x/s)*coord. (default: 1)
Default: 1
- --num-workers
number of processes to use for extracting in parallel, 0 uses main process, -1 uses all CPUs (default: 0)
Default: 0
- -j, --num-threads
number of threads for pytorch, 0 uses pytorch defaults, <0 uses all cores (default: 0)
Default: 0
- --batch-size
batch size for scoring micrographs with model (default: 1)
Default: 1
- --assignment-radius
maximum distance between prediction and labeled target allowed for considering them a match (default: same as extraction radius)
- --min-radius
minimum radius for region extraction when tuning radius parameter (default: 5)
Default: 5
- --max-radius
maximum radius for region extraction when tuning radius parameters (default: 100)
Default: 100
- --step-radius
grid size when searching for optimal radius parameter (default: 5)
Default: 5
- --targets
path to file specifying particle coordinates. used to find extraction radius that maximizes the AUPRC
- --only-validate
flag indicating to only calculate validation metrics. does not report full prediction list
Default: False
- -d, --device
which device to use, <0 corresponds to CPU
Default: 0
- -o, --output
file path to write
- --per-micrograph
write one particle file per micrograph at the location of the micrograph
Default: False
- --suffix
optional suffix to add to particle file paths when using the –per-micrograph flag.
Default: “”
- --format
Possible choices: coord, csv, star, json, box
file format of the OUTPUT files (default: coord)
Default: “coord”