[Insight-users] cannot find itkImageFileReader.h in itkApplications

Dominique Töpfer dominique at toepfer-web.de
Tue Nov 8 11:49:23 EST 2011


You need to to include itkImageFileWriter.h and itkImageFileReader.h.

On 08.11.2011 17:44, ankit master wrote:
> Hello Dominique,
>
> Sorry to bug you again,  Following is what I am trying to do and I get 
> errors,
>
> source: 
> http://en.wikipedia.org/wiki/Insight_Segmentation_and_Registration_Toolkit 
>
>
> #include <iostream >
> #include "itkImage.h"
>
> int main (int argc, char** argv)
> {
>     typedef itk::Image< float , 3 > ImageType;
>     typedef itk::ImageFileReader< ImageType >  ReaderType;
>     typedef itk::ImageFileWriter< ImageType >  WriterType;
>
>
> std::cout << "this may work" << std::endl;
>
> system("PAUSE");
>
> return 0;
>
> }
>
>
>
> Error :
>
> 1>------ Build started: Project: myProject, Configuration: Debug Win32 
> ------
> 1>Compiling...
> 1>myProject.cxx
> 1>..\myProject\myProject.cxx(8) : error C2039: 'ImageFileReader' : is 
> not a member of 'itk'
> 1>..\myProject\myProject.cxx(8) : error C2143: syntax error : missing 
> ';' before '<'
> 1>..\myProject\myProject.cxx(8) : error C4430: missing type specifier 
> - int assumed. Note: C++ does not support default-int
> 1>..\myProject\myProject.cxx(9) : error C2039: 'ImageFileWriter' : is 
> not a member of 'itk'
> 1>..\myProject\myProject.cxx(9) : error C2143: syntax error : missing 
> ';' before '<'
> 1>..\myProject\myProject.cxx(9) : error C4430: missing type specifier 
> - int assumed. Note: C++ does not support default-int
> 1>Build log was saved at 
> "file://c:\Users\amaster\Desktop\AVM_Documents\ITK_Practise\myProject_bin\myProject.dir\Debug\BuildLog.htm"
> 1>myProject - 6 error(s), 0 warning(s)
> 2>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32 
> ------
> 2>Project not selected to build for this solution configuration
> ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 1 skipped 
> ==========
>
>
> I am still not able to get my read Images, could you please suggest 
> what is going wrong here .
>
> thank you
>
> Ankit
>
> 2011/11/8 Dominique Töpfer <dominique at toepfer-web.de 
> <mailto:dominique at toepfer-web.de>>
>
>     itkImageFileReader.h (which btw. is an include file, not a
>     library) is part of ITK. If you configured your project with CMake
>     correctly, there is no need to put the file in your project folder.
>
>
>     On 08.11.2011 16:42, ankit master wrote:
>>     Thank you very much for the prompt reply Dominique, I will fix
>>     this issue and try to re build the application, just out of
>>     curiosity at what location must itkImageFileReader.h be ?
>>
>>     Because it appears that even if I correct the misspelled lib name
>>     I will still have to copy the itkImageFileReader from a location
>>     to my current folder .
>>
>>     Could you please help.
>>
>>     Thank you
>>     Ankit
>>
>>     2011/11/8 Dominique Töpfer <dominique at toepfer-web.de
>>     <mailto:dominique at toepfer-web.de>>
>>
>>         Hi,
>>
>>         this seems to be a simple typo - it's not ikt... but
>>         itkImageFileReader.h
>>
>>         Dominique
>>
>>
>>         On 08.11.2011 16:26, ankit master wrote:
>>>         Hello,
>>>
>>>         I am relatively new to ITK so please bear with my dumb
>>>         question. I successfully installed ITK, VTK and
>>>         ITKApplications, I am trying to build a simple example where
>>>         I am reading in an image and trying to display it,
>>>
>>>         so I included the following libs to my program
>>>
>>>         #include "itkImage.h"
>>>         #include "iktImageFileReader.h"
>>>         #include "itkImageToVTKImageFilter.h"
>>>
>>>
>>>         when I try to build my program I get the following error
>>>         message
>>>
>>>         1>..\myProject\myProject.cxx(3) : fatal error C1083: Cannot
>>>         open include file: 'iktImageFileReader.h': No such file or
>>>         directory
>>>
>>>
>>>
>>>         I tried to look up online and somewhere it was mentioned
>>>         that itkImageFileReader must be present in
>>>         ITKApplications/Auxillary/vtk./ folder ( which i should copy
>>>         from this folder into the folder where I have my application
>>>         code) , when I look into that folder I do not find the file
>>>         I am looking for (itkImageFileReader and itkImageFileWriter ) .
>>>
>>>         Could anyone please help me with finding the files
>>>         "itkImageFileReader.h" and "itkImageFileWriter.h"
>>>
>>>         itkApplication 3.20
>>>         itk 3.20.1
>>>
>>>         Thank you in advance.
>>>
>>>         Ankit
>>>
>>>
>>>
>>>         Following is my CmakeList.txt file
>>>
>>>         # This is the root ITK CMakeLists file.
>>>         CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
>>>         IF(COMMAND CMAKE_POLICY)
>>>           CMAKE_POLICY(SET CMP0003 NEW)
>>>         ENDIF(COMMAND CMAKE_POLICY)
>>>
>>>
>>>         # This project is designed to be built outside the Insight
>>>         source tree.
>>>         PROJECT(myProject)
>>>
>>>         # Find ITK.
>>>         FIND_PACKAGE(ITK REQUIRED)
>>>         INCLUDE(${ITK_USE_FILE})
>>>
>>>
>>>         #FIND VTK.
>>>         FIND_PACKAGE(VTK REQUIRED)
>>>         INCLUDE(${VTK_USE_FILE})
>>>
>>>         ADD_EXECUTABLE(myProject myProject.cxx )
>>>
>>>         TARGET_LINK_LIBRARIES(myProject ITKCommon ITKIO ITKBasicFilters
>>>                               vtkRendering vtkGraphics vtkHybrid
>>>         vtkImaging vtkIO vt
>>>
>>>         From the withered tree, a flower blooms.
>>>                                                                  - Zen
>>>
>>>
>>>
>>>         _____________________________________
>>>         Powered bywww.kitware.com  <http://www.kitware.com>
>>>
>>>         Visit other Kitware open-source projects at
>>>         http://www.kitware.com/opensource/opensource.html
>>>
>>>         Kitware offers ITK Training Courses, for more information visit:
>>>         http://www.kitware.com/products/protraining.html
>>>
>>>         Please keep messages on-topic and check the ITK FAQ at:
>>>         http://www.itk.org/Wiki/ITK_FAQ
>>>
>>>         Follow this link to subscribe/unsubscribe:
>>>         http://www.itk.org/mailman/listinfo/insight-users
>>
>>
>>         -- 
>>         Dominique Töpfer, Dipl.-Inform.
>>         Institute of Medical Physics
>>         University of Erlangen
>>
>>
>>
>>
>>     -- 
>>
>>     From the withered tree, a flower blooms.
>>                                                              - Zen
>>
>
>
>     -- 
>     Dominique Töpfer, Dipl.-Inform.
>     Institute of Medical Physics
>     University of Erlangen
>
>
>
>
> -- 
>
> From the withered tree, a flower blooms.
>                                                          - Zen
>


-- 
Dominique Töpfer, Dipl.-Inform.
Institute of Medical Physics
University of Erlangen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111108/0d345133/attachment.htm>


More information about the Insight-users mailing list