Run examples from Windows command line

Hello !I am just a beginner ,and want to know how to give command line input of images to .exe file created after building from cmake and visual studio?Like in ImageRegistration1.cxx there are six argc ,how to give input to that file?

Welcome to ITK, Syed! :sunny:

The build examples can be called by opening a command prompt (run cmd.exe). Then, call the .exe file and pass command line arguments to the executable. You will likely need to change directories to the folder that contains the command with the cd command. The command line arguments become argc and argv to the main function.

See, for example:

Here is an example of invoking it:

1 Like

Thank you for your response. Here the example is attached if I am using the single image multiple times its running fine but with different images, it’s throwing the error.

And another question is for visualization of the processed image we have to use to feed that image to vtk for visualization, right?
The bigger picture is, I want to register MRI and PET images together using ITK and visualization have to use VTK and make GUI for loading images and show register image on Visual Studio GUI.
Registration methods may be geometrical base or landmark base method.
If you people give your expert opinion I would be highly thankful to you.opinion on how to pipeline this task step by step.
I have make GUI in Visual Studio using Qt.

Can you show us the error? What you have shown is not an error. It says that registration finished after 0 steps, with perfect registration. Of course - fixed and moving images are identical.

While you could go the route of writing your own visualization code, using existing image viewers such as Slicer and ITK-SNAP is much easier, faster and probably better. Just write the images to disk from your program and load them in a viewer. You could also use QuickView for basic visualization.

I am trying this example now through cmd and by changing the main function to void and enter the path in cxx file. By both ways following error is come along.

The second thing is there any example where we can do registration using landmark method b choosing landmarks and a thin plate or BSpline as an interpolator.Thanks