I’m trying to construct an
itk::Image from an in-memory buffer, rather than from a file on disk. The image data itself is formatted as an NRRD. The buffer has been filled by an external program, and at some point I would like to be able to write back the image to this buffer (or allocate a new one and write it there).
itk::ImageFileReader only seems to support reading from a file, so that seems out.
itk::ImportImageFilter seems to deal with image data that has no corresponding metadata (or metadata that has been obtained from elsewhere). I could theoretically read through all of the metadata in the NRRD header, set it on the filter, and then import the actual data through that filter. I’m not 100% sure that would work, but either way, I would like to avoid re-implementing
I’ve spent a while looking around the internet for people trying to solve similar problems, and I am feeling a bit alone here. This poster had essentially the same problem, but got no responses. There is also this thread and the links that come off it (1, 2), where people talk quite optimistically about solving this. But it all links back to itk::FileFreeImageIO, which looks to me to be incomplete. I’m hoping I just don’t understand how it should be used. Could anyone give me a bit of direction?