[Insight-developers] PNG unsupported in modular ITK
David Doria
daviddoria at gmail.com
Tue Mar 15 14:11:03 EDT 2011
On Tue, Mar 15, 2011 at 1:44 PM, Xiaoxiao Liu <xiaoxiao.liu at kitware.com>wrote:
> During the modularization process, we separated all the IO codes into
> image-format-specific modules: e.g. itkPNGImageIO classes are now located in
> ITK-IO-PNG module.
> Each IO module has its own IO tests.
>
> We also created the test driver (
> ITK/ITK/Core/TestKernel/CreateTestDriver.cmake) that registered with the
> mostly common used image formats: PNG, JPEG.Meta, TIFF etc (listed in:
> ITK/Core/TestKernel/include/itkTestDriverIncludeRequiredIOFactories.h).
>
> If your testing code uses the test driver and specifies "ITK-TestKernel" in
> your module dependency list, it should run smoothly.
> Can you show your codes (including CMakeLists.txt) for further diagnosis?
>
Below is the cxx file and the CMakeLists.txt
#include "itkImage.h"
#include "itkImageFileReader.h"
int main(int argc, char *argv[])
{
if(argc < 2)
{
std::cerr << "Required: filename" << std::endl;
return EXIT_FAILURE;
}
std::string inputFilename = argv[1];
typedef itk::Image< unsigned char, 2 > ImageType;
typedef itk::ImageFileReader<ImageType> ReaderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(inputFilename.c_str());
reader->Update();
return EXIT_SUCCESS;
}
cmake_minimum_required(VERSION 2.6)
PROJECT(ImageFileReader)
FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE})
ADD_EXECUTABLE(ImageFileReader ImageFileReader.cxx)
TARGET_LINK_LIBRARIES(ImageFileReader ${ITK_LIBRARIES})
What do you mean by
"If your testing code uses the test driver and specifies "ITK-TestKernel" in
your module dependency list, it should run smoothly."
I built ITK with testing enabled with no change.
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110315/46640822/attachment-0001.htm>
More information about the Insight-developers
mailing list