[Insight-users] urgent help
sd d
anis_youssef2003 at yahoo.fr
Wed Jun 16 07:29:29 EDT 2004
Skipped content of type multipart/alternative-------------- next part --------------
/*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: BasicIOAndFilter.cxx,v $
Language: C++
Date: $Date: 2002/10/16 19:19:53 $
Version: $Revision: 1.1 $
Copyright (c) 2002 Insight Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
// This is an example of a simple program involving filters and I/O, expected
// to be modified and compiled as a project outside the Insight source tree.
// This is a good place to start if you have never used Insight before.
//
// Each filter has an Update() method that forces it to make sure its
// output is up to date and available for reading. If Update() has
// been called before, and the input has not changed since that call,
// then no action is performed because the correct data is already
// computed and accessible via GetOutput(). Calling
// someFilter->Update() forces it to call the Update() method of any
// previous filters, so that the updating percolates back to the very
// beginning. The Write() method of a writer calls its Update()
// method. In this program, for instance, the call to writer->Write()
// forces the whole process to execute.
//
// Notice that you must use the smart pointers (e.g., PNGIOType::Pointer) as
// in the example, since the constructor is protected. This permits the
// bookkeeping that allows the Update() calls to work correctly.
//
// Extensive use of typedefs as in the example is recommended.
//
// To build this project, copy it outside the Insight source tree,
// and then follow the same steps you followed to build itk.
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include <itkImage.h>
#include <itkImageFileReader.h>
#include <itkImageFileWriter.h>
#include <itkPNGImageIO.h>
#include <itkBinaryThresholdImageFilter.h>
typedef itk::Image<unsigned char, 2> ImageType;
int main(int argc, char* argv[])
{
if (argc < 2)
{
std::cout
<< "usage: SampleFilterProject [inputfile] [outputfile]"
<< std::endl;
exit(0);
}
try
{
// Instantiate a reader for the file.
typedef itk::ImageFileReader<ImageType> ImageReaderType;
ImageReaderType::Pointer reader = ImageReaderType::New();
reader->SetFileName(argv[1]);
// Instantiate a filter and attach it to the reader.
typedef itk::BinaryThresholdImageFilter<ImageType, ImageType>
ThresholdFilterType;
ThresholdFilterType::Pointer myFilter = ThresholdFilterType::New();
myFilter->SetInput(reader->GetOutput());
myFilter->SetUpperThreshold(128);
myFilter->SetLowerThreshold(0);
// Instantiate a witer and attach it to the filter.
typedef itk::ImageFileWriter<ImageType> ImageWriterType;
ImageWriterType::Pointer writer = ImageWriterType::New();
writer->SetImageIO(itk::PNGImageIO::New());
writer->SetInput(myFilter->GetOutput());
writer->SetFileName(argv[2]);
// Execute the process.
writer->Update();
}
catch(itk::ExceptionObject &err)
{
std::cerr << err << std::endl;
return 1;
}
return 0;
}
-------------- next part --------------
PROJECT(BasicIOAndFilter)
#
# Find ITK
#
# Uncomment the following lines if you want to
# build this code outside the ITK binary tree
INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
IF (USE_ITK_FILE)
INCLUDE (${USE_ITK_FILE})
ENDIF (USE_ITK_FILE)
#specify executables
ADD_EXECUTABLE( BasicIOAndFilter BasicIOAndFilter.cxx )
#TARGET_LINK_LIBRARIES( BasicIOAndFilter ITKIO )
# We only need ITK's Common components. Link to the common libraries.
TARGET_LINK_LIBRARIES(BasicIOAndFilter ${ITK_Common_LIBS} ITKNumerics ITKIO ITKBasicFilters )
-------------- next part --------------
Linking...
Creating library Debug/BasicIOAndFilter.lib and object Debug/BasicIOAndFilter.exp
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_destroy_read_struct
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_create_info_struct
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_create_read_struct
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_sig_cmp
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_read_end
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_read_image
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_get_rowbytes
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_read_update_info
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_set_swap
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_set_tRNS_to_alpha
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_get_valid
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_set_gray_1_2_4_to_8
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_set_palette_to_rgb
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_get_IHDR
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_read_info
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_set_sig_bytes
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_init_io
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_get_channels
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_write_end
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_write_image
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_write_info
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_set_compression_level
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_set_IHDR
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_destroy_write_struct
ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external symbol _png_create_write_struct
ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall MetaImage::~MetaImage(void)" (??1MetaImage@@UAE at XZ)
ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external symbol "bool __cdecl MET_SystemByteOrderMSB(void)" (?MET_SystemByteOrderMSB@@YA_NXZ)
ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external symbol "public: __thiscall MetaImage::MetaImage(void)" (??0MetaImage@@QAE at XZ)
ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external symbol "public: void __thiscall MetaImage::ElementDataFileName(char const *)" (?ElementDataFileName at MetaImage@@QAEXPBD at Z)
ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external symbol "public: float __thiscall MetaObject::Position(int)const " (?Position at MetaObject@@QBEMH at Z)
ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external symbol "public: float __thiscall MetaObject::ElementSpacing(int)const " (?ElementSpacing at MetaObject@@QBEMH at Z)
ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external symbol "public: int __thiscall MetaImage::DimSize(int)const " (?DimSize at MetaImage@@QBEHH at Z)
ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external symbol "public: int __thiscall MetaObject::NDims(void)const " (?NDims at MetaObject@@QBEHXZ)
ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external symbol "public: enum MET_ValueEnumType __thiscall MetaImage::ElementType(void)const " (?ElementType at MetaImage@@QBE?AW4MET_ValueEnumType@@XZ)
ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external symbol "public: int __thiscall MetaImage::ElementNumberOfChannels(void)const " (?ElementNumberOfChannels at MetaImage@@QBEHXZ)
ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external symbol "public: bool __thiscall MetaObject::BinaryData(void)const " (?BinaryData at MetaObject@@QBE_NXZ)
ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external symbol "public: bool __thiscall MetaImage::ElementByteOrderFix(void)" (?ElementByteOrderFix at MetaImage@@QAE_NXZ)
ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external symbol "public: char const * __thiscall MetaImage::ElementDataFileName(void)const " (?ElementDataFileName at MetaImage@@QBEPBDXZ)
ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external symbol "public: void __thiscall MetaObject::BinaryData(bool)" (?BinaryData at MetaObject@@QAEX_N at Z)
ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external symbol "public: void __thiscall MetaObject::Position(float const *)" (?Position at MetaObject@@QAEXPBM at Z)
ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external symbol "public: bool __thiscall MetaImage::InitializeEssential(int,int const *,float const *,enum MET_ValueEnumType,int,void *,bool)" (?InitializeEssential at MetaImage@@QAE_NHPBHPBMW4M
ET_ValueEnumType@@HPAX_N at Z)
Debug/BasicIOAndFilter.exe : fatal error LNK1120: 41 unresolved externals
Error executing link.exe.
ALL_BUILD - 42 error(s), 0 warning(s)
More information about the Insight-users
mailing list