@@ -49,7 +49,6 @@ Encoding of NumPy ndarrays is supported for the following:
49
49
* Number of rows/columns: up to 65535
50
50
* Number of planes: 1, 3 or 4
51
51
52
-
53
52
### Transfer Syntaxes
54
53
| UID | Description |
55
54
| --- | --- |
@@ -95,38 +94,38 @@ Lossless encoding of RGB with multiple-component transformation:
95
94
``` python
96
95
97
96
import numpy as np
98
- from openjpeg import encode
97
+ from openjpeg import encode_array
99
98
100
- arr = np.random.randint(low = 0 , high = 65535 , size = (100 , 100 , 3 ), dtype = " uint8" )
101
- encode (arr, photometric_interpretation = 1 ) # 1: sRGB
99
+ arr = np.random.randint(low = 0 , high = 65536 , size = (100 , 100 , 3 ), dtype = " uint8" )
100
+ encode_array (arr, photometric_interpretation = 1 ) # 1: sRGB
102
101
```
103
102
104
103
Lossy encoding of a monochrome image using compression ratios:
105
104
106
105
``` python
107
106
108
107
import numpy as np
109
- from openjpeg import encode
108
+ from openjpeg import encode_array
110
109
111
- arr = np.random.randint(low = - 2 ** 15 , high = 2 ** 15 - 1 , size = (100 , 100 ), dtype = " int8" )
110
+ arr = np.random.randint(low = - 2 ** 15 , high = 2 ** 15 , size = (100 , 100 ), dtype = " int8" )
112
111
# You must determine your own values for `compression_ratios`
113
112
# as these are for illustration purposes only
114
- encode (arr, compression_ratios = [2 , 4 , 6 ])
113
+ encode_array (arr, compression_ratios = [5 , 2 ])
115
114
```
116
115
117
116
Lossy encoding of a monochrome image using peak signal-to-noise ratios:
118
117
119
118
``` python
120
119
121
120
import numpy as np
122
- from openjpeg import encode
121
+ from openjpeg import encode_array
123
122
124
- arr = np.random.randint(low = - 2 ** 15 , high = 2 ** 15 - 1 , size = (100 , 100 ), dtype = " int8" )
123
+ arr = np.random.randint(low = - 2 ** 15 , high = 2 ** 15 , size = (100 , 100 ), dtype = " int8" )
125
124
# You must determine your own values for `signal_noise_ratios`
126
125
# as these are for illustration purposes only
127
- encode (arr, signal_noise_ratios = [50 , 80 , 100 ])
126
+ encode_array (arr, signal_noise_ratios = [50 , 80 , 100 ])
128
127
```
129
128
130
- See the docstring for the [ encode () function] [ 2 ] for full details.
129
+ See the docstring for the [ encode_array () function] [ 2 ] for full details.
131
130
132
- [ 2 ] : https://github.com/pydicom/pylibjpeg-openjpeg/blob/main/openjpeg/utils.py#L428
131
+ [ 2 ] : https://github.com/pydicom/pylibjpeg-openjpeg/blob/main/openjpeg/utils.py#L429
0 commit comments