/
readraw.txt
110 lines (64 loc) · 4.1 KB
/
readraw.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
.. _readraw:
readraw
*******
There are 2 forms of this command.
:code:`readraw(image name, filename, data type, width, height, depth)`
======================================================================
Reads a .raw image from a file. If the image is not in the native byte order of the host computer, the byte order may be changed using :ref:`swapbyteorder` command. 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 can be used in the distributed processing mode. Use :ref:`distribute` command to change processing mode from local to distributed.
Arguments
---------
image name [input]
~~~~~~~~~~~~~~~~~~
**Data type:** string
Name of image to create.
filename [input]
~~~~~~~~~~~~~~~~
**Data type:** string
Name (and path) of file to read.
data type [input]
~~~~~~~~~~~~~~~~~
**Data type:** string
Data type of the image. Can be uint8, uint16, uint32, uint64, int8, int16, int32, int64, float32, or complex32. Specify empty value to infer data type from file size.
width [input]
~~~~~~~~~~~~~
**Data type:** integer
Width of the image. Omit width, height and depth to infer dimensions from file name.
height [input]
~~~~~~~~~~~~~~
**Data type:** integer
Height of the image. Omit width, height and depth to infer dimensions from file name.
depth [input]
~~~~~~~~~~~~~
**Data type:** integer
Depth of the image. Omit width, height and depth to infer dimensions from file name.
See also
--------
:ref:`mapraw`, :ref:`readrawblock`
:code:`readraw(image name, filename, data type, dimensions)`
============================================================
Reads a .raw image from a file. If the image is not in the native byte order of the host computer, the byte order may be changed using :ref:`swapbyteorder` command. 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 can be used in the distributed processing mode. Use :ref:`distribute` command to change processing mode from local to distributed.
Arguments
---------
image name [input]
~~~~~~~~~~~~~~~~~~
**Data type:** string
Name of image to create.
filename [input]
~~~~~~~~~~~~~~~~
**Data type:** string
Name (and path) of file to read.
data type [input]
~~~~~~~~~~~~~~~~~
**Data type:** string
**Default value:** ""
Data type of the image. Can be uint8, uint16, uint32, uint64, int8, int16, int32, int64, float32, or complex32. Specify empty value to infer data type from file size.
dimensions [input]
~~~~~~~~~~~~~~~~~~
**Data type:** 3-component integer vector
**Default value:** "[0, 0, 0]"
Size of the image. Set to zero to infer dimensions from file name.
See also
--------
:ref:`mapraw`, :ref:`readrawblock`