.. _readblock: readblock ********* There are 2 forms of this command. :code:`readblock(image name, filename, x, y, z, block width, block height, block depth, data type)` =================================================================================================== Reads a block of an image from a file. If the file is a .raw file, special conditions apply: Dimensions of the .raw file do not need to be specified if the file name is in format name_WxHxD.raw, where [W, H, D] are the dimensions of the image. The system tries to guess the pixel data type, too, based on the file size and dimensions of the image as follows. If pixel size in bytes is 1, the system sets the pixel type to uint8. If pixel size in bytes is 2, the system sets the pixel type to uint16. If pixel size in bytes is 4, float32 pixel data is assumed (instead of e.g. int32 or uint32). If pixel size in bytes is 8, pixels are assumed to be of type uint64 (instead of e.g. int64 or complex32). If the guess is wrong, the pixel data type must be explicitly specified using the corresponding argument. Even in this case the dimensions can be read from the name of the file if the file name contains the dimensions. This command cannot be used in the distributed processing mode. If you need it, please contact the authors. Arguments --------- image name [input] ~~~~~~~~~~~~~~~~~~ **Data type:** string Name of image in the system. filename [input] ~~~~~~~~~~~~~~~~ **Data type:** string Name (and path) of file to read. x [input] ~~~~~~~~~ **Data type:** integer X-coordinate of the first pixel to read. y [input] ~~~~~~~~~ **Data type:** integer Y-coordinate of the first pixel to read. z [input] ~~~~~~~~~ **Data type:** integer Z-coordinate of the first pixel to read. block width [input] ~~~~~~~~~~~~~~~~~~~ **Data type:** integer Width of block to read. block height [input] ~~~~~~~~~~~~~~~~~~~~ **Data type:** integer Height of block to read. block depth [input] ~~~~~~~~~~~~~~~~~~~ **Data type:** integer Depth of block to read. data type [input] ~~~~~~~~~~~~~~~~~ **Data type:** string **Default value:** "" Data type of the image. Used only if reading .raw images. Leave empty to guess data type based on file size. :code:`readblock(image name, filename, position, block size, data type)` ======================================================================== Reads a block of an image from a file. If the file is a .raw file, special conditions apply: Dimensions of the .raw file do not need to be specified if the file name is in format name_WxHxD.raw, where [W, H, D] are the dimensions of the image. The system tries to guess the pixel data type, too, based on the file size and dimensions of the image as follows. If pixel size in bytes is 1, the system sets the pixel type to uint8. If pixel size in bytes is 2, the system sets the pixel type to uint16. If pixel size in bytes is 4, float32 pixel data is assumed (instead of e.g. int32 or uint32). If pixel size in bytes is 8, pixels are assumed to be of type uint64 (instead of e.g. int64 or complex32). If the guess is wrong, the pixel data type must be explicitly specified using the corresponding argument. Even in this case the dimensions can be read from the name of the file if the file name contains the dimensions. This command cannot be used in the distributed processing mode. If you need it, please contact the authors. Arguments --------- image name [input] ~~~~~~~~~~~~~~~~~~ **Data type:** string Name of image in the system. filename [input] ~~~~~~~~~~~~~~~~ **Data type:** string Name (and path) of file to read. position [input] ~~~~~~~~~~~~~~~~ **Data type:** 3-component integer vector Coordinates of the first pixel to read. block size [input] ~~~~~~~~~~~~~~~~~~ **Data type:** 3-component integer vector Dimensions of the block to read. data type [input] ~~~~~~~~~~~~~~~~~ **Data type:** string **Default value:** "" Data type of the image. Used only if reading .raw images. Leave empty to guess data type based on file size.