Does ITK-Snap have a CLI interface on Windows?

213 views
Skip to first unread message

Joshua Newton

unread,
Mar 21, 2022, 10:43:30 AM3/21/22
to itksnap-users
Hi there!

I was looking at a previous user question "Launch ITK-snap in command line?" that describes a CLI interface with options such as -g, -s, -l, etc.

But, on Windows, the itksnap binary is instead called ITK-SNAP.exe, and seems to have no CLI functionality -- calling itk-snap -h just launches the ITK-Snap window. (I was hoping that there would be a way to ask ITK-Snap to open an image via a command, rather than having to use the UI.)

Is there something I'm missing? Or, is this functionality available on macOS/Linux-only?

Thank you kindly,
Joshua

mfk16

unread,
Mar 22, 2022, 3:12:02 PM3/22/22
to itksnap-users
Hi Joshua,

I use the CLI in Win 10 

I have a program that can programmatically create a workspace that has an image and corresponding segmentation, via the command line:

itksnap-wt -layers-add-anat "KneeImageFilename.mhd" -layers-add-seg "KneeSegFilename.mhd" -o "WorkspaceFilename.itksnap""


..then I use itk-snap to open the workspace file I just created:

itk-snap -w WorkspaceFilename.itksnap & 


-Matt

Joshua Newton

unread,
Mar 31, 2022, 12:12:26 PM3/31/22
to itksnap-users
Hi Matt,

Thank you very much. You're right, there is a CLI interface on Windows. I have been able to try out some of the aforementioned options, using for example:

ITK-SNAP -g t2.nii.gz -s t2_seg_3d_onnx.nii.gz

I think what confused me is there was no output when I ran "ITK-SNAP -h" or "ITK-SNAP --help" or etc. like I am used to on Mac/Linux platforms, so I assumed that there was no CLI interface. But, it seems to me like ITK-SNAP parses the arguments silently on Windows (without any feedback in the terminal window).

Anyways, my issue is resolved, so thank you again.

-Joshua
Reply all
Reply to author
Forward
0 new messages