I installed ITK with CMake using Visual Studio Generator in debug mode.
But I am not configuring my example using CMake. How to do that?
I just copied code from ITK website and running it in Visual Studio. In properties, I linked include and library files.
What is this Ws2_32.lib? Where can I get that? And do I need to link into linker?
It is one of the well-known Windows libraries. When compiling with Visual Studio, you don’t need to supply the full path to the library, just the file name should be enough.
But you should not be dealing with that. Here is how to configure an example using CMake. Just replacing HelloInsight.cxx by DicomImageReadWrite.cxx should be enough. If you run into issues, let us know.
thank you for the details.
I configured DicomImageReadWrite.cxx example according to the link you provide.
But I don’t understand the last step which is “to run the executable (in my case it should be ./DicomImageReadWrite)”.
Should I run it in command prompt? Like other steps.
If I did, it is showing wrong command for ‘.’
How should I do it?
And also, for this example it needs input dicom image. So should I put my dicom image in build directory or other else? and while executing it, it needs 4 arguments. How to give it? with .dcm extension?
and is there no other way to open my program in Visual studio and run it there only, so I can debug my code there.
Please provide me answer for it.
In both cases my input image is in working directory.
Sorry but i don’t understand anything.
Could you please provide me step by step procedure?
And also last time I was working with Linux and all these ITK programs were working fine and after running any example I was getting output image showing immediately. But in windows, will it show my output image directly or it will only save it in that particular directory ? and then i have to open it in dicom viewer?
In this case, you need to change startup project from ALL_BUILD to DicomImageReadWrite. Right click on DicomImageReadWrite and choose Set as StartUp project.
In second case, you need to put quotes around path which has spaces, e.g. ITKProgram.exe "E:\ITK projects\blabla\image.nrrd" out1.mha out2.dcm out3.tif. Without quotes, E:\ITK gets interpreted as first argument, and projects\blabla\image.nrrd as the second.
This example just writes the outputs to disk. You will need to load them in an image viewer (e.g. Slicer). The same would have been true on Linux, given the same source code.
But why is it not reading the DICOM image?
what should I do to solve this error?
I tried different examples. but none of those examples are working.
I am using code which is mentioned on website.
Last time it was working with my Linux system.