Two libraries support the writing/reading of data "slices" to/from full (and potentially larger) images. libDRMS provides drms_segment_writeslice() and drms_segment_readslice(). drms_segment_writeslice() takes an output data array and two vectors as input. The data array contains the slice that will be written into a region of the full image. The two vectors, each with a rank that matches the number of dimensions of the full image, specify the location in the full image to where the slice should be written. One vector, the "start" vector, specifies the "lower-left corner" of a bounding box that resides within the full image. The other vector, the "end" vector, specifies the "upper-right corner" of the bounding box. The bounding box thus described is exactly the same size as the slice to be written - drms_segment_writeslice() will write the slice into the bounding box with the data in the slice completely "filling" the bounding box.

drms_segment_readslice()