pkModelling from bash and python console


#1

dear experts,

it would be great to have an example command for (mac) bash as well as python for invoking pkModelling (and associated parameter set).

thank you so much!


(Andrey Fedorov) #2

PkModeling module is a CLI (Command Line Interface) type of Slicer module. In this sense, the generic instructions for invoking it from command line or from python apply.

Can you please read the following FAQ entries, and let us know what is missing from those that you need to achieve your tasks?


#3

Thanks. I’m struggling with the very basics. I can’t find a description of the command and the way to parse arguments. What I found is an example command posted back in 2015 here. But parameter names seem to have changed.
So I tried this without success ( Image Exception : #22 :: ERROR: Could not open image Applications/Slicer.app/Contents/Extensions-26813/PkModeling/lib/Slicer-4.8/cli-modules/PkModeling Error in slicer input, exiting…):

Slicer --launch Applications/Slicer.app/Contents/Extensions-26813/PkModeling/lib/Slicer-4.8/cli-modules/PkModeling --T1PreBloodValue 1400 --T1PreTissueValue 911 --RelaxivityValue 0.0056 --Hematocrit 0.42 --UsePopulationAIF --InputFourDImageFileName DCE_input.nrrd --OutputKtransFileName Ktrans.nii.gz --ConstantBAT 3 --OutputFittedDataImageFileName outFit.nii.gz

Totally off the track?


(Andrey Fedorov) #4

Did you try --help? It will show all of the parameters of the module.


#5

Yes, I tried that, but got the same error… Seems that Slicer isn’t launching pkmodeling at all…


(Andrey Fedorov) #6

Ah, sorry - I missed your error in the initial post.

I see you are on Mac - can you try running PkModeling directly? I don’t think you need the launcher. The command below works for me:

$ /Applications/Slicer.app/Contents/Extensions-27332/PkModeling/lib/Slicer-4.9/cli-modules/PkModeling --help

USAGE:

   /Applications/Slicer.app/Contents/Extensions-27332/PkModeling/lib/Slicer
                                        -4.9/cli-modules/PkModeling
                                        [--returnparameterfile
                                        <std::string>]
                                        [--processinformationaddress
                                        <std::string>] [--xml] [--echo]
                                        [--deserialize <std::string>]
                                        [--serialize <std::string>]
                                        [--outputDiagnostics <std::string>]
                                        [--fitted <std::string>]
                                        [--concentrations <std::string>]
                                        [--outputBAT <std::string>]
                                        [--outputRSquared <std::string>]