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:

https://www.wikihow.com/Open-the-Command-Prompt-in-Windows

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

Clicking Abort or Ignore might give a more detailed error. And clicking Retry should take you to the source code file where the error is occurring. And we might need you input images to reproduce this issue, it would be good if you shared them.

That is too much interaction for an example. But such a module already exists in Slicer. You can also find some video tutorial such as this one. And ask for further help on Slicer forum.

Sorry, there is error while uploading the image.You can choose any .nii image.
Original image(MRA-TOF). I just use itk snap for the distorted/rotated image.
Actually, we are making a small software in which different registration algorithms can be implemented.
I have to make an intensity base and geometry base algorithm in the software using ITK and QT integration.
I have seen that 3D slicer software examples already, Thank you for referring it.
But we have to create our own implementation so any suggestion for implementing landmark-based algorithms(thin plate and BSpline) or that which is similar to 3D slicer are more than welcome.

You could upload it to a file sharing site and put the link here.


above is the link for MRA image. The rotated version of it is other sample image for registration