Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running in non-interactive mode #47

Open
adityaapte opened this issue Feb 12, 2021 · 1 comment
Open

Running in non-interactive mode #47

adityaapte opened this issue Feb 12, 2021 · 1 comment

Comments

@adityaapte
Copy link

Thanks for the nice toolkit. Is there documentation to get started on using PTK in batch mode? I would like to run airway segmentation on a bunch of CT scans without going through the GUI.

@tomdoel
Copy link
Owner

tomdoel commented Mar 8, 2021

Hi, there are a few ways to run in a non-interactive/batch mode.

  • The most powerful way is to use the API in your own Matlab code - Tutorial 3 in an introduction to this. You need to import the data into PTK using the PTKMain() object and loop through your scans and create a PTKDataset() object for each scan. You then call the GetResult() method on this object to run a particular plugin on that scan. You can see which airway plugins are available in the Plugins/Airways directory and of course you can write your own.
  • You can also skip the plugins architecture and directly run the underlying image processing functions which are mostly in the Library/Airways/ folder. What plugins actually do is to glue together these functions into a pipeline.
  • It's also possible to skip Matlab altogether and run the command-line executable PulmonaryToolkitApi. You can download this from github or compile it yourself. The excutable is limited to running the batch scripts in the Scripts directory, although if you comoile it yourself then you can add your own custom scripts. There is some very limited documentation here.

Note: When working with the plugin or function outputs you might need to parse the special data structures that are produced - for example airway plugins tend to produce tree structures derived from PTKTree. You can look at the plugin and function code to understand how to parse these outputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants