How to perform the UKFTractography via command line on ubuntu 20.04?

I want to use .sh to batch process my data via UKFTractography ,so maybe I must use the command line of it.How could I do?

I want to use the UKFTractography singlely in order to use batch process on my data for tractography.
when I make the code UKFTractography from github,I met the problem.
I use the correct command from author.
fatal: not a git repository (or any of the parent directories): .git
make[5]: *** [ukf/CMakeFiles/_GEN_GITVER.dir/build.make:60: ukf/CMakeFiles/GEN
make[4]: *** [CMakeFiles/Makefile2:1043: ukf/CMakeFiles/_GEN_GITVER.dir/all] Err
make[3]: *** [Makefile:141: all] Error 2
make[2]: *** [CMakeFiles/UKFTractography.dir/build.make:119: UKFTractography-prey-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:123: CMakeFiles/UKFTractography.dir/all] Erro
make: *** [Makefile:95: all] Error 2

You should be able to just install SlicerDMRI and then you can run something like Slicer --launch UKFTractography. If you run through the GUI first you can see the command line arguments in the log and adjust them as needed for your script.

This is just a one-off script I did to process a bunch of dicom diffusion studies but it may give you some ideas: https://github.com/SlicerDMRI/SlicerDMRI/blob/batchtract/Modules/Scripted/BatchTract/BatchTract.py#L292-L384

OK,thank u very much.I’m trying.Are there some methods that I could use the command line to use the UKFtractography via Slicer5.22?

And I have tried the command line to use the Slicer,but there is no difference.I couldn’t find some thing named UKFTractography in SlicerDMRI.

Couldn’t I use ./UKFTractography in Slicer’s directory?like:
(base) ubuntu@dmri:~/tools/Slicer/NA-MIC/Extensions-31382/UKFTractography/lib/Slicer-5 .2/cli-modules$ ./UKFTractography --help
./UKFTractography: error while loading shared libraries: libITKFactoryRegistration.so: cannot open shared object file: No such file or directory
(base) ubuntu@dmri:~/tools/Slicer/NA-MIC/Extensions-31382/UKFTractography/lib/Slicer-5 .2/cli-modules$

Since the CLI module is in an extension you need to use a command like this:

~/Downloads/Slicer-5.2.2-linux-amd64/Slicer --launch bash -c UKFTractography
1 Like

Thank you very much! Hi pieper,when I use the command how could I indicate the input files and output files?
Because I want to use the Slicer to generate the mask and .nrrd file of bvec bval nii.
the Error occured like the following :

“Error! Must indicate DWI data, mask and tracts output files!”

I think you mean that you have bval/bvec filts and you need .nrrd files for UKF?

You can find converter code here: GitHub - pnlbwh/conversion: Various mri conversion/modification scripts

I mean this command “~/Downloads/Slicer-5.2.2-linux-amd64/Slicer --launch bash -c UKFTractography” how could I input the DWI data, mask and seeds files?

The easiest way to do that is to run the process via the user interface and look at the log file. You’ll see the command line arguments and you need to map those to the files you use.

Thank you very much!I got this!