-
Notifications
You must be signed in to change notification settings - Fork 6
6. Batch Processing
The software can also be used to batch process data in a folder. To run the program, you will have to open a terminal and make sure your environment is activated using conda activate "ENVIRONMENT_NAME". To see a list of options, you type napari_lattice -h . The -h means help and will print out a list of options on how to run the program.
You can specify your options in a config file and then call it using
napari-lattice --config "path to yml formatted config file"
For sample config files, check this folder.
The full list of options are:
usage: napari_lattice [-h] --input INPUT --output OUTPUT [--skew_direction SKEW_DIRECTION] [--deskew_angle DESKEW_ANGLE] --processing PROCESSING [--deconvolution DECONVOLUTION][--deconvolution_num_iter DECONVOLUTION_NUM_ITER] [--deconvolution_psf DECONVOLUTION_PSF [DECONVOLUTION_PSF ...]] [--roi_file ROI_FILE] [--channel CHANNEL] [--voxel_sizes VOXEL_SIZES] [--file_extension FILE_EXTENSION] [--time_range TIME_RANGE TIME_RANGE] [--channel_range CHANNEL_RANGE CHANNEL_RANGE] [--workflow_path WORKFLOW_PATH] [--output_file_type OUTPUT_FILE_TYPE]
Lattice Data processing
arguments:
required* (if not using config file):
--input INPUT Enter input file
--output OUTPUT Enter save folder
--processing PROCESSING
Enter the processing option: deskew, crop, workflow or workflow_crop
optional arguments:
-h, --help show this help message and exit
--config CONFIG_FILE Path to yml formatted config file
--skew_direction SKEW_DIRECTION
Enter the direction of skew (default is Y)
--deskew_angle DESKEW_ANGLE
Enter the deskew angle (default is 30)
--deconvolution DECONVOLUTION
Specify the device to use for deconvolution. Options are cpu or cuda_gpu (Requires an NVIDIA graphics card and pycudadecon to be installed)
--deconvolution_num_iter DECONVOLUTION_NUM_ITER
Enter the number of iterations to run Richardson-Lucy deconvolution (default is 10)
--deconvolution_psf DECONVOLUTION_PSF [DECONVOLUTION_PSF ...]
Enter paths to psf file/s separated by commas or you can enter each path with double quotes
--roi_file ROI_FILE Enter the path to the ROI file for performing cropping (only valid for -processing where crop or workflow_crop is specified
--roi_number ROI_NUMBER Enter a number if you only want to process a single ROI (useful for parallel processing)
--voxel_sizes VOXEL_SIZES
Enter the voxel sizes as (dz,dy,dx). Make sure they are in brackets
--file_extension FILE_EXTENSION
If choosing a folder, enter the extension of the files (make sure you enter it with the dot at the start, i.e., .czi or .tif), else .czi and .tif files will be used
--time_range TIME_RANGE TIME_RANclassified = getTitle();GE
Enter time range to extract, default will be entire timeseries if no range is specified. For example, 0 9 will extract first 10 timepoints
--channel_range CHANNEL_RANGE CHANNEL_RANGE
Enter channel range to extract, default will be all channels if no range is specified. For example, 0 1 will extract first two channels.
--workflow_path WORKFLOW_PATH
Enter path to the workflow file '.yml
--output_file_type OUTPUT_FILE_TYPE
Save as either tif or h5, defaults to tif
--channel CHANNEL If input is a tiff file and there are channel dimensions but no time dimensions, choose as True
The config file option works in tandem with the command line so you can define some parameters using the config file and the rest using the terminal. If a parameter is set in neither config file nor the command, then defaults will be used.
As an example, if you would like to deskew a bunch of files in a folder, you would need to define the input folder, save location and processing option (deskew). The skew direction by default is Y and deskew angle is 30.
If the input folder is:
C:\source
and output or save location is:
C:\deskewed
then you run the command,
napari_lattice --input "C:\source" --output "C:\deskewed" --processing deskew
Note that the folder locations are in quotes. This is useful especially if you have spaces in the folder names.
If you'd like to run cropping and deskew and have a list of ImageJ ROI files (.zip) files which are located at, say D:\rois and the folder locations are the same as above, then we can use the command:
napari_lattice --input "C:\source" --output "C:\deskewed" --roi_file "D:\rois" --processing crop
Note: The ROI files need to have the same name as the image files.
You can also replace the input, output, and roi_file arguments with file locations instead of folders.
Please find sample data for testing in the sample_data folder above
Data Credit: Cindy Evelyn & Niall Geoghegan, Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia