I built the example RGBImageReadWrite.cxx using CMake config generate with CMakeLists.txt and source file for the example and generate bin and built that in vs2017… so far so good, but when I run this example with following command line and arguments it crashes in Writer->Update() line in the source file above!?
RGBImageReadWrite.exe BrainMidSagittalSlice.png BrainMidSagittalSlice.rgb
I read the ITK book about using IO architecture and that it does not matter what is the input file the output file will be RGB for this example, am I write or wrong? according to book everything is delegated in different class under itk::ImageIO class and itk::ImageIOFactory so what would be wrong that on call to writer->Update() program crashes? should I change the input file types?
I did use try-catch pair and it did give me a message that you should use a supported format such as PNGImageIO or JPEGImageIO etc. I did give an input file with png format but 2d and it worked! thanks!
one more question how to open [.mha + raw] file. I don’t know how these two combination would work? how to read them with itk::ImageFileReader or write with itk::ImageFileWriter? any great idea?