I’m currently trying to create a program to read a given 3D image, perform one forward projection from a varying rotation (Only one slice is made), convert that to a 2D image and write it to a PNG file. I’ve modified the base rtkforwardprojection.cxx program by adding code from ImageReadExtractWrite.cxx to convert to a 2d image. However, when I attempt to output to a PNG file, I receive the error:
Description: Could not create IO object for writing file projectedImage.png
Tried to create one of the following:
DCMImagXImageIO
GDCMImageIO
HisImageIO
HncImageIO
HndImageIO
ImagXImageIO
MetaImageIO
OraImageIO
TIFFImageIO
XRadImageIO
XimImageIO
You probably failed to set a file suffix, or set the suffix to an unsupported type.
When I look on the ITK wiki, it states that png is a supported file type, so I’m wondering what I’m doing wrong
No I mistakenly thought that since IO is the name of the directory that holds the ImageIOs, it would be the name I had to include.
I’ve added “ITKImageIO” to the find_package command and now I’m struck with a different error
ld: library not found for -l ITKCommon
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Actually I just built the common library again and now it gives me this error instead:
Undefined symbols for architecture x86_64:
“itk::BMPImageIOFactoryRegister__Private()”, referenced from:
itk::(anonymous namespace)::ImageIOFactoryRegisterRegisterList in rtkgeometry_and_projection.cxx.o
(I cut out this section but it essentially runs through all the image file types)
“itk::Bruker2dseqImageIOFactoryRegister__Private()”, referenced from:
itk::(anonymous namespace)::ImageIOFactoryRegisterRegisterList in rtkgeometry_and_projection.cxx.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I just configured, generated and made all of ITK, RTK and my program using git clones and specifying the MAKE_OSX_ARCHITECTURES = x86_64. I still receive the same error. Is there maybe something wrong with my makefile?
Are you building ITK with ITK_BUILD_DEFAULT_MODULES ON? If you are building ITK with only the modules required for RTK, then only the specified IOs get built, which does not include PNG and BMP. Still, the executable should not try to link to IO modules which were not enabled.
Yes, I am building with ITK_BUILD_DEFAULT_MODULES on. Still getting the same undefined symbols for architecture error. Is there some way to set RTK to get all the required IO modules instead of only a subset? because none of the modules that are specified in the specified IOs are on the error list.