Denoise

usage: denoise [-h] [-d DEVICE] [-o OUTPUT] [--suffix SUFFIX]
               [--format FORMAT_] [--normalize] [--stack]
               [--save-prefix SAVE_PREFIX] [-m MODEL [MODEL ...]]
               [-a DIR_A [DIR_A ...]] [-b DIR_B [DIR_B ...]] [--hdf HDF]
               [--preload] [--holdout HOLDOUT] [--lowpass LOWPASS]
               [--gaussian GAUSSIAN] [--inv-gaussian INV_GAUSSIAN]
               [--deconvolve] [--deconv-patch DECONV_PATCH]
               [--pixel-cutoff PIXEL_CUTOFF] [-s PATCH_SIZE]
               [-p PATCH_PADDING] [--method {noise2noise,masked}]
               [--arch {unet,unet-small,unet2,unet3,fcnet,fcnet2,affine}]
               [--optim {adam,adagrad,sgd}] [--lr LR] [--criteria {L0,L1,L2}]
               [-c CROP] [--batch-size BATCH_SIZE] [--num-epochs NUM_EPOCHS]
               [--num-workers NUM_WORKERS] [-j NUM_THREADS]
               [micrographs ...]

Positional Arguments

micrographs

micrographs to denoise

Named Arguments

-d, --device

which device to use, set to -1 to force CPU (default: 0)

Default: 0

-o, --output

directory to save denoised micrographs

--suffix

add this suffix to each output file name. if no output directory is specified, denoised micrographs are written to the same location as the input with a default suffix of “.denoised” (default: none)

Default: “”

--format

output format for the images (default: mrc)

Default: “mrc”

--normalize

normalize the micrographs

Default: False

--stack

denoise a MRC stack rather than list of micorgraphs

Default: False

--save-prefix

path prefix to save denoising model

-m, --model

use pretrained denoising model(s). can accept arguments for multiple models the outputs of which will be averaged. pretrained model options are: unet, unet-small, fcnn, affine. to use older unet version specify unet-v0.2.1 (default: unet)

Default: [‘unet’]

-a, --dir-a

directory of training images part A

-b, --dir-b

directory of training images part B

--hdf

path to HDF5 file containing training image stack as an alternative to dirA/dirB

--preload

preload micrographs into RAM

Default: False

--holdout

fraction of training micrograph pairs to holdout for validation (default: 0.1)

Default: 0.1

--lowpass

lowpass filter micrographs by this amount (in pixels) before applying the denoising filter. uses a hard lowpass filter (i.e. sinc) (default: no lowpass filtering)

Default: 1

--gaussian

Gaussian filter micrographs with this standard deviation (in pixels) before applying the denoising filter (default: 0)

Default: 0

--inv-gaussian

Inverse Gaussian filter micrographs with this standard deviation (in pixels) before applying the denoising filter (default: 0)

Default: 0

--deconvolve

apply optimal Gaussian deconvolution filter to each micrograph before denoising

Default: False

--deconv-patch

apply spatial covariance correction to micrograph to this many patches (default: 1)

Default: 1

--pixel-cutoff

set pixels >= this number of standard deviations away from the mean to the mean. only used when set > 0 (default: 0)

Default: 0

-s, --patch-size

denoises micrographs in patches of this size. not used if < 1 (default: 1024)

Default: 1024

-p, --patch-padding

padding around each patch to remove edge artifacts (default: 500)

Default: 500

--method

Possible choices: noise2noise, masked

denoising training method (default: noise2noise)

Default: “noise2noise”

--arch

Possible choices: unet, unet-small, unet2, unet3, fcnet, fcnet2, affine

denoising model architecture (default: unet)

Default: “unet”

--optim

Possible choices: adam, adagrad, sgd

optimizer (default: adagrad)

Default: “adagrad”

--lr

learning rate for the optimizer (default: 0.001)

Default: 0.001

--criteria

Possible choices: L0, L1, L2

training criteria (default: L2)

Default: “L2”

-c, --crop

training crop size (default: 800)

Default: 800

--batch-size

training batch size (default: 4)

Default: 4

--num-epochs

number of training epochs (default: 100)

Default: 100

--num-workers

number of threads to use for loading data during training (default: 16)

Default: 16

-j, --num-threads

number of threads for pytorch, 0 uses pytorch defaults, <0 uses all cores (default: 0)

Default: 0