Note that the ImageIO objects are not templated. This is done basically by passing the filename to a centralized class, the itk::ImageIOFactory and asking it to identify any subclass of ImageIO capable of reading or writing the user-specified file.
Each class derived from ImageIO must provide an associated factory class capable of producing an instance of the ImageIO class. Specify the intrinsic coordinates of the rectangular subsection you want to work with and save it to a file from the command line.
Note For indexed images, imread always reads the colormap into an array of class double, even though the image array itself can be of class uint8 or uint Many of the images used in MATLAB are 8-bit, and most graphics file format images do not require double-precision data.
In cases where the user knows what file format to use and wants to indicate this explicitly, a specific itk::ImageIO class can be instantiated and assigned to the image file reader or writer.
It is possible, however, to explicitly select the type of ImageIO object to use. For example, we can create a short pipeline by passing the output of the reader directly to the input of the writer.