Hi Suchita,<br><br><br> You are not following the step-by-step instructions<br> given in the Tutorial.<br><br><br>You should do:<br><br><ul><li>Create a source directory outside of ITK<br>(Let's say C:\ITKExample1Source)</li>
<li>Create a binary directory outside of ITK<br>(Let's say C:\ITKExample1Binary)</li><li>Copy the example that you want to run into the Source directory. For example, copy "Examples\Image\Image1.cxx" to "C:\ITKExample1Source"</li>
<li>Open a Text editor and write a CMakeLists.txt file, that you will put in "C:\ITKExample1Source".</li><li>The content of the CMakeLists.txt file should be<br><br></li><ul><li>CMAKE_MINIMUM_REQUIRED(VERSION 2.4)<br>
IF(COMMAND CMAKE_POLICY)<br> CMAKE_POLICY(SET CMP0003 NEW)<br>ENDIF(COMMAND CMAKE_POLICY)<br>PROJECT(Example1)<br><br>FIND_PACKAGE(ITK REQUIRED)<br>INCLUDE(${ITK_USE_FILE})<br><br>ADD_EXECUTABLE(Image1 Image1.cxx )<br>TARGET_LINK_LIBRARIES(Image1 ITKCommon)<br>
<br></li></ul><li>Run CMake</li><ul><li>Provide C:\ITKExample1Source as the directory where the sources are</li><li>Provide C:\ITKExample1Binary as the directory where the binaries will be build</li><li>In the ITK_DIR directory, provide the directory where you built ITK.</li>
<li>Configure</li><li>Generate</li></ul><li>Open the solution file: C:\ITKExample1Binary/Image1.sln with Visual Studio</li><li>Select "Build" (or hit F7).</li><li>This should build the project</li><li>Open the command line prompt (as shown in the video)</li>
<li>cd to C:\ITKExample1Binary</li><li>in the Release or Debug sub-directory you should find the executable file Image1.exe</li><li>type "Image1.exe" <br></li><li>this should run the example</li><li>Note that Image1.cxx doesn't print any output. You will have to add some std::cout messages in order to make it more interesting.<br>
</li></ul><br>You can now repeat this process with any other example. <br>The ones in Examples/IO and Examples/Filtering will be <br>more interesting, they will require inputs. You will find<br>convenient input images in <br>
<br> Insight/Examples/Data<br><br>For example, you can run the Median image filter by using<br><br> Insight/Examples/Filtering/MedianImageFilter.cxx<br><br>following the process above, and then running the executable<br>
from the command prompt by typing:<br><br>MedianImageFilter.exe BrainProtonDensitySlice.png Median.png<br><br>Note that you may have to copy the input image from the<br><br>Insight/Examples/Data directory, into the binary directory where<br>
you have the executable.<br><br><br> Regards,<br><br><br> Luis<br><br><br><br>----------------------------------------------------<br><div class="gmail_quote">On Sun, Aug 16, 2009 at 12:02 PM, Suchita Manandhar <span dir="ltr"><<a href="mailto:suchitamanandhar@hotmail.com">suchitamanandhar@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
Hey Luis,<br>
<br>
Yah I have been following that tutorials and ofcourse I am going through that link too. But If my program error is like:<br>
<br>
can't open the "itkImage.h" file or something related with header files, How do I include those files. Well Those files are already in ..\ITK\InsightToolkit\Code\Common right. And my program is ..\ITK\InsightToolKit\Examples\Image\Image1.cxx. Now When I try to build Image1.cxx, it says "itkImage.h" couldn't be found. So to avoid this problem, Do I have to change the path in CMakeLists.txt or in program. Well in the Image1.cxx, there just we have to do is include ItkImage.h as "#include "itkImage.h" ". But still it is giving the same problem. So in that case, Do we have to change something in CMakeLists.txt like as below:<br>
<br>
<br>ADD_EXECUTABLE(Image1 Image1.cxx )<br>TARGET_LINK_LIBRARIES(Image1 ITKCommon)<br>
<br>
in this part of code in the CMakeLists, do we have to change anywhere. TARGET_LINK_LIBRARIES(Image1 ITKCommon), in this one this ITKCommon is the one which is the link to header file right. so I tried giving the full path for the common folder. Whats that all about. How to solve this. I am so sorry I am still confused with this.<br>
<br>
<br>
Thank you<br>
<br>
<br>
Regards<br><br>suchita<br><br><br> <br>
<hr>
Date: Sun, 16 Aug 2009 11:07:08 -0400<div><div></div><div class="h5"><br>Subject: Re: [Insight-users] Error<br>From: <a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a><br>To: <a href="mailto:suchitamanandhar@hotmail.com" target="_blank">suchitamanandhar@hotmail.com</a><br>
CC: <a href="mailto:Insight-users@itk.org" target="_blank">Insight-users@itk.org</a><br><br><br><br>Hi Suchita,<br><br><br>Yes, it makes a difference to run a program by directly double clicking<br>on the .exe file, or running it from the command line.<br>
<br>The difference is that in the first case you don't have a mechanism for<br>passing the command line arguments to the program, while in the second<br>case you can.<br><br>Your situation illustrates the pernicious effect that GUIs have on users. <br>
They prevent you from understanding how the essential element of software<br>works, and create an environment of ignorance and dependency.<br><br>We have an entire generation of developers who don't know what <br>command line arguments are, and who are ignorant of what really<br>
happens below the surface of the Windows interface.<br><br><br> There is not much that we can do for you <br> if you are not interested in learning....<br><br><br>Regarding the new question that you post in the second part of your<br>
email: That's the consequence of trying to build an application by<br>default from the Visual Studio interface, instead of configuring it <br>with CMake.<br><br><br> You will have to first decide if you really want to learn.<br>
<br><br>After that you may benefit from following the Tutorials:<br><br><a href="http://www.itk.org/ITK/help/tutorials.html" target="_blank">http://www.itk.org/ITK/help/tutorials.html</a><br><br>In particular, you should read:<br>
<a href="http://www.itk.org/CourseWare/Training/GettingStartedI-WebPage/index.htm" target="_blank">http://www.itk.org/CourseWare/Training/GettingStartedI-WebPage/index.htm</a><br><br><br> Regards,<br><br><br> Luis<br>
<br><br>--------------------------------------------------------------------------------<br>
<div>On Sun, Aug 16, 2009 at 10:41 AM, Suchita Manandhar <span dir="ltr"><<a href="mailto:suchitamanandhar@hotmail.com" target="_blank">suchitamanandhar@hotmail.com</a>></span> wrote:<br>
<blockquote style="padding-left: 1ex;">
<div>Hello Luis,<br> <br>Thanks for the link. But it doesn't solve my problem. I think it shouldn't make any difference if i directly click .exe file or use command prompt to run it. But in both case, the same thing. Well So I again tried from the beginning. This time I tried to run Data Representation/Image files. I ran CMake and configured it. It was ok with this. Configuration successful. Then I tried to build the .sln file. It showed "stdafx.h" file missing. Then I included this in all the file and rebuilded it. Then again it showed:can't open include file itkImage.h,itkTestMain.h ,itkVector.h .Now how to solve this. where and how shall i include those file ? What Should I do to solve this problem.<br>
<br>Thanks<br> <br>Regards,<br>Suchita<br><br><br><br><br>
<hr>
Date: Sat, 15 Aug 2009 23:04:20 -0400
<div>
<div></div>
<div><br>Subject: Re: [Insight-users] Error<br>From: <a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a><br>To: <a href="mailto:suchitamanandhar@hotmail.com" target="_blank">suchitamanandhar@hotmail.com</a><br>
CC: <a href="mailto:Insight-users@itk.org" target="_blank">Insight-users@itk.org</a><br><br><br>Hi Suchita,<br><br>Please watch this instructional video in Youtube:<br><br><a href="http://www.youtube.com/watch?v=foYsmpDrYjY&feature=PlayList&p=6D392A9F3AD04537&playnext=1&playnext_from=PL&index=57" target="_blank">http://www.youtube.com/watch?v=foYsmpDrYjY&feature=PlayList&p=6D392A9F3AD04537&playnext=1&playnext_from=PL&index=57</a><br>
<br>and read the Wikipedia page:<br><br><a href="http://en.wikipedia.org/wiki/Command_Prompt_%28Windows%29" target="_blank">http://en.wikipedia.org/wiki/Command_Prompt_(Windows)</a><br><br>and look at the list DOS commands that you can<br>
use in the command prompt:<br><br><a href="http://en.wikipedia.org/wiki/List_of_DOS_commands" target="_blank">http://en.wikipedia.org/wiki/List_of_DOS_commands</a><br><br>In particular you need to learn: <br><br>
<ul>
<li>cd</li>
<li>dir</li>
<li>del</li>
<li>copy</li>
<li>set<br></li></ul><br>Once you get familiar with the command prompt,<br>you should do:<br><br>
<ul>
<li>"cd" to the binary directory where you build your example</li>
<li>type "dir" and locate the .exe file</li>
<li>type the name of the executable followed by the command line arguments.</li></ul><br><br>Regards,<br><br><br> Luis<br><br>---------------------------------<br>
<div>On Sat, Aug 15, 2009 at 10:55 PM, Suchita Manandhar <span dir="ltr"><<a href="mailto:suchitamanandhar@hotmail.com" target="_blank">suchitamanandhar@hotmail.com</a>></span> wrote:<br>
<blockquote style="padding-left: 1ex;">
<div>Hello Luis,<br> <br>Well Can you please help me how can I run those programs from the command line then. I have been using Windows vista and i am using Visual C++.Net. I opened the console application and tried to run these programs. Can you refer any links so that I can get into those. <br>
<br>Thanks<br><br>suchita<br><br><br> <br>
<hr>
Date: Sat, 15 Aug 2009 20:07:44 -0400<br>Subject: Re: [Insight-users] Error<br>From: <a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a><br>To: <a href="mailto:suchitamanandhar@hotmail.com" target="_blank">suchitamanandhar@hotmail.com</a><br>
CC: <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>
<div>
<div></div>
<div><br><br>Hi Suchita,<br><br>All the Examples in ITK are are intended to be run<br>from the command line.<br><br>Please get familiar with the process of calling <br>command line programs in your platform.<br><br><br> Regards,<br>
<br><br> Luis<br><br><br>-----------------------------------------------------<br>
<div>On Mon, Aug 10, 2009 at 10:23 PM, Suchita Manandhar <span dir="ltr"><<a href="mailto:suchitamanandhar@hotmail.com" target="_blank">suchitamanandhar@hotmail.com</a>></span> wrote:<br>
<blockquote style="padding-left: 1ex;">
<div><br>Hello ,<br> <br> <br>I have some error running the program...I tried to run BinaryMediumImageFilter.cxx file. But it is giving error. In the code section, there is <br> <br>if( argc < 4 )<br> {<br> std::cerr << "Usage: " << std::endl;<br>
std::cerr << argv[0] << " inputImageFile outputImageFile radiusX radiusY" << std::endl;<br> return EXIT_FAILURE;<br> }<br> <br> <br>and my program just executes this part and throw error. How to solve this ? <br>
<br> <br>Thank you<br>suchita<br><br><br><br>
<hr>
Get free photo software from Windows Live <a href="http://www.windowslive.com/online/photos?ocid=PID23393::T:WLMTAGL:ON:WL:en-US:SI_PH_software:082009" target="_blank">Click here.</a></div><br>_____________________________________<br>
Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br><br></div></div>
<hr>
Get your vacation photos on your phone! <a href="http://windowsliveformobile.com/en-us/photos/default.aspx?&OCID=0809TL-HM" target="_blank">Click here.</a></div></blockquote></div><br><br></div></div>
<div>
<hr>
Hotmail® is up to 70% faster. Now good news travels really fast. <a href="http://windowslive.com/online/hotmail?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_faster:082009" target="_blank">Try it now.</a></div></div></blockquote>
</div><br><br></div></div><hr>Get back to school stuff for them and cashback for you. <a href="http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1" target="_blank">Try BingT now.</a></div>
</blockquote></div><br>