Command Line

The kwneuro command provides file-based entry points for common one-step workflows. It is meant for quick checks, shell scripts, and interoperability with existing file workflows. For custom pipelines, reusable Python code, and fine-grained resource control, use the Python API directly.

kwneuro

Run common kwneuro file-based workflows.

Usage

kwneuro [OPTIONS] COMMAND [ARGS]...

dwi

DWI commands.

Usage

kwneuro dwi [OPTIONS] COMMAND [ARGS]...

denoise

Denoise a DWI and write NIfTI/FSL outputs.

Usage

kwneuro dwi denoise [OPTIONS]

Options

--dwi <dwi_path>

Required

--bval <bval>
--bvec <bvec>
--out-dwi <out_dwi>

Required

dti

Fit DTI and optionally write FA/MD maps.

Usage

kwneuro dwi dti [OPTIONS]

Options

--dwi <dwi_path>

Required

--bval <bval>
--bvec <bvec>
--mask <mask_path>
--out-dti <out_dti>

Required

--out-fa <out_fa>
--out-md <out_md>

mean-b0

Compute the mean b=0 image from a DWI.

Usage

kwneuro dwi mean-b0 [OPTIONS]

Options

--dwi <dwi_path>

Required

--bval <bval>
--bvec <bvec>
--out <out_path>

Required

mask

Brain mask commands.

Usage

kwneuro mask [OPTIONS] COMMAND [ARGS]...

dwi-batch

Batch brain extraction for DWI files under an input directory.

Usage

kwneuro mask dwi-batch [OPTIONS]

Options

--inputs <inputs>

Required

--outputs <outputs>

Required

--sequential

Disable HD-BET multiprocessing for embedded Python environments.

structural-batch

Batch brain extraction for structural NIfTI files under an input directory.

Usage

kwneuro mask structural-batch [OPTIONS]

Options

--inputs <inputs>

Required

--outputs <outputs>

Required

--sequential

Disable HD-BET multiprocessing for embedded Python environments.

registration

Registration and transform commands.

Usage

kwneuro registration [OPTIONS] COMMAND [ARGS]...

apply

Apply a saved transform to a moving volume.

Usage

kwneuro registration apply [OPTIONS]

Options

--transform <transform_dir>

Required

--fixed <fixed_path>

Required

--moving <moving_path>

Required

--out <out_path>

Required

--invert
--interpolation <interpolation>
Default:

'linear'

dwi-to-structural

Register a DWI mean b0 image to a structural image.

Usage

kwneuro registration dwi-to-structural [OPTIONS]

Options

--dwi <dwi_path>

Required

--bval <bval>
--bvec <bvec>
--structural <structural_path>

Required

--out-transform <out_transform>

Required

--transform <type_of_transform>
Default:

'Rigid'

--dwi-mask <dwi_mask_path>
--structural-mask <structural_mask_path>

volumes

Register a scalar moving volume to a fixed reference volume.

Usage

kwneuro registration volumes [OPTIONS]

Options

--fixed <fixed_path>

Required

--moving <moving_path>

Required

--out <out_path>

Required

--out-transform <out_transform>

Required

--transform <type_of_transform>
Default:

'SyN'

--mask <mask_path>
--moving-mask <moving_mask_path>

structural

Structural MRI commands.

Usage

kwneuro structural [OPTIONS] COMMAND [ARGS]...

bias-correct

Apply N4 bias-field correction to a structural image.

Usage

kwneuro structural bias-correct [OPTIONS]

Options

--image <image_path>

Required

--out <out_path>

Required

extract-brain

Extract a brain mask from a structural image.

Usage

kwneuro structural extract-brain [OPTIONS]

Options

--image <image_path>

Required

--out-mask <out_mask>

Required

parcellate

Parcellate a structural image.

Usage

kwneuro structural parcellate [OPTIONS]

Options

--image <image_path>

Required

--out <out_path>

Required

--method <method>
Default:

'dkt'

Options:

dkt

segment-tissues

Segment structural image tissues into labeled classes.

Usage

kwneuro structural segment-tissues [OPTIONS]

Options

--image <image_path>

Required

--out <out_path>

Required

--mask <mask_path>
--method <method>
Default:

'atropos'

Options:

atropos | deep_atropos