Cli Preproc =========== .. py:module:: petpal.cli.cli_preproc .. autoapi-nested-parse:: This module provides a Command-line interface (CLI) for preprocessing imaging data to produce regional PET Time-Activity Curves (TACs) and prepare data for parametric imaging analysis. The user must provide: * The sub-command. Options: 'weighted-sum', 'motion-correct', 'register-pet', or 'write-tacs'. * Path to PET input data in NIfTI format. This can be source data, or with some preprocessing such as registration or motion correction, depending on the chosen operation. * Directory to which the output is written. * The name of the subject being processed, for the purpose of naming output files. * 3D imaging data, such as anatomical, segmentation, or PET sum, depending on the desired preprocessing operation. * Additional information needed for preprocessing, such as color table or half-life. .. rubric:: Examples * Auto Crop: .. code-block:: bash petpal-preproc auto-crop -i /path/to/input_img.nii.gz -o petpal_crop.nii.gz -t 0.05 * Windowed Motion Correction: .. code-block:: bash petpal-preproc motion-correct -i /path/to/input_img.nii.gz -o petpal_moco.nii.gz --window-size 120 --transform-type QuickRigid * Register to anatomical: .. code-block:: bash petpal-preproc register-pet -i /path/to/input_img.nii.gz -o petpal_reg.nii.gz --motion-target 0 600 --anatomical /path/to/anat.nii.gz * Write regional tacs: .. code-block:: bash petpal-preproc write-tacs -i /path/to/input_img.nii.gz -p sub-001 -o /tmp/petpal_tacs -s /path/to/segmentation.nii.gz -l perlcyno -x * Write regional tacs, deprecated: .. code-block:: bash petpal-preproc write-tacs -i /path/to/input_img.nii.gz -o /tmp/petpal_tacs --segmentation /path/to/segmentation.nii.gz --label-map-path /path/to/dseg.tsv * Half life weighted sum of series: .. code-block:: bash petpal-preproc weighted-series-sum -i /path/to/input_img.nii.gz -o petpal_wss.nii.gz --start-time 1800 --end-time 7200 * SUVR Image: .. code-block:: bash petpal-preproc suvr -i /path/to/input_img.nii.gz -o petpal_suvr.nii.gz --segmentation /path/to/segmentation.nii.gz --ref-region 1 * Gaussian blur image: .. code-block:: bash petpal-preproc gauss-blur -i /path/to/input_img.nii.gz -o petpal_blur.nii.gz --blur-size-mm 8 * Divide image by scale factor: .. code-block:: bash petpal-preproc rescale-image -i /path/to/input_img.nii.gz -o petpal_rescale.nii.gz --scale-factor 1000 * Warp image to atlas: .. code-block:: bash petpal-preproc warp-pet-atlas -i /path/to/input_img.nii.gz -o petpal_reg-atlas.nii.gz --anatomical /path/to/anat.nii.gz --reference-atlas /path/to/atlas.nii.gz * Crop segmentation to PET FOV: .. code-block:: bash petpal-preproc seg-crop -i /path/to/input_img.nii.gz -o petpal_cropped_seg.nii.gz --segmentation /path/to/segmentation.nii.gz .. seealso:: * :mod:`~petpal.preproc.image_operations_4d` - module used for operations on 4D images. * :mod:`~petpal.preproc.motion_corr` - module for motion correction tools. * :mod:`~petpal.preproc.register` - module for MRI and atlas registration. Attributes ---------- .. autoapisummary:: petpal.cli.cli_preproc._PREPROC_EXAMPLES_ Functions --------- .. toctree:: :hidden: /autoapi/petpal/cli/cli_preproc/_add_common_args /autoapi/petpal/cli/cli_preproc/_generate_args .. autoapisummary:: :nosignatures: petpal.cli.cli_preproc._add_common_args petpal.cli.cli_preproc._generate_args Module Contents --------------- .. py:data:: _PREPROC_EXAMPLES_ :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Examples: - Auto crop: petpal-preproc auto-crop -i /path/to/input_img.nii.gz -o petpal_crop.nii.gz -t 0.05 - Windowed moco: petpal-preproc motion-correct -i /path/to/input_img.nii.gz -o petpal_moco.nii.gz --window-size 120 --transform-type QuickRigid - Register to anatomical: petpal-preproc register-pet -i /path/to/input_img.nii.gz -o petpal_reg.nii.gz --motion-target 0 600 --anatomical /path/to/anat.nii.gz - Write regional tacs: petpal-preproc write-tacs -i /path/to/input_img.nii.gz -p sub-001 -o /tmp/petpal_tacs -s /path/to/segmentation.nii.gz -l perlcyno -x - Write tacs, deprecated: petpal-preproc write-tacs-old -i /path/to/input_img.nii.gz -o /tmp/petpal_tacs --segmentation /path/to/segmentation.nii.gz --label-map-path /path/to/dseg.tsv - Half life weighted sum of series: petpal-preproc weighted-series-sum -i /path/to/input_img.nii.gz -o petpal_wss.nii.gz --start-time 1800 --end-time 7200 - SUVR: petpal-preproc suvr -i /path/to/input_img.nii.gz -o petpal_suvr.nii.gz --segmentation /path/to/segmentation.nii.gz --ref-region 1 - Gauss blur: petpal-preproc gauss-blur -i /path/to/input_img.nii.gz -o petpal_blur.nii.gz --blur-size-mm 8 - Divide image by scale factor:s petpal-preproc rescale-image -i /path/to/input_img.nii.gz -o petpal_rescale.nii.gz --scale-factor 1000 - Warp to atlas: petpal-preproc warp-pet-atlas -i /path/to/input_img.nii.gz -o petpal_reg-atlas.nii.gz --anatomical /path/to/anat.nii.gz --reference-atlas /path/to/atlas.nii.gz - SUV: petpal-preproc suv -i /path/to/input_img.nii.gz -o petpal_suv.nii.gz --weight 75 --dose 250 --start-time 1200 --end-time 3600 - Crop segmentation image to PET FOV: petpal-preproc seg-crop -i /path/to/input_img.nii.gz -o petpal_cropped_seg.nii.gz --segmentation /path/to/segmentation.nii.gz - Add eroded white matter region to segmentation image: petpal-preproc eroded-wm -i /path/to/input_segmentation.nii.gz -o petpal_seg_with_eroded_wm.nii.gz - Apply brain mask to PET image: petpal-preproc brain-mask-pet -i /path/to/input_img.nii.gz -o petpal_brain_masked.nii.gz --atlas $FSLDIR/data/standard/MNI152_T1_1mm.nii.gz --mask $FSLDIR/data/standard/MNI152_T1_1mm_brain_mask.nii.gz """ .. raw:: html