[Insight-developers] PNG unsupported in modular ITK

Xiaoxiao Liu xiaoxiao.liu at kitware.com
Tue Mar 15 14:56:12 EDT 2011


Hi David,
  Sorry for the confusion.
  In your case, Luis's solutions are sufficient for now. Let me know if you
have problems in any of the options he provided.
  It makes  sense to enable common image formats by default (not just for
the test driver), as it used to be.  Note that we haven't use
 "CMake/EnablePreregisteredImageIOFactories.cmake"  yet in modularized ITK.
We will be working on it.

  My explanation by saying "If your testing code uses the test driver and
specifies "ITK-TestKernel" in your module dependency list, it should run
smoothly. " is only valid for testing in your own module.
(I was assuming you had created your own module and wanted to test the PNG
IO through test driver.)  You can ignore for now.  We will elaborate in our
wiki page later to show examples.



On Tue, Mar 15, 2011 at 2:11 PM, David Doria <daviddoria at gmail.com> wrote:

> 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
>



-- 
---------------------------------------------
*Xiaoxiao Liu*, Ph.D.
R & D Engineer
Kitware Inc <http://www.kitware.com/>.
Clifton Park, NY
Phone: (518) 881-4924  or  (518) 371-3971 x124
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110315/536ce2fb/attachment.htm>


More information about the Insight-developers mailing list